# coding: utf-8

"""
    Ephor.ai

    Collaborative AI

    The version of the OpenAPI document: 1.3.0
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import StrictStr
from typing import List, Optional
from ephor_server_ti_client.models.attachment_download_response import AttachmentDownloadResponse
from ephor_server_ti_client.models.attachment_upload_request import AttachmentUploadRequest
from ephor_server_ti_client.models.attachment_upload_response import AttachmentUploadResponse
from ephor_server_ti_client.models.conversation_input import ConversationInput
from ephor_server_ti_client.models.conversation_output import ConversationOutput

from ephor_server_ti_client.api_client import ApiClient, RequestSerialized
from ephor_server_ti_client.api_response import ApiResponse
from ephor_server_ti_client.rest import RESTResponseType


class ConversationsApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client


    @validate_call
    def create_conversation_api_v1_conversations_post(
        self,
        conversation_input: ConversationInput,
    ) -> ConversationOutput:
        """Create Conversation


        :param conversation_input: (required)
        :type conversation_input: ConversationInput
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._create_conversation_api_v1_conversations_post_serialize(
            conversation_input=conversation_input,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ConversationOutput",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def create_conversation_api_v1_conversations_post_with_http_info(
        self,
        conversation_input: ConversationInput,
    ) -> ApiResponse[ConversationOutput]:
        """Create Conversation


        :param conversation_input: (required)
        :type conversation_input: ConversationInput
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._create_conversation_api_v1_conversations_post_serialize(
            conversation_input=conversation_input,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ConversationOutput",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def create_conversation_api_v1_conversations_post_without_preload_content(
        self,
        conversation_input: ConversationInput,
    ) -> RESTResponseType:
        """Create Conversation


        :param conversation_input: (required)
        :type conversation_input: ConversationInput
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._create_conversation_api_v1_conversations_post_serialize(
            conversation_input=conversation_input,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ConversationOutput",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        return response_data.response


    def _create_conversation_api_v1_conversations_post_serialize(
        self,
        conversation_input,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if conversation_input is not None:
            _body_params = conversation_input


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyHeader'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/conversations/',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def delete_attachment_api_v1_conversations_attachments_attachment_id_delete(
        self,
        attachment_id: StrictStr,
    ) -> None:
        """Delete Attachment


        :param attachment_id: (required)
        :type attachment_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_attachment_api_v1_conversations_attachments_attachment_id_delete_serialize(
            attachment_id=attachment_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': None,
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def delete_attachment_api_v1_conversations_attachments_attachment_id_delete_with_http_info(
        self,
        attachment_id: StrictStr,
    ) -> ApiResponse[None]:
        """Delete Attachment


        :param attachment_id: (required)
        :type attachment_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_attachment_api_v1_conversations_attachments_attachment_id_delete_serialize(
            attachment_id=attachment_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': None,
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def delete_attachment_api_v1_conversations_attachments_attachment_id_delete_without_preload_content(
        self,
        attachment_id: StrictStr,
    ) -> RESTResponseType:
        """Delete Attachment


        :param attachment_id: (required)
        :type attachment_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_attachment_api_v1_conversations_attachments_attachment_id_delete_serialize(
            attachment_id=attachment_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': None,
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        return response_data.response


    def _delete_attachment_api_v1_conversations_attachments_attachment_id_delete_serialize(
        self,
        attachment_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if attachment_id is not None:
            _path_params['attachment_id'] = attachment_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyHeader'
        ]

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/api/v1/conversations/attachments/{attachment_id}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def delete_conversation_api_v1_conversations_conversation_id_delete(
        self,
        conversation_id: StrictStr,
    ) -> ConversationOutput:
        """Delete Conversation


        :param conversation_id: (required)
        :type conversation_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_conversation_api_v1_conversations_conversation_id_delete_serialize(
            conversation_id=conversation_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ConversationOutput",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def delete_conversation_api_v1_conversations_conversation_id_delete_with_http_info(
        self,
        conversation_id: StrictStr,
    ) -> ApiResponse[ConversationOutput]:
        """Delete Conversation


        :param conversation_id: (required)
        :type conversation_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_conversation_api_v1_conversations_conversation_id_delete_serialize(
            conversation_id=conversation_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ConversationOutput",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def delete_conversation_api_v1_conversations_conversation_id_delete_without_preload_content(
        self,
        conversation_id: StrictStr,
    ) -> RESTResponseType:
        """Delete Conversation


        :param conversation_id: (required)
        :type conversation_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_conversation_api_v1_conversations_conversation_id_delete_serialize(
            conversation_id=conversation_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ConversationOutput",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        return response_data.response


    def _delete_conversation_api_v1_conversations_conversation_id_delete_serialize(
        self,
        conversation_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if conversation_id is not None:
            _path_params['conversation_id'] = conversation_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyHeader'
        ]

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/api/v1/conversations/{conversation_id}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_attachment_api_v1_conversations_attachments_attachment_id_get(
        self,
        attachment_id: StrictStr,
    ) -> AttachmentDownloadResponse:
        """Get Attachment


        :param attachment_id: (required)
        :type attachment_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_attachment_api_v1_conversations_attachments_attachment_id_get_serialize(
            attachment_id=attachment_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AttachmentDownloadResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_attachment_api_v1_conversations_attachments_attachment_id_get_with_http_info(
        self,
        attachment_id: StrictStr,
    ) -> ApiResponse[AttachmentDownloadResponse]:
        """Get Attachment


        :param attachment_id: (required)
        :type attachment_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_attachment_api_v1_conversations_attachments_attachment_id_get_serialize(
            attachment_id=attachment_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AttachmentDownloadResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_attachment_api_v1_conversations_attachments_attachment_id_get_without_preload_content(
        self,
        attachment_id: StrictStr,
    ) -> RESTResponseType:
        """Get Attachment


        :param attachment_id: (required)
        :type attachment_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_attachment_api_v1_conversations_attachments_attachment_id_get_serialize(
            attachment_id=attachment_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AttachmentDownloadResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        return response_data.response


    def _get_attachment_api_v1_conversations_attachments_attachment_id_get_serialize(
        self,
        attachment_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if attachment_id is not None:
            _path_params['attachment_id'] = attachment_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyHeader'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/conversations/attachments/{attachment_id}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_conversation_api_v1_conversations_conversation_id_get(
        self,
        conversation_id: StrictStr,
    ) -> ConversationOutput:
        """Get Conversation


        :param conversation_id: (required)
        :type conversation_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_conversation_api_v1_conversations_conversation_id_get_serialize(
            conversation_id=conversation_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ConversationOutput",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_conversation_api_v1_conversations_conversation_id_get_with_http_info(
        self,
        conversation_id: StrictStr,
    ) -> ApiResponse[ConversationOutput]:
        """Get Conversation


        :param conversation_id: (required)
        :type conversation_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_conversation_api_v1_conversations_conversation_id_get_serialize(
            conversation_id=conversation_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ConversationOutput",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_conversation_api_v1_conversations_conversation_id_get_without_preload_content(
        self,
        conversation_id: StrictStr,
    ) -> RESTResponseType:
        """Get Conversation


        :param conversation_id: (required)
        :type conversation_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_conversation_api_v1_conversations_conversation_id_get_serialize(
            conversation_id=conversation_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ConversationOutput",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        return response_data.response


    def _get_conversation_api_v1_conversations_conversation_id_get_serialize(
        self,
        conversation_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if conversation_id is not None:
            _path_params['conversation_id'] = conversation_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyHeader'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/conversations/{conversation_id}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_conversations_api_v1_conversations_get(
        self,
        project_id: Optional[StrictStr] = None,
    ) -> List[ConversationOutput]:
        """Get Conversations


        :param project_id:
        :type project_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_conversations_api_v1_conversations_get_serialize(
            project_id=project_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ConversationOutput]",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_conversations_api_v1_conversations_get_with_http_info(
        self,
        project_id: Optional[StrictStr] = None,
    ) -> ApiResponse[List[ConversationOutput]]:
        """Get Conversations


        :param project_id:
        :type project_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_conversations_api_v1_conversations_get_serialize(
            project_id=project_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ConversationOutput]",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_conversations_api_v1_conversations_get_without_preload_content(
        self,
        project_id: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """Get Conversations


        :param project_id:
        :type project_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_conversations_api_v1_conversations_get_serialize(
            project_id=project_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ConversationOutput]",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        return response_data.response


    def _get_conversations_api_v1_conversations_get_serialize(
        self,
        project_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if project_id is not None:
            
            _query_params.append(('project_id', project_id))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyHeader'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/conversations/',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_message_models_api_v1_conversations_conversation_id_messages_message_id_models_get(
        self,
        conversation_id: StrictStr,
        message_id: StrictStr,
    ) -> List[str]:
        """Get Message Models

        Get all available model IDs for a specific message

        :param conversation_id: (required)
        :type conversation_id: str
        :param message_id: (required)
        :type message_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_message_models_api_v1_conversations_conversation_id_messages_message_id_models_get_serialize(
            conversation_id=conversation_id,
            message_id=message_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[str]",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_message_models_api_v1_conversations_conversation_id_messages_message_id_models_get_with_http_info(
        self,
        conversation_id: StrictStr,
        message_id: StrictStr,
    ) -> ApiResponse[List[str]]:
        """Get Message Models

        Get all available model IDs for a specific message

        :param conversation_id: (required)
        :type conversation_id: str
        :param message_id: (required)
        :type message_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_message_models_api_v1_conversations_conversation_id_messages_message_id_models_get_serialize(
            conversation_id=conversation_id,
            message_id=message_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[str]",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_message_models_api_v1_conversations_conversation_id_messages_message_id_models_get_without_preload_content(
        self,
        conversation_id: StrictStr,
        message_id: StrictStr,
    ) -> RESTResponseType:
        """Get Message Models

        Get all available model IDs for a specific message

        :param conversation_id: (required)
        :type conversation_id: str
        :param message_id: (required)
        :type message_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_message_models_api_v1_conversations_conversation_id_messages_message_id_models_get_serialize(
            conversation_id=conversation_id,
            message_id=message_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[str]",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        return response_data.response


    def _get_message_models_api_v1_conversations_conversation_id_messages_message_id_models_get_serialize(
        self,
        conversation_id,
        message_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if conversation_id is not None:
            _path_params['conversation_id'] = conversation_id
        if message_id is not None:
            _path_params['message_id'] = message_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyHeader'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/conversations/{conversation_id}/messages/{message_id}/models',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def update_conversation_api_v1_conversations_conversation_id_put(
        self,
        conversation_id: StrictStr,
        conversation_input: ConversationInput,
    ) -> ConversationOutput:
        """Update Conversation


        :param conversation_id: (required)
        :type conversation_id: str
        :param conversation_input: (required)
        :type conversation_input: ConversationInput
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_conversation_api_v1_conversations_conversation_id_put_serialize(
            conversation_id=conversation_id,
            conversation_input=conversation_input,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ConversationOutput",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def update_conversation_api_v1_conversations_conversation_id_put_with_http_info(
        self,
        conversation_id: StrictStr,
        conversation_input: ConversationInput,
    ) -> ApiResponse[ConversationOutput]:
        """Update Conversation


        :param conversation_id: (required)
        :type conversation_id: str
        :param conversation_input: (required)
        :type conversation_input: ConversationInput
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_conversation_api_v1_conversations_conversation_id_put_serialize(
            conversation_id=conversation_id,
            conversation_input=conversation_input,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ConversationOutput",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def update_conversation_api_v1_conversations_conversation_id_put_without_preload_content(
        self,
        conversation_id: StrictStr,
        conversation_input: ConversationInput,
    ) -> RESTResponseType:
        """Update Conversation


        :param conversation_id: (required)
        :type conversation_id: str
        :param conversation_input: (required)
        :type conversation_input: ConversationInput
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_conversation_api_v1_conversations_conversation_id_put_serialize(
            conversation_id=conversation_id,
            conversation_input=conversation_input,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ConversationOutput",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        return response_data.response


    def _update_conversation_api_v1_conversations_conversation_id_put_serialize(
        self,
        conversation_id,
        conversation_input,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if conversation_id is not None:
            _path_params['conversation_id'] = conversation_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if conversation_input is not None:
            _body_params = conversation_input


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyHeader'
        ]

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/api/v1/conversations/{conversation_id}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def upload_attachment_api_v1_conversations_attachments_post(
        self,
        attachment_upload_request: AttachmentUploadRequest,
    ) -> AttachmentUploadResponse:
        """Upload Attachment


        :param attachment_upload_request: (required)
        :type attachment_upload_request: AttachmentUploadRequest
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._upload_attachment_api_v1_conversations_attachments_post_serialize(
            attachment_upload_request=attachment_upload_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AttachmentUploadResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def upload_attachment_api_v1_conversations_attachments_post_with_http_info(
        self,
        attachment_upload_request: AttachmentUploadRequest,
    ) -> ApiResponse[AttachmentUploadResponse]:
        """Upload Attachment


        :param attachment_upload_request: (required)
        :type attachment_upload_request: AttachmentUploadRequest
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._upload_attachment_api_v1_conversations_attachments_post_serialize(
            attachment_upload_request=attachment_upload_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AttachmentUploadResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def upload_attachment_api_v1_conversations_attachments_post_without_preload_content(
        self,
        attachment_upload_request: AttachmentUploadRequest,
    ) -> RESTResponseType:
        """Upload Attachment


        :param attachment_upload_request: (required)
        :type attachment_upload_request: AttachmentUploadRequest
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._upload_attachment_api_v1_conversations_attachments_post_serialize(
            attachment_upload_request=attachment_upload_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AttachmentUploadResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=None
        )
        return response_data.response


    def _upload_attachment_api_v1_conversations_attachments_post_serialize(
        self,
        attachment_upload_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if attachment_upload_request is not None:
            _body_params = attachment_upload_request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyHeader'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/conversations/attachments',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


