# 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 typing import Any, Dict, List, Optional, Tuple, Union

from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
from typing_extensions import Annotated

from eazyrent.core.v2.api_client import ApiClient, RequestSerialized
from eazyrent.core.v2.api_response import ApiResponse
from eazyrent.core.v2.models.rental_file_comment import RentalFileComment
from eazyrent.core.v2.models.rental_file_comment_in import RentalFileCommentIn
from eazyrent.core.v2.rest import RESTResponseType


class RentalFilesCommentsApi:
    """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 add_comment(
        self,
        id: StrictStr,
        rental_file_comment_in: RentalFileCommentIn,
        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,
    ) -> RentalFileComment:
        """Add comment

        Add a comment to a Rental File.  This endpoint allows the authenticated user to add a comment to a specific rental file. Comments can provide additional information, feedback, or questions related to the rental file.  ## 🔒 Authentication  This endpoint require a valid OAuth2 Bearer  It supports account impersonation within Organization's sub-accounts using `X-Eaz-Account-Id` Header.  - If the `X-Eaz-Account-Id` header is provided and the user has access rights to that sub-account, the impersonation context is applied. - Otherwise, the user's own account context is used. ### Scopes :  User must provide one of the following scopes: - `admin` - `staff` - `user` - `org:admin` - `org:staff` - `org:user` - `rental_file:read`

        :param id: (required)
        :type id: str
        :param rental_file_comment_in: (required)
        :type rental_file_comment_in: RentalFileCommentIn
        :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._add_comment_serialize(
            id=id,
            rental_file_comment_in=rental_file_comment_in,
            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": "RentalFileComment",
            "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 add_comment_with_http_info(
        self,
        id: StrictStr,
        rental_file_comment_in: RentalFileCommentIn,
        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[RentalFileComment]:
        """Add comment

        Add a comment to a Rental File.  This endpoint allows the authenticated user to add a comment to a specific rental file. Comments can provide additional information, feedback, or questions related to the rental file.  ## 🔒 Authentication  This endpoint require a valid OAuth2 Bearer  It supports account impersonation within Organization's sub-accounts using `X-Eaz-Account-Id` Header.  - If the `X-Eaz-Account-Id` header is provided and the user has access rights to that sub-account, the impersonation context is applied. - Otherwise, the user's own account context is used. ### Scopes :  User must provide one of the following scopes: - `admin` - `staff` - `user` - `org:admin` - `org:staff` - `org:user` - `rental_file:read`

        :param id: (required)
        :type id: str
        :param rental_file_comment_in: (required)
        :type rental_file_comment_in: RentalFileCommentIn
        :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._add_comment_serialize(
            id=id,
            rental_file_comment_in=rental_file_comment_in,
            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": "RentalFileComment",
            "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 add_comment_without_preload_content(
        self,
        id: StrictStr,
        rental_file_comment_in: RentalFileCommentIn,
        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:
        """Add comment

        Add a comment to a Rental File.  This endpoint allows the authenticated user to add a comment to a specific rental file. Comments can provide additional information, feedback, or questions related to the rental file.  ## 🔒 Authentication  This endpoint require a valid OAuth2 Bearer  It supports account impersonation within Organization's sub-accounts using `X-Eaz-Account-Id` Header.  - If the `X-Eaz-Account-Id` header is provided and the user has access rights to that sub-account, the impersonation context is applied. - Otherwise, the user's own account context is used. ### Scopes :  User must provide one of the following scopes: - `admin` - `staff` - `user` - `org:admin` - `org:staff` - `org:user` - `rental_file:read`

        :param id: (required)
        :type id: str
        :param rental_file_comment_in: (required)
        :type rental_file_comment_in: RentalFileCommentIn
        :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._add_comment_serialize(
            id=id,
            rental_file_comment_in=rental_file_comment_in,
            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": "RentalFileComment",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        return response_data.response

    def _add_comment_serialize(
        self,
        id,
        rental_file_comment_in,
        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
        if rental_file_comment_in is not None:
            _body_params = rental_file_comment_in

        # 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", "OAuth2"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/rental-files/{id}/comments",
            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_comment(
        self,
        id: StrictStr,
        comment_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:
        """Delete comment

        Delete a comment from a Rental File.  This endpoint allows the authenticated user to delete a specific comment from a rental file. This can be useful for removing outdated or irrelevant comments.  ## 🔒 Authentication  This endpoint require a valid OAuth2 Bearer  It supports account impersonation within Organization's sub-accounts using `X-Eaz-Account-Id` Header.  - If the `X-Eaz-Account-Id` header is provided and the user has access rights to that sub-account, the impersonation context is applied. - Otherwise, the user's own account context is used. ### Scopes :  User must provide one of the following scopes: - `admin` - `staff` - `user` - `org:admin` - `org:staff` - `org:user` - `rental_file:read`

        :param id: (required)
        :type id: str
        :param comment_id: (required)
        :type comment_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._delete_comment_serialize(
            id=id,
            comment_id=comment_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]] = {
            "204": 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 delete_comment_with_http_info(
        self,
        id: StrictStr,
        comment_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]:
        """Delete comment

        Delete a comment from a Rental File.  This endpoint allows the authenticated user to delete a specific comment from a rental file. This can be useful for removing outdated or irrelevant comments.  ## 🔒 Authentication  This endpoint require a valid OAuth2 Bearer  It supports account impersonation within Organization's sub-accounts using `X-Eaz-Account-Id` Header.  - If the `X-Eaz-Account-Id` header is provided and the user has access rights to that sub-account, the impersonation context is applied. - Otherwise, the user's own account context is used. ### Scopes :  User must provide one of the following scopes: - `admin` - `staff` - `user` - `org:admin` - `org:staff` - `org:user` - `rental_file:read`

        :param id: (required)
        :type id: str
        :param comment_id: (required)
        :type comment_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._delete_comment_serialize(
            id=id,
            comment_id=comment_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]] = {
            "204": 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 delete_comment_without_preload_content(
        self,
        id: StrictStr,
        comment_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:
        """Delete comment

        Delete a comment from a Rental File.  This endpoint allows the authenticated user to delete a specific comment from a rental file. This can be useful for removing outdated or irrelevant comments.  ## 🔒 Authentication  This endpoint require a valid OAuth2 Bearer  It supports account impersonation within Organization's sub-accounts using `X-Eaz-Account-Id` Header.  - If the `X-Eaz-Account-Id` header is provided and the user has access rights to that sub-account, the impersonation context is applied. - Otherwise, the user's own account context is used. ### Scopes :  User must provide one of the following scopes: - `admin` - `staff` - `user` - `org:admin` - `org:staff` - `org:user` - `rental_file:read`

        :param id: (required)
        :type id: str
        :param comment_id: (required)
        :type comment_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._delete_comment_serialize(
            id=id,
            comment_id=comment_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]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        return response_data.response

    def _delete_comment_serialize(
        self,
        id,
        comment_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
        if comment_id is not None:
            _path_params["comment_id"] = comment_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="/rental-files/{id}/comments/{comment_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_comments(
        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 comments

        Retrieve all comments on a Rental File.  This endpoint allows the authenticated user to retrieve all comments associated with a specific rental file. The comments provide insights and feedback related to the rental file from different users.  ## 🔒 Authentication  This endpoint require a valid OAuth2 Bearer  It supports account impersonation within Organization's sub-accounts using `X-Eaz-Account-Id` Header.  - If the `X-Eaz-Account-Id` header is provided and the user has access rights to that sub-account, the impersonation context is applied. - Otherwise, the user's own account context is used. ### Scopes :  User must provide one of the following scopes: - `admin` - `staff` - `user` - `org:admin` - `org:staff` - `org:user` - `rental_file:read`

        :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_comments_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_comments_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 comments

        Retrieve all comments on a Rental File.  This endpoint allows the authenticated user to retrieve all comments associated with a specific rental file. The comments provide insights and feedback related to the rental file from different users.  ## 🔒 Authentication  This endpoint require a valid OAuth2 Bearer  It supports account impersonation within Organization's sub-accounts using `X-Eaz-Account-Id` Header.  - If the `X-Eaz-Account-Id` header is provided and the user has access rights to that sub-account, the impersonation context is applied. - Otherwise, the user's own account context is used. ### Scopes :  User must provide one of the following scopes: - `admin` - `staff` - `user` - `org:admin` - `org:staff` - `org:user` - `rental_file:read`

        :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_comments_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_comments_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 comments

        Retrieve all comments on a Rental File.  This endpoint allows the authenticated user to retrieve all comments associated with a specific rental file. The comments provide insights and feedback related to the rental file from different users.  ## 🔒 Authentication  This endpoint require a valid OAuth2 Bearer  It supports account impersonation within Organization's sub-accounts using `X-Eaz-Account-Id` Header.  - If the `X-Eaz-Account-Id` header is provided and the user has access rights to that sub-account, the impersonation context is applied. - Otherwise, the user's own account context is used. ### Scopes :  User must provide one of the following scopes: - `admin` - `staff` - `user` - `org:admin` - `org:staff` - `org:user` - `rental_file:read`

        :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_comments_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_comments_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="/rental-files/{id}/comments",
            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_comment(
        self,
        id: StrictStr,
        comment_id: StrictStr,
        rental_file_comment_in: RentalFileCommentIn,
        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,
    ) -> RentalFileComment:
        """Update comment

        Update a comment on a Rental File.  This endpoint allows the authenticated user to update an existing comment on a specific rental file. This can be useful for correcting or adding to the information provided in the original comment.  ## 🔒 Authentication  This endpoint require a valid OAuth2 Bearer  It supports account impersonation within Organization's sub-accounts using `X-Eaz-Account-Id` Header.  - If the `X-Eaz-Account-Id` header is provided and the user has access rights to that sub-account, the impersonation context is applied. - Otherwise, the user's own account context is used. ### Scopes :  User must provide one of the following scopes: - `admin` - `staff` - `user` - `org:admin` - `org:staff` - `org:user` - `rental_file:read`

        :param id: (required)
        :type id: str
        :param comment_id: (required)
        :type comment_id: str
        :param rental_file_comment_in: (required)
        :type rental_file_comment_in: RentalFileCommentIn
        :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_comment_serialize(
            id=id,
            comment_id=comment_id,
            rental_file_comment_in=rental_file_comment_in,
            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": "RentalFileComment",
            "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_comment_with_http_info(
        self,
        id: StrictStr,
        comment_id: StrictStr,
        rental_file_comment_in: RentalFileCommentIn,
        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[RentalFileComment]:
        """Update comment

        Update a comment on a Rental File.  This endpoint allows the authenticated user to update an existing comment on a specific rental file. This can be useful for correcting or adding to the information provided in the original comment.  ## 🔒 Authentication  This endpoint require a valid OAuth2 Bearer  It supports account impersonation within Organization's sub-accounts using `X-Eaz-Account-Id` Header.  - If the `X-Eaz-Account-Id` header is provided and the user has access rights to that sub-account, the impersonation context is applied. - Otherwise, the user's own account context is used. ### Scopes :  User must provide one of the following scopes: - `admin` - `staff` - `user` - `org:admin` - `org:staff` - `org:user` - `rental_file:read`

        :param id: (required)
        :type id: str
        :param comment_id: (required)
        :type comment_id: str
        :param rental_file_comment_in: (required)
        :type rental_file_comment_in: RentalFileCommentIn
        :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_comment_serialize(
            id=id,
            comment_id=comment_id,
            rental_file_comment_in=rental_file_comment_in,
            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": "RentalFileComment",
            "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_comment_without_preload_content(
        self,
        id: StrictStr,
        comment_id: StrictStr,
        rental_file_comment_in: RentalFileCommentIn,
        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 comment

        Update a comment on a Rental File.  This endpoint allows the authenticated user to update an existing comment on a specific rental file. This can be useful for correcting or adding to the information provided in the original comment.  ## 🔒 Authentication  This endpoint require a valid OAuth2 Bearer  It supports account impersonation within Organization's sub-accounts using `X-Eaz-Account-Id` Header.  - If the `X-Eaz-Account-Id` header is provided and the user has access rights to that sub-account, the impersonation context is applied. - Otherwise, the user's own account context is used. ### Scopes :  User must provide one of the following scopes: - `admin` - `staff` - `user` - `org:admin` - `org:staff` - `org:user` - `rental_file:read`

        :param id: (required)
        :type id: str
        :param comment_id: (required)
        :type comment_id: str
        :param rental_file_comment_in: (required)
        :type rental_file_comment_in: RentalFileCommentIn
        :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_comment_serialize(
            id=id,
            comment_id=comment_id,
            rental_file_comment_in=rental_file_comment_in,
            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": "RentalFileComment",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout
        )
        return response_data.response

    def _update_comment_serialize(
        self,
        id,
        comment_id,
        rental_file_comment_in,
        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
        if comment_id is not None:
            _path_params["comment_id"] = comment_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
        if rental_file_comment_in is not None:
            _body_params = rental_file_comment_in

        # 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", "OAuth2"]

        return self.api_client.param_serialize(
            method="PATCH",
            resource_path="/rental-files/{id}/comments/{comment_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,
        )
