"""
    Cloudbeds Accounting Service API

    The Cloudbeds Accounting Service API provides programmatic access to financial data and operations for hospitality properties. Use this API to manage transactions, folios, deposits, accounts receivable ledgers, trial balances, and related accounting configuration.  **Key concepts:** - **Transactions** represent individual financial entries (charges, payments,   taxes, fees) associated with a source such as a reservation, group profile,   or house account.  - **Folios** organize transactions into logical groups within a source. You   can create custom folios and move or route transactions between them.  - **Source Balances** provide a real-time financial summary (charges, payments,   balance due, tax/fee breakdowns) for a reservation, group profile, house   account, or accounts receivable ledger.  - **Accounts Receivable (AR) Ledgers** track outstanding balances that have   been transferred from reservations or group profiles for later collection.  - **Trial Balance** is a daily financial reconciliation report that summarizes   ledger activity across guest, deposit, and AR ledgers.  - **Custom Codes** let you map Cloudbeds internal transaction codes to your   own chart-of-accounts codes and general ledger codes.   **Authentication:** All endpoints require a valid OAuth2 bearer token. Endpoints are protected by scopes: `read:payment` for read operations and `write:payment` for mutating operations. A few search endpoints use POST with a request body to support complex filter criteria; these require the `read:payment` scope.  **Base URL:** Use `https://api.cloudbeds.com` for production and `https://api.cloudbeds-stage.com` for staging. All endpoint paths are prefixed with `/accounting/v1.0`.  **Property context:** Every request must include the `X-Property-ID` header to identify which property the request applies to.  **Monetary amounts:** Unless otherwise noted, monetary amounts are expressed in the smallest currency unit (e.g., cents for USD). Use the `currencyScale` field to determine the number of decimal places.  **Pagination:** Paginated endpoints return a `nextPageToken` value. Pass this token in subsequent requests to retrieve the next page of results. When `nextPageToken` is null or absent, you have reached the last page. 

    The version of the OpenAPI document: v0
    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, StrictInt, StrictStr
from typing import Optional
from typing_extensions import Annotated
from cloudbeds_accounting.models.accounts_receivable_ledger_paginated import AccountsReceivableLedgerPaginated
from cloudbeds_accounting.models.accounts_receivable_ledger_patch_request import AccountsReceivableLedgerPatchRequest
from cloudbeds_accounting.models.accounts_receivable_ledger_post_request import AccountsReceivableLedgerPostRequest
from cloudbeds_accounting.models.accounts_receivable_ledger_reservation_balance_transfer_response import AccountsReceivableLedgerReservationBalanceTransferResponse
from cloudbeds_accounting.models.accounts_receivable_ledger_response import AccountsReceivableLedgerResponse
from cloudbeds_accounting.models.accounts_receivable_ledger_totals_response import AccountsReceivableLedgerTotalsResponse
from cloudbeds_accounting.models.accounts_receivable_transaction_paginated import AccountsReceivableTransactionPaginated
from cloudbeds_accounting.models.async_event_response import AsyncEventResponse
from cloudbeds_accounting.models.get_accounts_receivable_ledger_totals_filter_parameter import GetAccountsReceivableLedgerTotalsFilterParameter
from cloudbeds_accounting.models.get_accounts_receivable_ledger_transactions_filter_parameter import GetAccountsReceivableLedgerTransactionsFilterParameter
from cloudbeds_accounting.models.get_accounts_receivable_ledgers_filter_parameter import GetAccountsReceivableLedgersFilterParameter
from cloudbeds_accounting.models.post_group_profile_balance_transfer_request import PostGroupProfileBalanceTransferRequest

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


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

    Do not edit the class manually.
    """

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


    @validate_call
    def delete_accounts_receivable_ledger_reservation_balance_transfer(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        reservation_id: Annotated[StrictInt, Field(description="Reservation ID")],
        _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,
    ) -> AsyncEventResponse:
        """Reverse a reservation-to-AR balance transfer

        Reverse a previously created balance transfer between a reservation and an accounts receivable (AR) ledger. This moves the transferred balance back to the original reservation. This operation is processed asynchronously; the response includes an event ID you can use to track the result. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :param reservation_id: Reservation ID (required)
        :type reservation_id: int
        :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_accounts_receivable_ledger_reservation_balance_transfer_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            reservation_id=reservation_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AsyncEventResponse",
            '400': "ApiAccountingError",
            '404': "ApiAccountingError",
        }
        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_accounts_receivable_ledger_reservation_balance_transfer_with_http_info(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        reservation_id: Annotated[StrictInt, Field(description="Reservation ID")],
        _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[AsyncEventResponse]:
        """Reverse a reservation-to-AR balance transfer

        Reverse a previously created balance transfer between a reservation and an accounts receivable (AR) ledger. This moves the transferred balance back to the original reservation. This operation is processed asynchronously; the response includes an event ID you can use to track the result. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :param reservation_id: Reservation ID (required)
        :type reservation_id: int
        :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_accounts_receivable_ledger_reservation_balance_transfer_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            reservation_id=reservation_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AsyncEventResponse",
            '400': "ApiAccountingError",
            '404': "ApiAccountingError",
        }
        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_accounts_receivable_ledger_reservation_balance_transfer_without_preload_content(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        reservation_id: Annotated[StrictInt, Field(description="Reservation ID")],
        _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:
        """Reverse a reservation-to-AR balance transfer

        Reverse a previously created balance transfer between a reservation and an accounts receivable (AR) ledger. This moves the transferred balance back to the original reservation. This operation is processed asynchronously; the response includes an event ID you can use to track the result. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :param reservation_id: Reservation ID (required)
        :type reservation_id: int
        :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_accounts_receivable_ledger_reservation_balance_transfer_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            reservation_id=reservation_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AsyncEventResponse",
            '400': "ApiAccountingError",
            '404': "ApiAccountingError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _delete_accounts_receivable_ledger_reservation_balance_transfer_serialize(
        self,
        x_property_id,
        accounts_receivable_ledger_id,
        reservation_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 accounts_receivable_ledger_id is not None:
            _path_params['accountsReceivableLedgerId'] = accounts_receivable_ledger_id
        if reservation_id is not None:
            _path_params['reservationId'] = reservation_id
        # process the query parameters
        # process the header parameters
        if x_property_id is not None:
            _header_params['X-Property-ID'] = x_property_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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/accounting/v1.0/accounts-receivable-ledgers/{accountsReceivableLedgerId}/reservation/{reservationId}/balance-transfer',
            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_accounts_receivable_ledger_by_id(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        _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,
    ) -> AccountsReceivableLedgerResponse:
        """Get an accounts receivable ledger by ID

        Retrieve a single accounts receivable (AR) ledger by its unique identifier. The response includes the ledger name, status, total charges, amount paid, and outstanding balance. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :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_accounts_receivable_ledger_by_id_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerResponse",
            '400': "ApiAccountingError",
            '404': "ApiAccountingError",
        }
        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_accounts_receivable_ledger_by_id_with_http_info(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        _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[AccountsReceivableLedgerResponse]:
        """Get an accounts receivable ledger by ID

        Retrieve a single accounts receivable (AR) ledger by its unique identifier. The response includes the ledger name, status, total charges, amount paid, and outstanding balance. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :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_accounts_receivable_ledger_by_id_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerResponse",
            '400': "ApiAccountingError",
            '404': "ApiAccountingError",
        }
        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_accounts_receivable_ledger_by_id_without_preload_content(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        _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 an accounts receivable ledger by ID

        Retrieve a single accounts receivable (AR) ledger by its unique identifier. The response includes the ledger name, status, total charges, amount paid, and outstanding balance. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :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_accounts_receivable_ledger_by_id_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerResponse",
            '400': "ApiAccountingError",
            '404': "ApiAccountingError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_accounts_receivable_ledger_by_id_serialize(
        self,
        x_property_id,
        accounts_receivable_ledger_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 accounts_receivable_ledger_id is not None:
            _path_params['accountsReceivableLedgerId'] = accounts_receivable_ledger_id
        # process the query parameters
        # process the header parameters
        if x_property_id is not None:
            _header_params['X-Property-ID'] = x_property_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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/accounting/v1.0/accounts-receivable-ledgers/{accountsReceivableLedgerId}',
            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_accounts_receivable_ledger_reservation_balance_transfer(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        reservation_id: Annotated[StrictInt, Field(description="Reservation ID")],
        _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,
    ) -> AccountsReceivableLedgerReservationBalanceTransferResponse:
        """Get AR balance transfer details for a reservation

        Retrieve the balance transfer details for a specific reservation. If a balance transfer exists between the reservation and an accounts receivable (AR) ledger, the response includes the transfer transaction ID, amount, and the associated AR ledger ID. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param reservation_id: Reservation ID (required)
        :type reservation_id: int
        :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_accounts_receivable_ledger_reservation_balance_transfer_serialize(
            x_property_id=x_property_id,
            reservation_id=reservation_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerReservationBalanceTransferResponse",
            '400': "ApiAccountingError",
        }
        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_accounts_receivable_ledger_reservation_balance_transfer_with_http_info(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        reservation_id: Annotated[StrictInt, Field(description="Reservation ID")],
        _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[AccountsReceivableLedgerReservationBalanceTransferResponse]:
        """Get AR balance transfer details for a reservation

        Retrieve the balance transfer details for a specific reservation. If a balance transfer exists between the reservation and an accounts receivable (AR) ledger, the response includes the transfer transaction ID, amount, and the associated AR ledger ID. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param reservation_id: Reservation ID (required)
        :type reservation_id: int
        :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_accounts_receivable_ledger_reservation_balance_transfer_serialize(
            x_property_id=x_property_id,
            reservation_id=reservation_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerReservationBalanceTransferResponse",
            '400': "ApiAccountingError",
        }
        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_accounts_receivable_ledger_reservation_balance_transfer_without_preload_content(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        reservation_id: Annotated[StrictInt, Field(description="Reservation ID")],
        _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 AR balance transfer details for a reservation

        Retrieve the balance transfer details for a specific reservation. If a balance transfer exists between the reservation and an accounts receivable (AR) ledger, the response includes the transfer transaction ID, amount, and the associated AR ledger ID. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param reservation_id: Reservation ID (required)
        :type reservation_id: int
        :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_accounts_receivable_ledger_reservation_balance_transfer_serialize(
            x_property_id=x_property_id,
            reservation_id=reservation_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerReservationBalanceTransferResponse",
            '400': "ApiAccountingError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_accounts_receivable_ledger_reservation_balance_transfer_serialize(
        self,
        x_property_id,
        reservation_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 reservation_id is not None:
            _path_params['reservationId'] = reservation_id
        # process the query parameters
        # process the header parameters
        if x_property_id is not None:
            _header_params['X-Property-ID'] = x_property_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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/accounting/v1.0/accounts-receivable-ledgers/reservation/{reservationId}/balance-transfer',
            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_accounts_receivable_ledger_totals(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        filter: Optional[GetAccountsReceivableLedgerTotalsFilterParameter] = 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,
    ) -> AccountsReceivableLedgerTotalsResponse:
        """Get AR ledger totals

        Retrieve aggregated totals across all accounts receivable (AR) ledgers for a property. The response includes the combined total charges, amount paid, and outstanding balance. You can optionally filter by ledger status to see totals for only open or closed ledgers. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param filter:
        :type filter: GetAccountsReceivableLedgerTotalsFilterParameter
        :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_accounts_receivable_ledger_totals_serialize(
            x_property_id=x_property_id,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerTotalsResponse",
            '400': "ApiAccountingError",
        }
        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_accounts_receivable_ledger_totals_with_http_info(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        filter: Optional[GetAccountsReceivableLedgerTotalsFilterParameter] = 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[AccountsReceivableLedgerTotalsResponse]:
        """Get AR ledger totals

        Retrieve aggregated totals across all accounts receivable (AR) ledgers for a property. The response includes the combined total charges, amount paid, and outstanding balance. You can optionally filter by ledger status to see totals for only open or closed ledgers. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param filter:
        :type filter: GetAccountsReceivableLedgerTotalsFilterParameter
        :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_accounts_receivable_ledger_totals_serialize(
            x_property_id=x_property_id,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerTotalsResponse",
            '400': "ApiAccountingError",
        }
        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_accounts_receivable_ledger_totals_without_preload_content(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        filter: Optional[GetAccountsReceivableLedgerTotalsFilterParameter] = 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 AR ledger totals

        Retrieve aggregated totals across all accounts receivable (AR) ledgers for a property. The response includes the combined total charges, amount paid, and outstanding balance. You can optionally filter by ledger status to see totals for only open or closed ledgers. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param filter:
        :type filter: GetAccountsReceivableLedgerTotalsFilterParameter
        :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_accounts_receivable_ledger_totals_serialize(
            x_property_id=x_property_id,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerTotalsResponse",
            '400': "ApiAccountingError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_accounts_receivable_ledger_totals_serialize(
        self,
        x_property_id,
        filter,
        _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 filter is not None:
            
            _query_params.append(('filter', filter))
            
        # process the header parameters
        if x_property_id is not None:
            _header_params['X-Property-ID'] = x_property_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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/accounting/v1.0/accounts-receivable-ledgers/totals',
            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_accounts_receivable_ledger_transactions(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        page_token: Annotated[Optional[StrictStr], Field(description="Opaque token for cursor-based pagination. Pass the `nextPageToken` value from a previous response to retrieve the next page. Omit this parameter (or pass null) for the first page. ")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of results to return per page. If not specified, the server uses a default page size. ")] = None,
        filter: Optional[GetAccountsReceivableLedgerTransactionsFilterParameter] = 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,
    ) -> AccountsReceivableTransactionPaginated:
        """List transactions for an AR ledger

        Retrieve a paginated list of transactions belonging to a specific accounts receivable (AR) ledger. You can filter by transaction state (posted or pending), date ranges, transaction type, and more. Use this endpoint to review the detailed financial activity within an AR ledger. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :param page_token: Opaque token for cursor-based pagination. Pass the `nextPageToken` value from a previous response to retrieve the next page. Omit this parameter (or pass null) for the first page. 
        :type page_token: str
        :param page_size: Number of results to return per page. If not specified, the server uses a default page size. 
        :type page_size: int
        :param filter:
        :type filter: GetAccountsReceivableLedgerTransactionsFilterParameter
        :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_accounts_receivable_ledger_transactions_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            page_token=page_token,
            page_size=page_size,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableTransactionPaginated",
            '400': "ApiAccountingError",
        }
        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_accounts_receivable_ledger_transactions_with_http_info(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        page_token: Annotated[Optional[StrictStr], Field(description="Opaque token for cursor-based pagination. Pass the `nextPageToken` value from a previous response to retrieve the next page. Omit this parameter (or pass null) for the first page. ")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of results to return per page. If not specified, the server uses a default page size. ")] = None,
        filter: Optional[GetAccountsReceivableLedgerTransactionsFilterParameter] = 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[AccountsReceivableTransactionPaginated]:
        """List transactions for an AR ledger

        Retrieve a paginated list of transactions belonging to a specific accounts receivable (AR) ledger. You can filter by transaction state (posted or pending), date ranges, transaction type, and more. Use this endpoint to review the detailed financial activity within an AR ledger. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :param page_token: Opaque token for cursor-based pagination. Pass the `nextPageToken` value from a previous response to retrieve the next page. Omit this parameter (or pass null) for the first page. 
        :type page_token: str
        :param page_size: Number of results to return per page. If not specified, the server uses a default page size. 
        :type page_size: int
        :param filter:
        :type filter: GetAccountsReceivableLedgerTransactionsFilterParameter
        :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_accounts_receivable_ledger_transactions_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            page_token=page_token,
            page_size=page_size,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableTransactionPaginated",
            '400': "ApiAccountingError",
        }
        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_accounts_receivable_ledger_transactions_without_preload_content(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        page_token: Annotated[Optional[StrictStr], Field(description="Opaque token for cursor-based pagination. Pass the `nextPageToken` value from a previous response to retrieve the next page. Omit this parameter (or pass null) for the first page. ")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of results to return per page. If not specified, the server uses a default page size. ")] = None,
        filter: Optional[GetAccountsReceivableLedgerTransactionsFilterParameter] = 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 transactions for an AR ledger

        Retrieve a paginated list of transactions belonging to a specific accounts receivable (AR) ledger. You can filter by transaction state (posted or pending), date ranges, transaction type, and more. Use this endpoint to review the detailed financial activity within an AR ledger. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :param page_token: Opaque token for cursor-based pagination. Pass the `nextPageToken` value from a previous response to retrieve the next page. Omit this parameter (or pass null) for the first page. 
        :type page_token: str
        :param page_size: Number of results to return per page. If not specified, the server uses a default page size. 
        :type page_size: int
        :param filter:
        :type filter: GetAccountsReceivableLedgerTransactionsFilterParameter
        :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_accounts_receivable_ledger_transactions_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            page_token=page_token,
            page_size=page_size,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableTransactionPaginated",
            '400': "ApiAccountingError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_accounts_receivable_ledger_transactions_serialize(
        self,
        x_property_id,
        accounts_receivable_ledger_id,
        page_token,
        page_size,
        filter,
        _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 accounts_receivable_ledger_id is not None:
            _path_params['accountsReceivableLedgerId'] = accounts_receivable_ledger_id
        # process the query parameters
        if page_token is not None:
            
            _query_params.append(('pageToken', page_token))
            
        if page_size is not None:
            
            _query_params.append(('pageSize', page_size))
            
        if filter is not None:
            
            _query_params.append(('filter', filter))
            
        # process the header parameters
        if x_property_id is not None:
            _header_params['X-Property-ID'] = x_property_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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/accounting/v1.0/accounts-receivable-ledgers/{accountsReceivableLedgerId}/transactions',
            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_accounts_receivable_ledgers(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        filter: Optional[GetAccountsReceivableLedgersFilterParameter] = 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,
    ) -> AccountsReceivableLedgerPaginated:
        """List accounts receivable ledgers

        Retrieve a paginated list of accounts receivable (AR) ledgers for a property. You can filter by status, date range, balance range, profile, and search query. Use AR ledgers to track balances that have been transferred from reservations or group profiles for later collection. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param filter:
        :type filter: GetAccountsReceivableLedgersFilterParameter
        :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_accounts_receivable_ledgers_serialize(
            x_property_id=x_property_id,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerPaginated",
            '400': "ApiAccountingError",
        }
        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_accounts_receivable_ledgers_with_http_info(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        filter: Optional[GetAccountsReceivableLedgersFilterParameter] = 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[AccountsReceivableLedgerPaginated]:
        """List accounts receivable ledgers

        Retrieve a paginated list of accounts receivable (AR) ledgers for a property. You can filter by status, date range, balance range, profile, and search query. Use AR ledgers to track balances that have been transferred from reservations or group profiles for later collection. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param filter:
        :type filter: GetAccountsReceivableLedgersFilterParameter
        :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_accounts_receivable_ledgers_serialize(
            x_property_id=x_property_id,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerPaginated",
            '400': "ApiAccountingError",
        }
        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_accounts_receivable_ledgers_without_preload_content(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        filter: Optional[GetAccountsReceivableLedgersFilterParameter] = 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 accounts receivable ledgers

        Retrieve a paginated list of accounts receivable (AR) ledgers for a property. You can filter by status, date range, balance range, profile, and search query. Use AR ledgers to track balances that have been transferred from reservations or group profiles for later collection. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param filter:
        :type filter: GetAccountsReceivableLedgersFilterParameter
        :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_accounts_receivable_ledgers_serialize(
            x_property_id=x_property_id,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerPaginated",
            '400': "ApiAccountingError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_accounts_receivable_ledgers_serialize(
        self,
        x_property_id,
        filter,
        _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 filter is not None:
            
            _query_params.append(('filter', filter))
            
        # process the header parameters
        if x_property_id is not None:
            _header_params['X-Property-ID'] = x_property_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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/accounting/v1.0/accounts-receivable-ledgers',
            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 patch_accounts_receivable_ledger(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_patch_request: AccountsReceivableLedgerPatchRequest,
        _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,
    ) -> AccountsReceivableLedgerResponse:
        """Update an accounts receivable ledger

        Update an existing accounts receivable (AR) ledger. You can change the name, description, linked profile, or status. Only include the fields you want to update. To close a ledger, set the status to CLOSED; note that a ledger can only be closed when its balance is zero. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_patch_request: (required)
        :type accounts_receivable_ledger_patch_request: AccountsReceivableLedgerPatchRequest
        :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._patch_accounts_receivable_ledger_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_patch_request=accounts_receivable_ledger_patch_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerResponse",
            '400': "ApiAccountingError",
        }
        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 patch_accounts_receivable_ledger_with_http_info(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_patch_request: AccountsReceivableLedgerPatchRequest,
        _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[AccountsReceivableLedgerResponse]:
        """Update an accounts receivable ledger

        Update an existing accounts receivable (AR) ledger. You can change the name, description, linked profile, or status. Only include the fields you want to update. To close a ledger, set the status to CLOSED; note that a ledger can only be closed when its balance is zero. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_patch_request: (required)
        :type accounts_receivable_ledger_patch_request: AccountsReceivableLedgerPatchRequest
        :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._patch_accounts_receivable_ledger_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_patch_request=accounts_receivable_ledger_patch_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerResponse",
            '400': "ApiAccountingError",
        }
        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 patch_accounts_receivable_ledger_without_preload_content(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_patch_request: AccountsReceivableLedgerPatchRequest,
        _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 an accounts receivable ledger

        Update an existing accounts receivable (AR) ledger. You can change the name, description, linked profile, or status. Only include the fields you want to update. To close a ledger, set the status to CLOSED; note that a ledger can only be closed when its balance is zero. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_patch_request: (required)
        :type accounts_receivable_ledger_patch_request: AccountsReceivableLedgerPatchRequest
        :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._patch_accounts_receivable_ledger_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_patch_request=accounts_receivable_ledger_patch_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerResponse",
            '400': "ApiAccountingError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _patch_accounts_receivable_ledger_serialize(
        self,
        x_property_id,
        accounts_receivable_ledger_patch_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        # process the query parameters
        # process the header parameters
        if x_property_id is not None:
            _header_params['X-Property-ID'] = x_property_id
        # process the form parameters
        # process the body parameter
        if accounts_receivable_ledger_patch_request is not None:
            _body_params = accounts_receivable_ledger_patch_request


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

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

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

        return self.api_client.param_serialize(
            method='PATCH',
            resource_path='/accounting/v1.0/accounts-receivable-ledgers',
            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 post_accounts_receivable_ledger(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_post_request: AccountsReceivableLedgerPostRequest,
        _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,
    ) -> AccountsReceivableLedgerResponse:
        """Create an accounts receivable ledger

        Create a new accounts receivable (AR) ledger for a property. An AR ledger provides a way to track outstanding balances outside of a reservation, such as invoices sent to a corporate client. You must provide a name, and can optionally link the ledger to a profile. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_post_request: (required)
        :type accounts_receivable_ledger_post_request: AccountsReceivableLedgerPostRequest
        :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._post_accounts_receivable_ledger_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_post_request=accounts_receivable_ledger_post_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerResponse",
            '400': "ApiAccountingError",
        }
        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 post_accounts_receivable_ledger_with_http_info(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_post_request: AccountsReceivableLedgerPostRequest,
        _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[AccountsReceivableLedgerResponse]:
        """Create an accounts receivable ledger

        Create a new accounts receivable (AR) ledger for a property. An AR ledger provides a way to track outstanding balances outside of a reservation, such as invoices sent to a corporate client. You must provide a name, and can optionally link the ledger to a profile. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_post_request: (required)
        :type accounts_receivable_ledger_post_request: AccountsReceivableLedgerPostRequest
        :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._post_accounts_receivable_ledger_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_post_request=accounts_receivable_ledger_post_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerResponse",
            '400': "ApiAccountingError",
        }
        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 post_accounts_receivable_ledger_without_preload_content(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_post_request: AccountsReceivableLedgerPostRequest,
        _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 an accounts receivable ledger

        Create a new accounts receivable (AR) ledger for a property. An AR ledger provides a way to track outstanding balances outside of a reservation, such as invoices sent to a corporate client. You must provide a name, and can optionally link the ledger to a profile. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_post_request: (required)
        :type accounts_receivable_ledger_post_request: AccountsReceivableLedgerPostRequest
        :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._post_accounts_receivable_ledger_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_post_request=accounts_receivable_ledger_post_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AccountsReceivableLedgerResponse",
            '400': "ApiAccountingError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _post_accounts_receivable_ledger_serialize(
        self,
        x_property_id,
        accounts_receivable_ledger_post_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        # process the query parameters
        # process the header parameters
        if x_property_id is not None:
            _header_params['X-Property-ID'] = x_property_id
        # process the form parameters
        # process the body parameter
        if accounts_receivable_ledger_post_request is not None:
            _body_params = accounts_receivable_ledger_post_request


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

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

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/accounting/v1.0/accounts-receivable-ledgers',
            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 post_accounts_receivable_ledger_group_balance_transfer(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        group_profile_id: Annotated[StrictInt, Field(description="Group Profile ID")],
        post_group_profile_balance_transfer_request: Optional[PostGroupProfileBalanceTransferRequest] = 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,
    ) -> AsyncEventResponse:
        """Transfer a group profile balance to an AR ledger

        Transfer the outstanding balance of a group profile to an accounts receivable (AR) ledger. You can optionally specify a folio ID to transfer the balance from a specific folio within the group profile. This operation is processed asynchronously; the response includes an event ID you can use to track the result. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :param group_profile_id: Group Profile ID (required)
        :type group_profile_id: int
        :param post_group_profile_balance_transfer_request:
        :type post_group_profile_balance_transfer_request: PostGroupProfileBalanceTransferRequest
        :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._post_accounts_receivable_ledger_group_balance_transfer_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            group_profile_id=group_profile_id,
            post_group_profile_balance_transfer_request=post_group_profile_balance_transfer_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AsyncEventResponse",
            '400': "ApiAccountingError",
            '404': "ApiAccountingError",
        }
        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 post_accounts_receivable_ledger_group_balance_transfer_with_http_info(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        group_profile_id: Annotated[StrictInt, Field(description="Group Profile ID")],
        post_group_profile_balance_transfer_request: Optional[PostGroupProfileBalanceTransferRequest] = 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[AsyncEventResponse]:
        """Transfer a group profile balance to an AR ledger

        Transfer the outstanding balance of a group profile to an accounts receivable (AR) ledger. You can optionally specify a folio ID to transfer the balance from a specific folio within the group profile. This operation is processed asynchronously; the response includes an event ID you can use to track the result. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :param group_profile_id: Group Profile ID (required)
        :type group_profile_id: int
        :param post_group_profile_balance_transfer_request:
        :type post_group_profile_balance_transfer_request: PostGroupProfileBalanceTransferRequest
        :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._post_accounts_receivable_ledger_group_balance_transfer_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            group_profile_id=group_profile_id,
            post_group_profile_balance_transfer_request=post_group_profile_balance_transfer_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AsyncEventResponse",
            '400': "ApiAccountingError",
            '404': "ApiAccountingError",
        }
        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 post_accounts_receivable_ledger_group_balance_transfer_without_preload_content(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        group_profile_id: Annotated[StrictInt, Field(description="Group Profile ID")],
        post_group_profile_balance_transfer_request: Optional[PostGroupProfileBalanceTransferRequest] = 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:
        """Transfer a group profile balance to an AR ledger

        Transfer the outstanding balance of a group profile to an accounts receivable (AR) ledger. You can optionally specify a folio ID to transfer the balance from a specific folio within the group profile. This operation is processed asynchronously; the response includes an event ID you can use to track the result. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :param group_profile_id: Group Profile ID (required)
        :type group_profile_id: int
        :param post_group_profile_balance_transfer_request:
        :type post_group_profile_balance_transfer_request: PostGroupProfileBalanceTransferRequest
        :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._post_accounts_receivable_ledger_group_balance_transfer_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            group_profile_id=group_profile_id,
            post_group_profile_balance_transfer_request=post_group_profile_balance_transfer_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AsyncEventResponse",
            '400': "ApiAccountingError",
            '404': "ApiAccountingError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _post_accounts_receivable_ledger_group_balance_transfer_serialize(
        self,
        x_property_id,
        accounts_receivable_ledger_id,
        group_profile_id,
        post_group_profile_balance_transfer_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        if accounts_receivable_ledger_id is not None:
            _path_params['accountsReceivableLedgerId'] = accounts_receivable_ledger_id
        if group_profile_id is not None:
            _path_params['groupProfileId'] = group_profile_id
        # process the query parameters
        # process the header parameters
        if x_property_id is not None:
            _header_params['X-Property-ID'] = x_property_id
        # process the form parameters
        # process the body parameter
        if post_group_profile_balance_transfer_request is not None:
            _body_params = post_group_profile_balance_transfer_request


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

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

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/accounting/v1.0/accounts-receivable-ledgers/{accountsReceivableLedgerId}/group-profile/{groupProfileId}/balance-transfer',
            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 post_accounts_receivable_ledger_reservation_balance_transfer(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        reservation_id: Annotated[StrictInt, Field(description="Reservation ID")],
        _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,
    ) -> AsyncEventResponse:
        """Transfer a reservation balance to an AR ledger

        Transfer the outstanding balance of a reservation to an accounts receivable (AR) ledger. This creates a transfer transaction that moves the balance from the reservation to the specified AR ledger for later collection. This operation is processed asynchronously; the response includes an event ID you can use to track the result. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :param reservation_id: Reservation ID (required)
        :type reservation_id: int
        :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._post_accounts_receivable_ledger_reservation_balance_transfer_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            reservation_id=reservation_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AsyncEventResponse",
            '400': "ApiAccountingError",
            '404': "ApiAccountingError",
        }
        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 post_accounts_receivable_ledger_reservation_balance_transfer_with_http_info(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        reservation_id: Annotated[StrictInt, Field(description="Reservation ID")],
        _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[AsyncEventResponse]:
        """Transfer a reservation balance to an AR ledger

        Transfer the outstanding balance of a reservation to an accounts receivable (AR) ledger. This creates a transfer transaction that moves the balance from the reservation to the specified AR ledger for later collection. This operation is processed asynchronously; the response includes an event ID you can use to track the result. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :param reservation_id: Reservation ID (required)
        :type reservation_id: int
        :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._post_accounts_receivable_ledger_reservation_balance_transfer_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            reservation_id=reservation_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AsyncEventResponse",
            '400': "ApiAccountingError",
            '404': "ApiAccountingError",
        }
        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 post_accounts_receivable_ledger_reservation_balance_transfer_without_preload_content(
        self,
        x_property_id: Annotated[StrictInt, Field(description="Unique identifier of the property. Required for all requests to scope data to a specific property. ")],
        accounts_receivable_ledger_id: Annotated[StrictInt, Field(description="Unique identifier of the accounts receivable ledger.")],
        reservation_id: Annotated[StrictInt, Field(description="Reservation ID")],
        _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:
        """Transfer a reservation balance to an AR ledger

        Transfer the outstanding balance of a reservation to an accounts receivable (AR) ledger. This creates a transfer transaction that moves the balance from the reservation to the specified AR ledger for later collection. This operation is processed asynchronously; the response includes an event ID you can use to track the result. 

        :param x_property_id: Unique identifier of the property. Required for all requests to scope data to a specific property.  (required)
        :type x_property_id: int
        :param accounts_receivable_ledger_id: Unique identifier of the accounts receivable ledger. (required)
        :type accounts_receivable_ledger_id: int
        :param reservation_id: Reservation ID (required)
        :type reservation_id: int
        :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._post_accounts_receivable_ledger_reservation_balance_transfer_serialize(
            x_property_id=x_property_id,
            accounts_receivable_ledger_id=accounts_receivable_ledger_id,
            reservation_id=reservation_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AsyncEventResponse",
            '400': "ApiAccountingError",
            '404': "ApiAccountingError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _post_accounts_receivable_ledger_reservation_balance_transfer_serialize(
        self,
        x_property_id,
        accounts_receivable_ledger_id,
        reservation_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 accounts_receivable_ledger_id is not None:
            _path_params['accountsReceivableLedgerId'] = accounts_receivable_ledger_id
        if reservation_id is not None:
            _path_params['reservationId'] = reservation_id
        # process the query parameters
        # process the header parameters
        if x_property_id is not None:
            _header_params['X-Property-ID'] = x_property_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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/accounting/v1.0/accounts-receivable-ledgers/{accountsReceivableLedgerId}/reservation/{reservationId}/balance-transfer',
            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
        )


