# 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 Any, Optional
from ephor_server_ti_client.models.ingest_local_file_request import IngestLocalFileRequest
from ephor_server_ti_client.models.ingest_request import IngestRequest
from ephor_server_ti_client.models.ingest_response import IngestResponse
from ephor_server_ti_client.models.ingest_stats import IngestStats
from ephor_server_ti_client.models.ingest_video_request import IngestVideoRequest
from ephor_server_ti_client.models.library_item_response import LibraryItemResponse
from ephor_server_ti_client.models.library_response import LibraryResponse
from ephor_server_ti_client.models.refresh_response import RefreshResponse
from ephor_server_ti_client.models.retrieve_request import RetrieveRequest
from ephor_server_ti_client.models.retrieve_response import RetrieveResponse
from ephor_server_ti_client.models.update_document_request import UpdateDocumentRequest
from ephor_server_ti_client.models.workflowy_refresh_request import WorkflowyRefreshRequest
from ephor_server_ti_client.models.workflowy_secret_link_request import WorkflowySecretLinkRequest

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 LibraryApi:
    """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 delete_library_item_api_v1_library_library_id_index_reference_delete(
        self,
        library_id: StrictStr,
        index_reference: StrictStr,
    ) -> None:
        """Delete Library Item

        Delete a library item.  Args:     index_reference (str): The ID of the item to delete.     auth (EndpointAuth): The authenticated endpoint information.  Raises:     HTTPException: If there's an error deleting the library item.

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

        _param = self._delete_library_item_api_v1_library_library_id_index_reference_delete_serialize(
            library_id=library_id,
            index_reference=index_reference,
            _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_library_item_api_v1_library_library_id_index_reference_delete_with_http_info(
        self,
        library_id: StrictStr,
        index_reference: StrictStr,
    ) -> ApiResponse[None]:
        """Delete Library Item

        Delete a library item.  Args:     index_reference (str): The ID of the item to delete.     auth (EndpointAuth): The authenticated endpoint information.  Raises:     HTTPException: If there's an error deleting the library item.

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

        _param = self._delete_library_item_api_v1_library_library_id_index_reference_delete_serialize(
            library_id=library_id,
            index_reference=index_reference,
            _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_library_item_api_v1_library_library_id_index_reference_delete_without_preload_content(
        self,
        library_id: StrictStr,
        index_reference: StrictStr,
    ) -> RESTResponseType:
        """Delete Library Item

        Delete a library item.  Args:     index_reference (str): The ID of the item to delete.     auth (EndpointAuth): The authenticated endpoint information.  Raises:     HTTPException: If there's an error deleting the library item.

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

        _param = self._delete_library_item_api_v1_library_library_id_index_reference_delete_serialize(
            library_id=library_id,
            index_reference=index_reference,
            _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_library_item_api_v1_library_library_id_index_reference_delete_serialize(
        self,
        library_id,
        index_reference,
        _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 library_id is not None:
            _path_params['library_id'] = library_id
        if index_reference is not None:
            _path_params['index_reference'] = index_reference
        # 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/library/{library_id}/{index_reference}',
            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_manifest_item_api_v1_library_library_id_index_reference_item_item_id_delete(
        self,
        library_id: StrictStr,
        index_reference: StrictStr,
        item_id: StrictStr,
    ) -> None:
        """Delete Manifest Item

        Delete a manifest item.  Args:     auth (EndpointAuth): The authenticated endpoint information.  Raises:     HTTPException: If there's an error deleting the manifest item.

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

        _param = self._delete_manifest_item_api_v1_library_library_id_index_reference_item_item_id_delete_serialize(
            library_id=library_id,
            index_reference=index_reference,
            item_id=item_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_manifest_item_api_v1_library_library_id_index_reference_item_item_id_delete_with_http_info(
        self,
        library_id: StrictStr,
        index_reference: StrictStr,
        item_id: StrictStr,
    ) -> ApiResponse[None]:
        """Delete Manifest Item

        Delete a manifest item.  Args:     auth (EndpointAuth): The authenticated endpoint information.  Raises:     HTTPException: If there's an error deleting the manifest item.

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

        _param = self._delete_manifest_item_api_v1_library_library_id_index_reference_item_item_id_delete_serialize(
            library_id=library_id,
            index_reference=index_reference,
            item_id=item_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_manifest_item_api_v1_library_library_id_index_reference_item_item_id_delete_without_preload_content(
        self,
        library_id: StrictStr,
        index_reference: StrictStr,
        item_id: StrictStr,
    ) -> RESTResponseType:
        """Delete Manifest Item

        Delete a manifest item.  Args:     auth (EndpointAuth): The authenticated endpoint information.  Raises:     HTTPException: If there's an error deleting the manifest item.

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

        _param = self._delete_manifest_item_api_v1_library_library_id_index_reference_item_item_id_delete_serialize(
            library_id=library_id,
            index_reference=index_reference,
            item_id=item_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_manifest_item_api_v1_library_library_id_index_reference_item_item_id_delete_serialize(
        self,
        library_id,
        index_reference,
        item_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 library_id is not None:
            _path_params['library_id'] = library_id
        if index_reference is not None:
            _path_params['index_reference'] = index_reference
        if item_id is not None:
            _path_params['item_id'] = item_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/library/{library_id}/{index_reference}/item/{item_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_indexing_stats_api_v1_library_ingest_stats_namespace_get(
        self,
        namespace: StrictStr,
    ) -> IngestStats:
        """Get Indexing Stats

        Get the indexing stats for a given namespace.  Args:     namespace (str): The namespace to check the stats for.  Returns:     IngestStats: A dictionary containing the stats information.  Raises:     HTTPException: If there's an error during the stats check.

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

        _param = self._get_indexing_stats_api_v1_library_ingest_stats_namespace_get_serialize(
            namespace=namespace,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "IngestStats",
            '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_indexing_stats_api_v1_library_ingest_stats_namespace_get_with_http_info(
        self,
        namespace: StrictStr,
    ) -> ApiResponse[IngestStats]:
        """Get Indexing Stats

        Get the indexing stats for a given namespace.  Args:     namespace (str): The namespace to check the stats for.  Returns:     IngestStats: A dictionary containing the stats information.  Raises:     HTTPException: If there's an error during the stats check.

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

        _param = self._get_indexing_stats_api_v1_library_ingest_stats_namespace_get_serialize(
            namespace=namespace,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "IngestStats",
            '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_indexing_stats_api_v1_library_ingest_stats_namespace_get_without_preload_content(
        self,
        namespace: StrictStr,
    ) -> RESTResponseType:
        """Get Indexing Stats

        Get the indexing stats for a given namespace.  Args:     namespace (str): The namespace to check the stats for.  Returns:     IngestStats: A dictionary containing the stats information.  Raises:     HTTPException: If there's an error during the stats check.

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

        _param = self._get_indexing_stats_api_v1_library_ingest_stats_namespace_get_serialize(
            namespace=namespace,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

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


    def _get_indexing_stats_api_v1_library_ingest_stats_namespace_get_serialize(
        self,
        namespace,
        _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 namespace is not None:
            _path_params['namespace'] = namespace
        # 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/library/ingest/stats/{namespace}',
            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_library_api_v1_library_library_id_get(
        self,
        library_id: StrictStr,
    ) -> LibraryResponse:
        """Get Library

        Get the library items for the specified library id.

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

        _param = self._get_library_api_v1_library_library_id_get_serialize(
            library_id=library_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "LibraryResponse",
            '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_library_api_v1_library_library_id_get_with_http_info(
        self,
        library_id: StrictStr,
    ) -> ApiResponse[LibraryResponse]:
        """Get Library

        Get the library items for the specified library id.

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

        _param = self._get_library_api_v1_library_library_id_get_serialize(
            library_id=library_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "LibraryResponse",
            '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_library_api_v1_library_library_id_get_without_preload_content(
        self,
        library_id: StrictStr,
    ) -> RESTResponseType:
        """Get Library

        Get the library items for the specified library id.

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

        _param = self._get_library_api_v1_library_library_id_get_serialize(
            library_id=library_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

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


    def _get_library_api_v1_library_library_id_get_serialize(
        self,
        library_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 library_id is not None:
            _path_params['library_id'] = library_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/library/{library_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_library_item_api_v1_library_folder_index_reference_get(
        self,
        index_reference: StrictStr,
    ) -> LibraryItemResponse:
        """Get Library Item

        Get the library item for the specified index_reference.

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

        _param = self._get_library_item_api_v1_library_folder_index_reference_get_serialize(
            index_reference=index_reference,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "LibraryItemResponse",
            '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_library_item_api_v1_library_folder_index_reference_get_with_http_info(
        self,
        index_reference: StrictStr,
    ) -> ApiResponse[LibraryItemResponse]:
        """Get Library Item

        Get the library item for the specified index_reference.

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

        _param = self._get_library_item_api_v1_library_folder_index_reference_get_serialize(
            index_reference=index_reference,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "LibraryItemResponse",
            '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_library_item_api_v1_library_folder_index_reference_get_without_preload_content(
        self,
        index_reference: StrictStr,
    ) -> RESTResponseType:
        """Get Library Item

        Get the library item for the specified index_reference.

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

        _param = self._get_library_item_api_v1_library_folder_index_reference_get_serialize(
            index_reference=index_reference,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

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


    def _get_library_item_api_v1_library_folder_index_reference_get_serialize(
        self,
        index_reference,
        _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 index_reference is not None:
            _path_params['index_reference'] = index_reference
        # 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/library/folder/{index_reference}',
            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 ingest_documents_api_v1_library_ingest_post(
        self,
        ingest_request: IngestRequest,
    ) -> IngestResponse:
        """Ingest Documents

        Ingest documents from a Google Drive folder.  Args:     request (IngestRequest): The ingest request details.     background_tasks (BackgroundTasks): FastAPI's background tasks handler.     library_id (str): The library ID to add the ingested documents to. Returns:     IngestResponse: Response containing ingest process details.  Raises:     HTTPException: If there's an error during the ingestion process.

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

        _param = self._ingest_documents_api_v1_library_ingest_post_serialize(
            ingest_request=ingest_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "IngestResponse",
            '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 ingest_documents_api_v1_library_ingest_post_with_http_info(
        self,
        ingest_request: IngestRequest,
    ) -> ApiResponse[IngestResponse]:
        """Ingest Documents

        Ingest documents from a Google Drive folder.  Args:     request (IngestRequest): The ingest request details.     background_tasks (BackgroundTasks): FastAPI's background tasks handler.     library_id (str): The library ID to add the ingested documents to. Returns:     IngestResponse: Response containing ingest process details.  Raises:     HTTPException: If there's an error during the ingestion process.

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

        _param = self._ingest_documents_api_v1_library_ingest_post_serialize(
            ingest_request=ingest_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "IngestResponse",
            '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 ingest_documents_api_v1_library_ingest_post_without_preload_content(
        self,
        ingest_request: IngestRequest,
    ) -> RESTResponseType:
        """Ingest Documents

        Ingest documents from a Google Drive folder.  Args:     request (IngestRequest): The ingest request details.     background_tasks (BackgroundTasks): FastAPI's background tasks handler.     library_id (str): The library ID to add the ingested documents to. Returns:     IngestResponse: Response containing ingest process details.  Raises:     HTTPException: If there's an error during the ingestion process.

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

        _param = self._ingest_documents_api_v1_library_ingest_post_serialize(
            ingest_request=ingest_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

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


    def _ingest_documents_api_v1_library_ingest_post_serialize(
        self,
        ingest_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 ingest_request is not None:
            _body_params = ingest_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/library/ingest/',
            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 ingest_local_file_api_v1_library_ingest_local_file_post(
        self,
        ingest_local_file_request: IngestLocalFileRequest,
    ) -> IngestResponse:
        """Ingest Local File

        Ingest a local file.  Args:     request (IngestLocalFileRequest): The ingest request details.     background_tasks (BackgroundTasks): FastAPI's background tasks handler.  Returns:     IngestResponse: Response containing ingest process details.  Raises:     HTTPException: If there's an error during the ingestion process.

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

        _param = self._ingest_local_file_api_v1_library_ingest_local_file_post_serialize(
            ingest_local_file_request=ingest_local_file_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "IngestResponse",
            '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 ingest_local_file_api_v1_library_ingest_local_file_post_with_http_info(
        self,
        ingest_local_file_request: IngestLocalFileRequest,
    ) -> ApiResponse[IngestResponse]:
        """Ingest Local File

        Ingest a local file.  Args:     request (IngestLocalFileRequest): The ingest request details.     background_tasks (BackgroundTasks): FastAPI's background tasks handler.  Returns:     IngestResponse: Response containing ingest process details.  Raises:     HTTPException: If there's an error during the ingestion process.

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

        _param = self._ingest_local_file_api_v1_library_ingest_local_file_post_serialize(
            ingest_local_file_request=ingest_local_file_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "IngestResponse",
            '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 ingest_local_file_api_v1_library_ingest_local_file_post_without_preload_content(
        self,
        ingest_local_file_request: IngestLocalFileRequest,
    ) -> RESTResponseType:
        """Ingest Local File

        Ingest a local file.  Args:     request (IngestLocalFileRequest): The ingest request details.     background_tasks (BackgroundTasks): FastAPI's background tasks handler.  Returns:     IngestResponse: Response containing ingest process details.  Raises:     HTTPException: If there's an error during the ingestion process.

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

        _param = self._ingest_local_file_api_v1_library_ingest_local_file_post_serialize(
            ingest_local_file_request=ingest_local_file_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

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


    def _ingest_local_file_api_v1_library_ingest_local_file_post_serialize(
        self,
        ingest_local_file_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 ingest_local_file_request is not None:
            _body_params = ingest_local_file_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/library/ingest/local-file',
            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 ingest_private_chats_api_v1_library_privatechats_project_id_library_id_post(
        self,
        project_id: StrictStr,
        library_id: StrictStr,
    ) -> None:
        """Ingest Private Chats

        Trigger an ingestion of private chats for a project. Content is checked, md5 hashed, and vector embeddings made and pushed to pinecone only if it's a new chat or if the hash value has changed compared to before. Args:     project_id: The project for which to trigger private_chat ingestion     library_id: The project's associated library where the namespace is saved Raises:     HTTPException: If there's an error in executing the function

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

        _param = self._ingest_private_chats_api_v1_library_privatechats_project_id_library_id_post_serialize(
            project_id=project_id,
            library_id=library_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 ingest_private_chats_api_v1_library_privatechats_project_id_library_id_post_with_http_info(
        self,
        project_id: StrictStr,
        library_id: StrictStr,
    ) -> ApiResponse[None]:
        """Ingest Private Chats

        Trigger an ingestion of private chats for a project. Content is checked, md5 hashed, and vector embeddings made and pushed to pinecone only if it's a new chat or if the hash value has changed compared to before. Args:     project_id: The project for which to trigger private_chat ingestion     library_id: The project's associated library where the namespace is saved Raises:     HTTPException: If there's an error in executing the function

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

        _param = self._ingest_private_chats_api_v1_library_privatechats_project_id_library_id_post_serialize(
            project_id=project_id,
            library_id=library_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 ingest_private_chats_api_v1_library_privatechats_project_id_library_id_post_without_preload_content(
        self,
        project_id: StrictStr,
        library_id: StrictStr,
    ) -> RESTResponseType:
        """Ingest Private Chats

        Trigger an ingestion of private chats for a project. Content is checked, md5 hashed, and vector embeddings made and pushed to pinecone only if it's a new chat or if the hash value has changed compared to before. Args:     project_id: The project for which to trigger private_chat ingestion     library_id: The project's associated library where the namespace is saved Raises:     HTTPException: If there's an error in executing the function

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

        _param = self._ingest_private_chats_api_v1_library_privatechats_project_id_library_id_post_serialize(
            project_id=project_id,
            library_id=library_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 _ingest_private_chats_api_v1_library_privatechats_project_id_library_id_post_serialize(
        self,
        project_id,
        library_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 project_id is not None:
            _path_params['project_id'] = project_id
        if library_id is not None:
            _path_params['library_id'] = library_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='POST',
            resource_path='/api/v1/library/privatechats/{project_id}/{library_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 ingest_shared_chats_api_v1_library_sharedchats_project_id_library_id_post(
        self,
        project_id: StrictStr,
        library_id: StrictStr,
    ) -> None:
        """Ingest Shared Chats

        Trigger an ingestion of shared chats for a project. Content is checked, md5 hashed, and vector embeddings made and pushed to pinecone only if its a new chat or if the hash value has changed compared to before.   Args:     project_id: The project for which to trigger shared_chat ingestion     library_id: The project's associated library where the namespace is saved  Raises:     HTTPException: If there's an error in executing the function

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

        _param = self._ingest_shared_chats_api_v1_library_sharedchats_project_id_library_id_post_serialize(
            project_id=project_id,
            library_id=library_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 ingest_shared_chats_api_v1_library_sharedchats_project_id_library_id_post_with_http_info(
        self,
        project_id: StrictStr,
        library_id: StrictStr,
    ) -> ApiResponse[None]:
        """Ingest Shared Chats

        Trigger an ingestion of shared chats for a project. Content is checked, md5 hashed, and vector embeddings made and pushed to pinecone only if its a new chat or if the hash value has changed compared to before.   Args:     project_id: The project for which to trigger shared_chat ingestion     library_id: The project's associated library where the namespace is saved  Raises:     HTTPException: If there's an error in executing the function

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

        _param = self._ingest_shared_chats_api_v1_library_sharedchats_project_id_library_id_post_serialize(
            project_id=project_id,
            library_id=library_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 ingest_shared_chats_api_v1_library_sharedchats_project_id_library_id_post_without_preload_content(
        self,
        project_id: StrictStr,
        library_id: StrictStr,
    ) -> RESTResponseType:
        """Ingest Shared Chats

        Trigger an ingestion of shared chats for a project. Content is checked, md5 hashed, and vector embeddings made and pushed to pinecone only if its a new chat or if the hash value has changed compared to before.   Args:     project_id: The project for which to trigger shared_chat ingestion     library_id: The project's associated library where the namespace is saved  Raises:     HTTPException: If there's an error in executing the function

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

        _param = self._ingest_shared_chats_api_v1_library_sharedchats_project_id_library_id_post_serialize(
            project_id=project_id,
            library_id=library_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 _ingest_shared_chats_api_v1_library_sharedchats_project_id_library_id_post_serialize(
        self,
        project_id,
        library_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 project_id is not None:
            _path_params['project_id'] = project_id
        if library_id is not None:
            _path_params['library_id'] = library_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='POST',
            resource_path='/api/v1/library/sharedchats/{project_id}/{library_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 ingest_video_api_v1_library_ingest_video_post(
        self,
        ingest_video_request: IngestVideoRequest,
    ) -> IngestResponse:
        """Ingest Video


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

        _param = self._ingest_video_api_v1_library_ingest_video_post_serialize(
            ingest_video_request=ingest_video_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "IngestResponse",
            '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 ingest_video_api_v1_library_ingest_video_post_with_http_info(
        self,
        ingest_video_request: IngestVideoRequest,
    ) -> ApiResponse[IngestResponse]:
        """Ingest Video


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

        _param = self._ingest_video_api_v1_library_ingest_video_post_serialize(
            ingest_video_request=ingest_video_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "IngestResponse",
            '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 ingest_video_api_v1_library_ingest_video_post_without_preload_content(
        self,
        ingest_video_request: IngestVideoRequest,
    ) -> RESTResponseType:
        """Ingest Video


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

        _param = self._ingest_video_api_v1_library_ingest_video_post_serialize(
            ingest_video_request=ingest_video_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

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


    def _ingest_video_api_v1_library_ingest_video_post_serialize(
        self,
        ingest_video_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 ingest_video_request is not None:
            _body_params = ingest_video_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/library/ingest/video',
            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 library_root_api_v1_library_get(
        self,
        library_id: Optional[StrictStr] = None,
    ) -> LibraryResponse:
        """Library Root

        Get the library items for the specified library id.  Args:     auth (EndpointAuth): The authenticated endpoint information.     library_id (str, optional): The library ID to filter library items.  Returns:     LibraryResponse: A response containing the library items.  Raises:     HTTPException: If there's an error retrieving the library items.

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

        _param = self._library_root_api_v1_library_get_serialize(
            library_id=library_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "LibraryResponse",
            '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 library_root_api_v1_library_get_with_http_info(
        self,
        library_id: Optional[StrictStr] = None,
    ) -> ApiResponse[LibraryResponse]:
        """Library Root

        Get the library items for the specified library id.  Args:     auth (EndpointAuth): The authenticated endpoint information.     library_id (str, optional): The library ID to filter library items.  Returns:     LibraryResponse: A response containing the library items.  Raises:     HTTPException: If there's an error retrieving the library items.

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

        _param = self._library_root_api_v1_library_get_serialize(
            library_id=library_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "LibraryResponse",
            '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 library_root_api_v1_library_get_without_preload_content(
        self,
        library_id: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """Library Root

        Get the library items for the specified library id.  Args:     auth (EndpointAuth): The authenticated endpoint information.     library_id (str, optional): The library ID to filter library items.  Returns:     LibraryResponse: A response containing the library items.  Raises:     HTTPException: If there's an error retrieving the library items.

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

        _param = self._library_root_api_v1_library_get_serialize(
            library_id=library_id,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

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


    def _library_root_api_v1_library_get_serialize(
        self,
        library_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 library_id is not None:
            
            _query_params.append(('library_id', library_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/library/',
            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 refresh_library_item_api_v1_library_index_reference_refresh_post(
        self,
        index_reference: StrictStr,
    ) -> RefreshResponse:
        """Refresh Library Item

        Refresh a library item.  Args:     index_reference (str): The index_reference of the item to refresh.     auth (EndpointAuth): The authenticated endpoint information.  Raises:     HTTPException: If there's an error refreshing the library item.

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

        _param = self._refresh_library_item_api_v1_library_index_reference_refresh_post_serialize(
            index_reference=index_reference,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "RefreshResponse",
            '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 refresh_library_item_api_v1_library_index_reference_refresh_post_with_http_info(
        self,
        index_reference: StrictStr,
    ) -> ApiResponse[RefreshResponse]:
        """Refresh Library Item

        Refresh a library item.  Args:     index_reference (str): The index_reference of the item to refresh.     auth (EndpointAuth): The authenticated endpoint information.  Raises:     HTTPException: If there's an error refreshing the library item.

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

        _param = self._refresh_library_item_api_v1_library_index_reference_refresh_post_serialize(
            index_reference=index_reference,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "RefreshResponse",
            '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 refresh_library_item_api_v1_library_index_reference_refresh_post_without_preload_content(
        self,
        index_reference: StrictStr,
    ) -> RESTResponseType:
        """Refresh Library Item

        Refresh a library item.  Args:     index_reference (str): The index_reference of the item to refresh.     auth (EndpointAuth): The authenticated endpoint information.  Raises:     HTTPException: If there's an error refreshing the library item.

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

        _param = self._refresh_library_item_api_v1_library_index_reference_refresh_post_serialize(
            index_reference=index_reference,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

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


    def _refresh_library_item_api_v1_library_index_reference_refresh_post_serialize(
        self,
        index_reference,
        _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 index_reference is not None:
            _path_params['index_reference'] = index_reference
        # 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='POST',
            resource_path='/api/v1/library/{index_reference}/refresh',
            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 refresh_workflowy_nodes_api_v1_library_ingest_workflowy_refresh_post(
        self,
        workflowy_refresh_request: WorkflowyRefreshRequest,
    ) -> object:
        """Refresh Workflowy Nodes


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

        _param = self._refresh_workflowy_nodes_api_v1_library_ingest_workflowy_refresh_post_serialize(
            workflowy_refresh_request=workflowy_refresh_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
            '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 refresh_workflowy_nodes_api_v1_library_ingest_workflowy_refresh_post_with_http_info(
        self,
        workflowy_refresh_request: WorkflowyRefreshRequest,
    ) -> ApiResponse[object]:
        """Refresh Workflowy Nodes


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

        _param = self._refresh_workflowy_nodes_api_v1_library_ingest_workflowy_refresh_post_serialize(
            workflowy_refresh_request=workflowy_refresh_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
            '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 refresh_workflowy_nodes_api_v1_library_ingest_workflowy_refresh_post_without_preload_content(
        self,
        workflowy_refresh_request: WorkflowyRefreshRequest,
    ) -> RESTResponseType:
        """Refresh Workflowy Nodes


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

        _param = self._refresh_workflowy_nodes_api_v1_library_ingest_workflowy_refresh_post_serialize(
            workflowy_refresh_request=workflowy_refresh_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

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


    def _refresh_workflowy_nodes_api_v1_library_ingest_workflowy_refresh_post_serialize(
        self,
        workflowy_refresh_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 workflowy_refresh_request is not None:
            _body_params = workflowy_refresh_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/library/ingest/workflowy/refresh',
            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 retrieve_documents_api_v1_library_retrieve_post(
        self,
        retrieve_request: RetrieveRequest,
    ) -> RetrieveResponse:
        """Retrieve Documents

        Retrieve documents based on the given query.

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

        _param = self._retrieve_documents_api_v1_library_retrieve_post_serialize(
            retrieve_request=retrieve_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "RetrieveResponse",
            '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 retrieve_documents_api_v1_library_retrieve_post_with_http_info(
        self,
        retrieve_request: RetrieveRequest,
    ) -> ApiResponse[RetrieveResponse]:
        """Retrieve Documents

        Retrieve documents based on the given query.

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

        _param = self._retrieve_documents_api_v1_library_retrieve_post_serialize(
            retrieve_request=retrieve_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "RetrieveResponse",
            '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 retrieve_documents_api_v1_library_retrieve_post_without_preload_content(
        self,
        retrieve_request: RetrieveRequest,
    ) -> RESTResponseType:
        """Retrieve Documents

        Retrieve documents based on the given query.

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

        _param = self._retrieve_documents_api_v1_library_retrieve_post_serialize(
            retrieve_request=retrieve_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

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


    def _retrieve_documents_api_v1_library_retrieve_post_serialize(
        self,
        retrieve_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 retrieve_request is not None:
            _body_params = retrieve_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/library/retrieve/',
            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 scrape_and_ingest_workflowy_api_v1_library_ingest_workflowy_post(
        self,
        workflowy_secret_link_request: WorkflowySecretLinkRequest,
    ) -> object:
        """Scrape And Ingest Workflowy


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

        _param = self._scrape_and_ingest_workflowy_api_v1_library_ingest_workflowy_post_serialize(
            workflowy_secret_link_request=workflowy_secret_link_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
            '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 scrape_and_ingest_workflowy_api_v1_library_ingest_workflowy_post_with_http_info(
        self,
        workflowy_secret_link_request: WorkflowySecretLinkRequest,
    ) -> ApiResponse[object]:
        """Scrape And Ingest Workflowy


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

        _param = self._scrape_and_ingest_workflowy_api_v1_library_ingest_workflowy_post_serialize(
            workflowy_secret_link_request=workflowy_secret_link_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
            '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 scrape_and_ingest_workflowy_api_v1_library_ingest_workflowy_post_without_preload_content(
        self,
        workflowy_secret_link_request: WorkflowySecretLinkRequest,
    ) -> RESTResponseType:
        """Scrape And Ingest Workflowy


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

        _param = self._scrape_and_ingest_workflowy_api_v1_library_ingest_workflowy_post_serialize(
            workflowy_secret_link_request=workflowy_secret_link_request,
            _request_auth=None,
            _content_type=None,
            _headers=None,
            _host_index=0
        )

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


    def _scrape_and_ingest_workflowy_api_v1_library_ingest_workflowy_post_serialize(
        self,
        workflowy_secret_link_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 workflowy_secret_link_request is not None:
            _body_params = workflowy_secret_link_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/library/ingest/workflowy',
            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_manifest_item_api_v1_library_index_reference_item_id_patch(
        self,
        index_reference: StrictStr,
        item_id: StrictStr,
        update_document_request: UpdateDocumentRequest,
    ) -> None:
        """Update Manifest Item

        Update a manifest item.  Args:     index_reference (str): The index_reference of the item to update.     item_id (str): The ID of the item to update.     updates (UpdateDocumentRequest): The updates to apply to the item.  Raises:     HTTPException: If there's an error updating the manifest item.

        :param index_reference: (required)
        :type index_reference: str
        :param item_id: (required)
        :type item_id: str
        :param update_document_request: (required)
        :type update_document_request: UpdateDocumentRequest
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_manifest_item_api_v1_library_index_reference_item_id_patch_serialize(
            index_reference=index_reference,
            item_id=item_id,
            update_document_request=update_document_request,
            _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 update_manifest_item_api_v1_library_index_reference_item_id_patch_with_http_info(
        self,
        index_reference: StrictStr,
        item_id: StrictStr,
        update_document_request: UpdateDocumentRequest,
    ) -> ApiResponse[None]:
        """Update Manifest Item

        Update a manifest item.  Args:     index_reference (str): The index_reference of the item to update.     item_id (str): The ID of the item to update.     updates (UpdateDocumentRequest): The updates to apply to the item.  Raises:     HTTPException: If there's an error updating the manifest item.

        :param index_reference: (required)
        :type index_reference: str
        :param item_id: (required)
        :type item_id: str
        :param update_document_request: (required)
        :type update_document_request: UpdateDocumentRequest
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_manifest_item_api_v1_library_index_reference_item_id_patch_serialize(
            index_reference=index_reference,
            item_id=item_id,
            update_document_request=update_document_request,
            _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 update_manifest_item_api_v1_library_index_reference_item_id_patch_without_preload_content(
        self,
        index_reference: StrictStr,
        item_id: StrictStr,
        update_document_request: UpdateDocumentRequest,
    ) -> RESTResponseType:
        """Update Manifest Item

        Update a manifest item.  Args:     index_reference (str): The index_reference of the item to update.     item_id (str): The ID of the item to update.     updates (UpdateDocumentRequest): The updates to apply to the item.  Raises:     HTTPException: If there's an error updating the manifest item.

        :param index_reference: (required)
        :type index_reference: str
        :param item_id: (required)
        :type item_id: str
        :param update_document_request: (required)
        :type update_document_request: UpdateDocumentRequest
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_manifest_item_api_v1_library_index_reference_item_id_patch_serialize(
            index_reference=index_reference,
            item_id=item_id,
            update_document_request=update_document_request,
            _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 _update_manifest_item_api_v1_library_index_reference_item_id_patch_serialize(
        self,
        index_reference,
        item_id,
        update_document_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
        if index_reference is not None:
            _path_params['index_reference'] = index_reference
        if item_id is not None:
            _path_params['item_id'] = item_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if update_document_request is not None:
            _body_params = update_document_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='PATCH',
            resource_path='/api/v1/library/{index_reference}/{item_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
        )


