# coding: utf-8

"""
    Eazyrent core API

    EazyRent Core API ====================  Description -------------  The EazyRent API is a powerful tool, designed to automate and streamline the tenant application process for professionals in the real estate and insurance sectors.  Our API leverages advanced technologies like Optical Character Recognition (OCR) and Machine Learning to collect, analyze, and verify tenant application documents.  The API helps clients detect fraudulent submissions and assess the reliability of potential tenants, ensuring a secure and efficient tenant selection process.  Target Audience ----------------   * **Real Estate Agencies and Social Housing Providers:** Professionals who need a reliable solution to evaluate tenant applications quickly and accurately.   * **Rent Guarantee Insurers:** Companies seeking to verify the credibility of tenant applications and assess eligibility for rent payment guarantees.   Purpose --------  The purpose of the EazyRent API is to enable seamless interaction with our tenant application system. It allows clients to integrate our automated document collection, analysis, and verification capabilities directly into their own workflows. By using our API, businesses can streamline operations, reduce fraud risk, and make well-informed decisions in the tenant selection process.   How to use this API ---------------------  To start using the EazyRent API, please refer to our comprehensive online documentation, which includes detailed information on API endpoints, authentication, and integration examples. You can access the documentation [here](https://docs.eazyrent.fr). This resource will guide you through the steps needed to integrate our API into your existing systems and maximize its capabilities.  

    The version of the OpenAPI document: 2
    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 Field, StrictBytes, StrictStr
from typing import Any, Optional, Tuple, Union
from typing_extensions import Annotated
from eazyrent.core.v2.models.paginated_response_document_view import (
    PaginatedResponseDocumentView,
)

from eazyrent.core.v2.api_client import ApiClient, RequestSerialized
from eazyrent.core.v2.api_response import ApiResponse
from eazyrent.core.v2.rest import RESTResponseType


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

    Do not edit the class manually.
    """

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

    @validate_call
    def create_document(
        self,
        file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        applicant: StrictStr,
        document_type: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Create document

        Upload a Document for Analysis.  This endpoint allows the authenticated user to upload a document for analysis associated with a specific applicant. Supported document formats include PDF and image formats (JPEG, PNG), and the uploaded file is stored for processing.  **Apple's HEIC format is not supported**  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:write`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Parameters: - **file** (required, form): The document file to upload. Supported formats:   - `application/pdf`   - `image/jpeg`   - `image/png` - **applicant** (required, form): The unique identifier (UUID) of the applicant   to whom the document is associated. - **document_type** (required, form): The unique identifier (UUID) representing   the type of document being uploaded.  ## Response: - **201 Created**: Returns the details of the uploaded document, including   its storage reference and metadata. - **404 Not Found**: If the applicant or the document type associated with the   provided ID cannot be found. - **400 Bad Request**: If the uploaded file is of an unsupported format or   if any of the required parameters are missing. - **413 Payload Too Large**: If the uploaded file exceeds the maximum size limit   of 50 MB. - **403 Forbidden**: If the user does not have the necessary permissions   to upload the document.

        :param file: (required)
        :type file: bytearray
        :param applicant: (required)
        :type applicant: str
        :param document_type: (required)
        :type document_type: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._create_document_serialize(
            file=file,
            applicant=applicant,
            document_type=document_type,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    @validate_call
    def create_document_with_http_info(
        self,
        file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        applicant: StrictStr,
        document_type: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Create document

        Upload a Document for Analysis.  This endpoint allows the authenticated user to upload a document for analysis associated with a specific applicant. Supported document formats include PDF and image formats (JPEG, PNG), and the uploaded file is stored for processing.  **Apple's HEIC format is not supported**  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:write`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Parameters: - **file** (required, form): The document file to upload. Supported formats:   - `application/pdf`   - `image/jpeg`   - `image/png` - **applicant** (required, form): The unique identifier (UUID) of the applicant   to whom the document is associated. - **document_type** (required, form): The unique identifier (UUID) representing   the type of document being uploaded.  ## Response: - **201 Created**: Returns the details of the uploaded document, including   its storage reference and metadata. - **404 Not Found**: If the applicant or the document type associated with the   provided ID cannot be found. - **400 Bad Request**: If the uploaded file is of an unsupported format or   if any of the required parameters are missing. - **413 Payload Too Large**: If the uploaded file exceeds the maximum size limit   of 50 MB. - **403 Forbidden**: If the user does not have the necessary permissions   to upload the document.

        :param file: (required)
        :type file: bytearray
        :param applicant: (required)
        :type applicant: str
        :param document_type: (required)
        :type document_type: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._create_document_serialize(
            file=file,
            applicant=applicant,
            document_type=document_type,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    @validate_call
    def create_document_without_preload_content(
        self,
        file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        applicant: StrictStr,
        document_type: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create document

        Upload a Document for Analysis.  This endpoint allows the authenticated user to upload a document for analysis associated with a specific applicant. Supported document formats include PDF and image formats (JPEG, PNG), and the uploaded file is stored for processing.  **Apple's HEIC format is not supported**  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:write`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Parameters: - **file** (required, form): The document file to upload. Supported formats:   - `application/pdf`   - `image/jpeg`   - `image/png` - **applicant** (required, form): The unique identifier (UUID) of the applicant   to whom the document is associated. - **document_type** (required, form): The unique identifier (UUID) representing   the type of document being uploaded.  ## Response: - **201 Created**: Returns the details of the uploaded document, including   its storage reference and metadata. - **404 Not Found**: If the applicant or the document type associated with the   provided ID cannot be found. - **400 Bad Request**: If the uploaded file is of an unsupported format or   if any of the required parameters are missing. - **413 Payload Too Large**: If the uploaded file exceeds the maximum size limit   of 50 MB. - **403 Forbidden**: If the user does not have the necessary permissions   to upload the document.

        :param file: (required)
        :type file: bytearray
        :param applicant: (required)
        :type applicant: str
        :param document_type: (required)
        :type document_type: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._create_document_serialize(
            file=file,
            applicant=applicant,
            document_type=document_type,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    def _create_document_serialize(
        self,
        file,
        applicant,
        document_type,
        x_eaz_account_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
        # process the header parameters
        if x_eaz_account_id is not None:
            _header_params["x-eaz-account-id"] = x_eaz_account_id
        # process the form parameters
        if file is not None:
            _files["file"] = file
        if applicant is not None:
            _form_params.append(("applicant", applicant))
        if document_type is not None:
            _form_params.append(("document_type", document_type))
        # 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"]
            )

        # 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(
                ["multipart/form-data"]
            )
            if _default_content_type is not None:
                _header_params["Content-Type"] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = ["APIKeyHeader", "OAuth2"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/documents/",
            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 deleted_document(
        self,
        id: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Deleted document

        Delete a Document.  This endpoint allows the authenticated user to delete a specific document associated with their organization. The document ID must be provided to identify which document to delete.  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:write`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Parameters: - **id** (required, path): The unique identifier (UUID) of the document to be    deleted.  ## Response: - **204 No Content**: Indicates that the document has been successfully deleted. - **404 Not Found**: If the document with the provided ID cannot be found. - **403 Forbidden**: If the user does not have the necessary permissions   to delete the document.

        :param id: (required)
        :type id: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._deleted_document_serialize(
            id=id,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    @validate_call
    def deleted_document_with_http_info(
        self,
        id: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Deleted document

        Delete a Document.  This endpoint allows the authenticated user to delete a specific document associated with their organization. The document ID must be provided to identify which document to delete.  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:write`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Parameters: - **id** (required, path): The unique identifier (UUID) of the document to be    deleted.  ## Response: - **204 No Content**: Indicates that the document has been successfully deleted. - **404 Not Found**: If the document with the provided ID cannot be found. - **403 Forbidden**: If the user does not have the necessary permissions   to delete the document.

        :param id: (required)
        :type id: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._deleted_document_serialize(
            id=id,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    @validate_call
    def deleted_document_without_preload_content(
        self,
        id: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deleted document

        Delete a Document.  This endpoint allows the authenticated user to delete a specific document associated with their organization. The document ID must be provided to identify which document to delete.  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:write`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Parameters: - **id** (required, path): The unique identifier (UUID) of the document to be    deleted.  ## Response: - **204 No Content**: Indicates that the document has been successfully deleted. - **404 Not Found**: If the document with the provided ID cannot be found. - **403 Forbidden**: If the user does not have the necessary permissions   to delete the document.

        :param id: (required)
        :type id: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._deleted_document_serialize(
            id=id,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    def _deleted_document_serialize(
        self,
        id,
        x_eaz_account_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 id is not None:
            _path_params["id"] = id
        # process the query parameters
        # process the header parameters
        if x_eaz_account_id is not None:
            _header_params["x-eaz-account-id"] = x_eaz_account_id
        # 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", "OAuth2"]

        return self.api_client.param_serialize(
            method="DELETE",
            resource_path="/documents/{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_document(
        self,
        id: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> None:
        """Get document


        :param id: (required)
        :type id: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._get_document_serialize(
            id=id,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    @validate_call
    def get_document_with_http_info(
        self,
        id: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[None]:
        """Get document


        :param id: (required)
        :type id: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._get_document_serialize(
            id=id,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    @validate_call
    def get_document_without_preload_content(
        self,
        id: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get document


        :param id: (required)
        :type id: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._get_document_serialize(
            id=id,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    def _get_document_serialize(
        self,
        id,
        x_eaz_account_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 id is not None:
            _path_params["id"] = id
        # process the query parameters
        # process the header parameters
        if x_eaz_account_id is not None:
            _header_params["x-eaz-account-id"] = x_eaz_account_id
        # 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", "OAuth2"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/documents/{id}/download/",
            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_document_pages(
        self,
        id: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Get document pages

        Retrieve Document Pages.  This endpoint allows the authenticated user to retrieve the pages (images) associated with a specific document. The document ID must be provided to identify which document's pages to retrieve.  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:read`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Parameters: - **id** (required, path): The unique identifier (UUID) of the document for   which the pages are to be retrieved.  ## Response: - **200 OK**: Returns a list of images representing the pages of the specified   document. - **404 Not Found**: If the document with the provided ID cannot be found. - **403 Forbidden**: If the user does not have the necessary permissions   to access the document pages.

        :param id: (required)
        :type id: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._get_document_pages_serialize(
            id=id,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    @validate_call
    def get_document_pages_with_http_info(
        self,
        id: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Get document pages

        Retrieve Document Pages.  This endpoint allows the authenticated user to retrieve the pages (images) associated with a specific document. The document ID must be provided to identify which document's pages to retrieve.  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:read`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Parameters: - **id** (required, path): The unique identifier (UUID) of the document for   which the pages are to be retrieved.  ## Response: - **200 OK**: Returns a list of images representing the pages of the specified   document. - **404 Not Found**: If the document with the provided ID cannot be found. - **403 Forbidden**: If the user does not have the necessary permissions   to access the document pages.

        :param id: (required)
        :type id: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._get_document_pages_serialize(
            id=id,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    @validate_call
    def get_document_pages_without_preload_content(
        self,
        id: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get document pages

        Retrieve Document Pages.  This endpoint allows the authenticated user to retrieve the pages (images) associated with a specific document. The document ID must be provided to identify which document's pages to retrieve.  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:read`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Parameters: - **id** (required, path): The unique identifier (UUID) of the document for   which the pages are to be retrieved.  ## Response: - **200 OK**: Returns a list of images representing the pages of the specified   document. - **404 Not Found**: If the document with the provided ID cannot be found. - **403 Forbidden**: If the user does not have the necessary permissions   to access the document pages.

        :param id: (required)
        :type id: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._get_document_pages_serialize(
            id=id,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    def _get_document_pages_serialize(
        self,
        id,
        x_eaz_account_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 id is not None:
            _path_params["id"] = id
        # process the query parameters
        # process the header parameters
        if x_eaz_account_id is not None:
            _header_params["x-eaz-account-id"] = x_eaz_account_id
        # 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", "OAuth2"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/documents/{id}/pages",
            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 list_document(
        self,
        limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
        offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        rental_file: Optional[StrictStr] = None,
        applicant: Optional[StrictStr] = None,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaginatedResponseDocumentView:
        """List document

        List Documents.  This endpoint allows the authenticated user to retrieve a list of documents associated with their organization or specific applicants. The response includes metadata for each document, such as the document ID, type, upload date, and associated applicant details.  *Note: This is a virtual view based on the uploaded files. To access all raw uploads   look at `uploads`*  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:read`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Response: - **200 OK**: Returns a list of documents with their details. - **403 Forbidden**: If the user does not have the necessary permissions to   access the documents.

        :param limit:
        :type limit: int
        :param offset:
        :type offset: int
        :param rental_file:
        :type rental_file: str
        :param applicant:
        :type applicant: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_document_serialize(
            limit=limit,
            offset=offset,
            rental_file=rental_file,
            applicant=applicant,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    @validate_call
    def list_document_with_http_info(
        self,
        limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
        offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        rental_file: Optional[StrictStr] = None,
        applicant: Optional[StrictStr] = None,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaginatedResponseDocumentView]:
        """List document

        List Documents.  This endpoint allows the authenticated user to retrieve a list of documents associated with their organization or specific applicants. The response includes metadata for each document, such as the document ID, type, upload date, and associated applicant details.  *Note: This is a virtual view based on the uploaded files. To access all raw uploads   look at `uploads`*  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:read`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Response: - **200 OK**: Returns a list of documents with their details. - **403 Forbidden**: If the user does not have the necessary permissions to   access the documents.

        :param limit:
        :type limit: int
        :param offset:
        :type offset: int
        :param rental_file:
        :type rental_file: str
        :param applicant:
        :type applicant: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_document_serialize(
            limit=limit,
            offset=offset,
            rental_file=rental_file,
            applicant=applicant,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    @validate_call
    def list_document_without_preload_content(
        self,
        limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None,
        offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        rental_file: Optional[StrictStr] = None,
        applicant: Optional[StrictStr] = None,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List document

        List Documents.  This endpoint allows the authenticated user to retrieve a list of documents associated with their organization or specific applicants. The response includes metadata for each document, such as the document ID, type, upload date, and associated applicant details.  *Note: This is a virtual view based on the uploaded files. To access all raw uploads   look at `uploads`*  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:read`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Response: - **200 OK**: Returns a list of documents with their details. - **403 Forbidden**: If the user does not have the necessary permissions to   access the documents.

        :param limit:
        :type limit: int
        :param offset:
        :type offset: int
        :param rental_file:
        :type rental_file: str
        :param applicant:
        :type applicant: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_document_serialize(
            limit=limit,
            offset=offset,
            rental_file=rental_file,
            applicant=applicant,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    def _list_document_serialize(
        self,
        limit,
        offset,
        rental_file,
        applicant,
        x_eaz_account_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 limit is not None:

            _query_params.append(("limit", limit))

        if offset is not None:

            _query_params.append(("offset", offset))

        if rental_file is not None:

            _query_params.append(("rental_file", rental_file))

        if applicant is not None:

            _query_params.append(("applicant", applicant))

        # process the header parameters
        if x_eaz_account_id is not None:
            _header_params["x-eaz-account-id"] = x_eaz_account_id
        # 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", "OAuth2"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/documents/",
            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_document(
        self,
        id: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Update document

        Update an Existing Document.  This endpoint allows the authenticated user to update the details of an existing document associated with a specific applicant. The document ID must be provided to identify which document to update.  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:write`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Parameters: - **id** (required, path): The unique identifier (UUID) of the document to be    updated.  ## Response: - **200 OK**: Returns the updated details of the document, confirming the changes. - **404 Not Found**: If the document with the provided ID cannot be found. - **403 Forbidden**: If the user does not have the necessary permissions to update    the document.

        :param id: (required)
        :type id: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._update_document_serialize(
            id=id,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    @validate_call
    def update_document_with_http_info(
        self,
        id: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Update document

        Update an Existing Document.  This endpoint allows the authenticated user to update the details of an existing document associated with a specific applicant. The document ID must be provided to identify which document to update.  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:write`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Parameters: - **id** (required, path): The unique identifier (UUID) of the document to be    updated.  ## Response: - **200 OK**: Returns the updated details of the document, confirming the changes. - **404 Not Found**: If the document with the provided ID cannot be found. - **403 Forbidden**: If the user does not have the necessary permissions to update    the document.

        :param id: (required)
        :type id: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._update_document_serialize(
            id=id,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    @validate_call
    def update_document_without_preload_content(
        self,
        id: StrictStr,
        x_eaz_account_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data."
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
            ],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update document

        Update an Existing Document.  This endpoint allows the authenticated user to update the details of an existing document associated with a specific applicant. The document ID must be provided to identify which document to update.  ## Authentication: - Requires a valid OAuth access token with the following scopes:   - `document:write`   - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`   - Public scopes may also be included.  ## Parameters: - **id** (required, path): The unique identifier (UUID) of the document to be    updated.  ## Response: - **200 OK**: Returns the updated details of the document, confirming the changes. - **404 Not Found**: If the document with the provided ID cannot be found. - **403 Forbidden**: If the user does not have the necessary permissions to update    the document.

        :param id: (required)
        :type id: str
        :param x_eaz_account_id: The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data.
        :type x_eaz_account_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._update_document_serialize(
            id=id,
            x_eaz_account_id=x_eaz_account_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

    def _update_document_serialize(
        self,
        id,
        x_eaz_account_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 id is not None:
            _path_params["id"] = id
        # process the query parameters
        # process the header parameters
        if x_eaz_account_id is not None:
            _header_params["x-eaz-account-id"] = x_eaz_account_id
        # 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", "OAuth2"]

        return self.api_client.param_serialize(
            method="PATCH",
            resource_path="/documents/{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,
        )
