# This file was auto-generated by Fern from our API Definition.

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.annualrevenue import Annualrevenue
from ..types.application_details_record import ApplicationDetailsRecord
from ..types.application_query_record import ApplicationQueryRecord
from ..types.attachments import Attachments
from ..types.avgmonthly import Avgmonthly
from ..types.baddress_1 import Baddress1
from ..types.baddress_2 import Baddress2
from ..types.bank import Bank
from ..types.bcity import Bcity
from ..types.bcountry import Bcountry
from ..types.binperson import Binperson
from ..types.binphone import Binphone
from ..types.binweb import Binweb
from ..types.boarding_business_fax import BoardingBusinessFax
from ..types.boarding_business_phone import BoardingBusinessPhone
from ..types.boarding_link_query_record import BoardingLinkQueryRecord
from ..types.bstate import Bstate
from ..types.bsummary import Bsummary
from ..types.busstartdate import Busstartdate
from ..types.bzip import Bzip
from ..types.contacts_field import ContactsField
from ..types.dbaname import Dbaname
from ..types.ein import Ein
from ..types.email import Email
from ..types.export_format import ExportFormat
from ..types.external_paypoint_id import ExternalPaypointId
from ..types.highticketamt import Highticketamt
from ..types.legalname import Legalname
from ..types.license import License
from ..types.licensestate import Licensestate
from ..types.maddress import Maddress
from ..types.maddress_1 import Maddress1
from ..types.mcc import Mcc
from ..types.mcity import Mcity
from ..types.mcountry import Mcountry
from ..types.mstate import Mstate
from ..types.mzip import Mzip
from ..types.orgid import Orgid
from ..types.own_type import OwnType
from ..types.ownership import Ownership
from ..types.payabli_api_response_00 import PayabliApiResponse00
from ..types.payabli_api_response_00_responsedatanonobject import PayabliApiResponse00Responsedatanonobject
from ..types.payout_average_monthly_volume import PayoutAverageMonthlyVolume
from ..types.payout_average_ticket_limit import PayoutAverageTicketLimit
from ..types.payout_credit_limit import PayoutCreditLimit
from ..types.payout_high_ticket_amount import PayoutHighTicketAmount
from ..types.query_boarding_apps_list_response import QueryBoardingAppsListResponse
from ..types.query_boarding_links_response import QueryBoardingLinksResponse
from ..types.recipient_email_notification import RecipientEmailNotification
from ..types.rep_code import RepCode
from ..types.rep_name import RepName
from ..types.rep_office import RepOffice
from ..types.resumable import Resumable
from ..types.services import Services
from ..types.signer_data_request import SignerDataRequest
from ..types.taxfillname import Taxfillname
from ..types.template_id import TemplateId
from ..types.ticketamt import Ticketamt
from ..types.website import Website
from ..types.whencharged import Whencharged
from ..types.whendelivered import Whendelivered
from ..types.whenprovided import Whenprovided
from ..types.whenrefunded import Whenrefunded
from .raw_client import AsyncRawBoardingClient, RawBoardingClient
from .types.add_application_request import AddApplicationRequest

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class BoardingClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawBoardingClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> RawBoardingClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawBoardingClient
        """
        return self._raw_client

    def add_application(
        self, *, request: AddApplicationRequest, request_options: typing.Optional[RequestOptions] = None
    ) -> PayabliApiResponse00Responsedatanonobject:
        """
        Creates a boarding application in an organization. This endpoint requires an application API token.

        Parameters
        ----------
        request : AddApplicationRequest

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponse00Responsedatanonobject
            Success

        Examples
        --------
        from payabli import (
            ApplicationDataPayIn,
            ApplicationDataPayInBankData,
            ApplicationDataPayInContactsItem,
            ApplicationDataPayInOwnershipItem,
            ApplicationDataPayInServices,
            ApplicationDataPayInServicesAch,
            ApplicationDataPayInServicesCard,
            SignerDataRequest,
            payabli,
        )

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.boarding.add_application(
            request=ApplicationDataPayIn(
                services=ApplicationDataPayInServices(
                    ach=ApplicationDataPayInServicesAch(),
                    card=ApplicationDataPayInServicesCard(
                        accept_amex=True,
                        accept_discover=True,
                        accept_mastercard=True,
                        accept_visa=True,
                    ),
                ),
                annual_revenue=1000.0,
                average_bill_size="500",
                average_monthly_bill="5650",
                avgmonthly=1000.0,
                baddress="123 Walnut Street",
                baddress_1="Suite 103",
                bank_data=ApplicationDataPayInBankData(),
                bcity="New Vegas",
                bcountry="US",
                binperson=60,
                binphone=20,
                binweb=20,
                bstate="FL",
                bsummary="Brick and mortar store that sells office supplies",
                btype="Limited Liability Company",
                bzip="33000",
                contacts=[
                    ApplicationDataPayInContactsItem(
                        contact_email="herman@hermanscoatings.com",
                        contact_name="Herman Martinez",
                        contact_phone="3055550000",
                        contact_title="Owner",
                    )
                ],
                credit_limit="creditLimit",
                dba_name="Sunshine Gutters",
                ein="123456789",
                faxnumber="1234567890",
                highticketamt=1000.0,
                legal_name="Sunshine Services, LLC",
                license="2222222FFG",
                licstate="CA",
                maddress="123 Walnut Street",
                maddress_1="STE 900",
                mcc="7777",
                mcity="Johnson City",
                mcountry="US",
                mstate="TN",
                mzip="37615",
                org_id=123,
                ownership=[
                    ApplicationDataPayInOwnershipItem(
                        oaddress="33 North St",
                        ocity="Any City",
                        ocountry="US",
                        odriverstate="CA",
                        ostate="CA",
                        ownerdob="01/01/1990",
                        ownerdriver="CA6677778",
                        owneremail="test@email.com",
                        ownername="John Smith",
                        ownerpercent=100,
                        ownerphone_1="555888111",
                        ownerphone_2="555888111",
                        ownerssn="123456789",
                        ownertitle="CEO",
                        ozip="55555",
                    )
                ],
                phonenumber="1234567890",
                processing_region="US",
                recipient_email="josephray@example.com",
                recipient_email_notification=True,
                resumable=True,
                signer=SignerDataRequest(
                    address="33 North St",
                    address_1="STE 900",
                    city="Bristol",
                    country="US",
                    dob="01/01/1976",
                    email="test@email.com",
                    name="John Smith",
                    phone="555888111",
                    ssn="123456789",
                    state="TN",
                    zip="55555",
                    pci_attestation=True,
                    signed_document_reference="https://example.com/signed-document.pdf",
                    attestation_date="04/20/2025",
                    sign_date="04/20/2025",
                    additional_data='{"deviceId":"499585-389fj484-3jcj8hj3","session":"fifji4-fiu443-fn4843","timeWithCompany":"6 Years"}',
                ),
                startdate="01/01/1990",
                tax_fill_name="Sunshine LLC",
                template_id=22,
                ticketamt=1000.0,
                website="www.example.com",
                when_charged="When Service Provided",
                when_delivered="Over 30 Days",
                when_provided="30 Days or Less",
                when_refunded="30 Days or Less",
            ),
        )
        """
        _response = self._raw_client.add_application(request=request, request_options=request_options)
        return _response.data

    def delete_application(
        self, app_id: int, *, request_options: typing.Optional[RequestOptions] = None
    ) -> PayabliApiResponse00Responsedatanonobject:
        """
        Deletes a boarding application by ID.

        Parameters
        ----------
        app_id : int
            Boarding application ID.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponse00Responsedatanonobject
            Success

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.boarding.delete_application(
            app_id=352,
        )
        """
        _response = self._raw_client.delete_application(app_id, request_options=request_options)
        return _response.data

    def get_application(
        self, app_id: int, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ApplicationDetailsRecord:
        """
        Retrieves the details for a boarding application by ID.

        Parameters
        ----------
        app_id : int
            Boarding application ID.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ApplicationDetailsRecord
            Success

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.boarding.get_application(
            app_id=352,
        )
        """
        _response = self._raw_client.get_application(app_id, request_options=request_options)
        return _response.data

    def get_application_by_auth(
        self,
        x_id: str,
        *,
        email: typing.Optional[Email] = OMIT,
        reference_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ApplicationQueryRecord:
        """
        Gets a boarding application by authentication information. This endpoint requires an `application` API token.

        Parameters
        ----------
        x_id : str
            The application ID in Hex format. Find this at the end of the boarding link URL returned in a call to api/Boarding/applink/{appId}/{mail2}. For example in:  `https://boarding-sandbox.payabli.com/boarding/externalapp/load/17E`, the xId is `17E`.

        email : typing.Optional[Email]
            The email address the applicant used to save the application.

        reference_id : typing.Optional[str]
            The referenceId is sent to the applicant via email when they save the application.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ApplicationQueryRecord
            Success

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.boarding.get_application_by_auth(
            x_id="17E",
            email="admin@email.com",
            reference_id="n6UCd1f1ygG7",
        )
        """
        _response = self._raw_client.get_application_by_auth(
            x_id, email=email, reference_id=reference_id, request_options=request_options
        )
        return _response.data

    def get_by_id_link_application(
        self, boarding_link_id: int, *, request_options: typing.Optional[RequestOptions] = None
    ) -> BoardingLinkQueryRecord:
        """
        Retrieves details for a boarding link, by ID.

        Parameters
        ----------
        boarding_link_id : int
            The boarding link ID. You can find this at the end of the boarding link reference name. For example `https://boarding.payabli.com/boarding/app/myorgaccountname-00091`. The ID is `91`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        BoardingLinkQueryRecord
            Success

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.boarding.get_by_id_link_application(
            boarding_link_id=91,
        )
        """
        _response = self._raw_client.get_by_id_link_application(boarding_link_id, request_options=request_options)
        return _response.data

    def get_by_template_id_link_application(
        self, template_id: float, *, request_options: typing.Optional[RequestOptions] = None
    ) -> BoardingLinkQueryRecord:
        """
        Get details for a boarding link using the boarding template ID. This endpoint requires an application API token.

        Parameters
        ----------
        template_id : float
            The boarding template ID. You can find this at the end of the boarding template URL in PartnerHub. Example: `https://partner-sandbox.payabli.com/myorganization/boarding/edittemplate/80`. Here, the template ID is `80`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        BoardingLinkQueryRecord
            Success

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.boarding.get_by_template_id_link_application(
            template_id=80.0,
        )
        """
        _response = self._raw_client.get_by_template_id_link_application(template_id, request_options=request_options)
        return _response.data

    def get_external_application(
        self,
        app_id: int,
        mail_2: str,
        *,
        send_email: typing.Optional[bool] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PayabliApiResponse00:
        """
        Retrieves a link and the verification code used to log into an existing boarding application. You can also use this endpoint to send a link and referenceId for an existing boarding application to an email address. The recipient can use the referenceId and email address to access and edit the application.

        Parameters
        ----------
        app_id : int
            Boarding application ID.

        mail_2 : str
            Email address used to access the application. If `sendEmail` parameter is true, a link to the application is sent to this email address.

        send_email : typing.Optional[bool]
            If `true`, sends an email that includes the link to the application to the `mail2` address. Defaults to `false`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponse00
            Success

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.boarding.get_external_application(
            app_id=352,
            mail_2="mail2",
        )
        """
        _response = self._raw_client.get_external_application(
            app_id, mail_2, send_email=send_email, request_options=request_options
        )
        return _response.data

    def get_link_application(
        self, boarding_link_reference: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> BoardingLinkQueryRecord:
        """
        Retrieves the details for a boarding link, by reference name. This endpoint requires an application API token.

        Parameters
        ----------
        boarding_link_reference : str
            The boarding link reference name. You can find this at the end of the boarding link URL. For example `https://boarding.payabli.com/boarding/app/myorgaccountname-00091`

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        BoardingLinkQueryRecord
            Success

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.boarding.get_link_application(
            boarding_link_reference="myorgaccountname-00091",
        )
        """
        _response = self._raw_client.get_link_application(boarding_link_reference, request_options=request_options)
        return _response.data

    def list_applications(
        self,
        org_id: int,
        *,
        export_format: typing.Optional[ExportFormat] = None,
        from_record: typing.Optional[int] = None,
        limit_record: typing.Optional[int] = None,
        parameters: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None,
        sort_by: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> QueryBoardingAppsListResponse:
        """
        Returns a list of boarding applications for an organization. Use filters to limit results. Include the `exportFormat` query parameter to return the results as a file instead of a JSON response.

        Parameters
        ----------
        org_id : int
            The numeric identifier for organization, assigned by Payabli.

        export_format : typing.Optional[ExportFormat]

        from_record : typing.Optional[int]
            The number of records to skip before starting to collect the result set.

        limit_record : typing.Optional[int]
            Max number of records to return for the query. Use `0` or negative value to return all records.

        parameters : typing.Optional[typing.Dict[str, typing.Optional[str]]]
            Collection of field names, conditions, and values used to filter the query

            See [Filters and Conditions Reference](/developers/developer-guides/pay-ops-reporting-engine-overview#filters-and-conditions-reference) for help.

            List of field names accepted:
            - `createdAt` (gt, ge, lt, le, eq, ne)
            - `startDate` (gt, ge, lt, le, eq, ne)
            - `dbaname` (ct, nct)
            - `legalname` (ct, nct)
            - `ein` (ct, nct)
            - `address` (ct, nct)
            - `city` (ct, nct)
            - `state` (ct, nct)
            - `phone` (ct, nct)
            - `mcc` (ct, nct)
            - `owntype` (ct, nct)
            - `ownerName` (ct, nct)
            - `contactName` (ct, nct)
            - `status` (in, nin, eq,ne)
            - `orgParentname` (ct, nct)
            - `externalpaypointID` (ct, nct, eq, ne)
            - `repCode` (ct, nct, eq, ne)
            - `repName` (ct, nct, eq, ne)
            - `repOffice` (ct, nct, eq, ne)
            List of comparison accepted - enclosed between parentheses:
            - eq or empty => equal
            - gt => greater than
            - ge => greater or equal
            - lt => less than
            - le => less or equal
            - ne => not equal
            - ct => contains
            - nct => not contains
            - in => inside array
            - nin => not inside array

        sort_by : typing.Optional[str]
            The field name to use for sorting results. Use `desc(field_name)` to sort descending by `field_name`, and use `asc(field_name)` to sort ascending by `field_name`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        QueryBoardingAppsListResponse
            Success

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.boarding.list_applications(
            org_id=123,
            from_record=251,
            limit_record=0,
            sort_by="desc(field_name)",
        )
        """
        _response = self._raw_client.list_applications(
            org_id,
            export_format=export_format,
            from_record=from_record,
            limit_record=limit_record,
            parameters=parameters,
            sort_by=sort_by,
            request_options=request_options,
        )
        return _response.data

    def list_boarding_links(
        self,
        org_id: int,
        *,
        from_record: typing.Optional[int] = None,
        limit_record: typing.Optional[int] = None,
        parameters: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None,
        sort_by: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> QueryBoardingLinksResponse:
        """
        Return a list of boarding links for an organization. Use filters to limit results.

        Parameters
        ----------
        org_id : int
            The numeric identifier for organization, assigned by Payabli.

        from_record : typing.Optional[int]
            The number of records to skip before starting to collect the result set.

        limit_record : typing.Optional[int]
            Max number of records to return for the query. Use `0` or negative value to return all records.

        parameters : typing.Optional[typing.Dict[str, typing.Optional[str]]]
            Collection of field names, conditions, and values used to filter the query

            See [Filters and Conditions Reference](/developers/developer-guides/pay-ops-reporting-engine-overview#filters-and-conditions-reference) for help.

            List of field names accepted:
            - `lastUpdated` (gt, ge, lt, le, eq, ne)
            - `templateName` (ct, nct)
            - `referenceName` (ct, nct)
            - `acceptRegister` (eq, ne)
            - `acceptAuth` (eq, ne)
            - `templateCode` (ct, nct)
            - `templateId` (eq, ne)
            - `orgParentname` (ct, nct)

            List of comparison accepted - enclosed between parentheses:
            - eq or empty => equal
            - gt => greater than
            - ge => greater or equal
            - lt => less than
            - le => less or equal
            - ne => not equal
            - ct => contains
            - nct => not contains
            - in => inside array
            - nin => not inside array

            List of parameters accepted:
            - limitRecord : max number of records for query (default="20", "0" or negative value for all)
            - fromRecord : initial record in query

            Example: templateName(ct)=hoa return all records with template title containing "hoa"

        sort_by : typing.Optional[str]
            The field name to use for sorting results. Use `desc(field_name)` to sort descending by `field_name`, and use `asc(field_name)` to sort ascending by `field_name`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        QueryBoardingLinksResponse
            Success

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.boarding.list_boarding_links(
            org_id=123,
            from_record=251,
            limit_record=0,
            sort_by="desc(field_name)",
        )
        """
        _response = self._raw_client.list_boarding_links(
            org_id,
            from_record=from_record,
            limit_record=limit_record,
            parameters=parameters,
            sort_by=sort_by,
            request_options=request_options,
        )
        return _response.data

    def update_application(
        self,
        app_id: int,
        *,
        services: typing.Optional[Services] = OMIT,
        annual_revenue: typing.Optional[Annualrevenue] = OMIT,
        attachments: typing.Optional[Attachments] = OMIT,
        avgmonthly: typing.Optional[Avgmonthly] = OMIT,
        baddress: typing.Optional[Baddress1] = OMIT,
        baddress_1: typing.Optional[Baddress2] = OMIT,
        bank_data: typing.Optional[Bank] = OMIT,
        bcity: typing.Optional[Bcity] = OMIT,
        bcountry: typing.Optional[Bcountry] = OMIT,
        binperson: typing.Optional[Binperson] = OMIT,
        binphone: typing.Optional[Binphone] = OMIT,
        binweb: typing.Optional[Binweb] = OMIT,
        bstate: typing.Optional[Bstate] = OMIT,
        bsummary: typing.Optional[Bsummary] = OMIT,
        btype: typing.Optional[OwnType] = OMIT,
        bzip: typing.Optional[Bzip] = OMIT,
        contacts: typing.Optional[ContactsField] = OMIT,
        dbaname: typing.Optional[Dbaname] = OMIT,
        ein: typing.Optional[Ein] = OMIT,
        external_paypoint_id: typing.Optional[ExternalPaypointId] = OMIT,
        faxnumber: typing.Optional[BoardingBusinessFax] = OMIT,
        highticketamt: typing.Optional[Highticketamt] = OMIT,
        legalname: typing.Optional[Legalname] = OMIT,
        license: typing.Optional[License] = OMIT,
        licstate: typing.Optional[Licensestate] = OMIT,
        maddress: typing.Optional[Maddress] = OMIT,
        maddress_1: typing.Optional[Maddress1] = OMIT,
        mcc: typing.Optional[Mcc] = OMIT,
        mcity: typing.Optional[Mcity] = OMIT,
        mcountry: typing.Optional[Mcountry] = OMIT,
        mstate: typing.Optional[Mstate] = OMIT,
        mzip: typing.Optional[Mzip] = OMIT,
        org_id: typing.Optional[Orgid] = OMIT,
        ownership: typing.Optional[Ownership] = OMIT,
        payout_average_monthly_volume: typing.Optional[PayoutAverageMonthlyVolume] = OMIT,
        payout_average_ticket_limit: typing.Optional[PayoutAverageTicketLimit] = OMIT,
        payout_credit_limit: typing.Optional[PayoutCreditLimit] = OMIT,
        payout_high_ticket_amount: typing.Optional[PayoutHighTicketAmount] = OMIT,
        phonenumber: typing.Optional[BoardingBusinessPhone] = OMIT,
        recipient_email: typing.Optional[Email] = OMIT,
        recipient_email_notification: typing.Optional[RecipientEmailNotification] = OMIT,
        resumable: typing.Optional[Resumable] = OMIT,
        signer: typing.Optional[SignerDataRequest] = OMIT,
        startdate: typing.Optional[Busstartdate] = OMIT,
        taxfillname: typing.Optional[Taxfillname] = OMIT,
        template_id: typing.Optional[TemplateId] = OMIT,
        ticketamt: typing.Optional[Ticketamt] = OMIT,
        website: typing.Optional[Website] = OMIT,
        when_charged: typing.Optional[Whencharged] = OMIT,
        when_delivered: typing.Optional[Whendelivered] = OMIT,
        when_provided: typing.Optional[Whenprovided] = OMIT,
        when_refunded: typing.Optional[Whenrefunded] = OMIT,
        rep_code: typing.Optional[RepCode] = OMIT,
        rep_name: typing.Optional[RepName] = OMIT,
        rep_office: typing.Optional[RepOffice] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PayabliApiResponse00Responsedatanonobject:
        """
        Updates a boarding application by ID. This endpoint requires an application API token.

        Parameters
        ----------
        app_id : int
            Boarding application ID.

        services : typing.Optional[Services]

        annual_revenue : typing.Optional[Annualrevenue]

        attachments : typing.Optional[Attachments]

        avgmonthly : typing.Optional[Avgmonthly]

        baddress : typing.Optional[Baddress1]

        baddress_1 : typing.Optional[Baddress2]

        bank_data : typing.Optional[Bank]

        bcity : typing.Optional[Bcity]

        bcountry : typing.Optional[Bcountry]

        binperson : typing.Optional[Binperson]

        binphone : typing.Optional[Binphone]

        binweb : typing.Optional[Binweb]

        bstate : typing.Optional[Bstate]

        bsummary : typing.Optional[Bsummary]

        btype : typing.Optional[OwnType]

        bzip : typing.Optional[Bzip]

        contacts : typing.Optional[ContactsField]

        dbaname : typing.Optional[Dbaname]

        ein : typing.Optional[Ein]

        external_paypoint_id : typing.Optional[ExternalPaypointId]

        faxnumber : typing.Optional[BoardingBusinessFax]

        highticketamt : typing.Optional[Highticketamt]

        legalname : typing.Optional[Legalname]

        license : typing.Optional[License]

        licstate : typing.Optional[Licensestate]

        maddress : typing.Optional[Maddress]

        maddress_1 : typing.Optional[Maddress1]

        mcc : typing.Optional[Mcc]

        mcity : typing.Optional[Mcity]

        mcountry : typing.Optional[Mcountry]

        mstate : typing.Optional[Mstate]

        mzip : typing.Optional[Mzip]

        org_id : typing.Optional[Orgid]

        ownership : typing.Optional[Ownership]

        payout_average_monthly_volume : typing.Optional[PayoutAverageMonthlyVolume]

        payout_average_ticket_limit : typing.Optional[PayoutAverageTicketLimit]

        payout_credit_limit : typing.Optional[PayoutCreditLimit]

        payout_high_ticket_amount : typing.Optional[PayoutHighTicketAmount]

        phonenumber : typing.Optional[BoardingBusinessPhone]

        recipient_email : typing.Optional[Email]
            Email address for the applicant. This is used to send the applicant a boarding link.

        recipient_email_notification : typing.Optional[RecipientEmailNotification]

        resumable : typing.Optional[Resumable]

        signer : typing.Optional[SignerDataRequest]

        startdate : typing.Optional[Busstartdate]

        taxfillname : typing.Optional[Taxfillname]

        template_id : typing.Optional[TemplateId]

        ticketamt : typing.Optional[Ticketamt]

        website : typing.Optional[Website]

        when_charged : typing.Optional[Whencharged]

        when_delivered : typing.Optional[Whendelivered]

        when_provided : typing.Optional[Whenprovided]

        when_refunded : typing.Optional[Whenrefunded]

        rep_code : typing.Optional[RepCode]

        rep_name : typing.Optional[RepName]

        rep_office : typing.Optional[RepOffice]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponse00Responsedatanonobject
            Success

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.boarding.update_application(
            app_id=352,
        )
        """
        _response = self._raw_client.update_application(
            app_id,
            services=services,
            annual_revenue=annual_revenue,
            attachments=attachments,
            avgmonthly=avgmonthly,
            baddress=baddress,
            baddress_1=baddress_1,
            bank_data=bank_data,
            bcity=bcity,
            bcountry=bcountry,
            binperson=binperson,
            binphone=binphone,
            binweb=binweb,
            bstate=bstate,
            bsummary=bsummary,
            btype=btype,
            bzip=bzip,
            contacts=contacts,
            dbaname=dbaname,
            ein=ein,
            external_paypoint_id=external_paypoint_id,
            faxnumber=faxnumber,
            highticketamt=highticketamt,
            legalname=legalname,
            license=license,
            licstate=licstate,
            maddress=maddress,
            maddress_1=maddress_1,
            mcc=mcc,
            mcity=mcity,
            mcountry=mcountry,
            mstate=mstate,
            mzip=mzip,
            org_id=org_id,
            ownership=ownership,
            payout_average_monthly_volume=payout_average_monthly_volume,
            payout_average_ticket_limit=payout_average_ticket_limit,
            payout_credit_limit=payout_credit_limit,
            payout_high_ticket_amount=payout_high_ticket_amount,
            phonenumber=phonenumber,
            recipient_email=recipient_email,
            recipient_email_notification=recipient_email_notification,
            resumable=resumable,
            signer=signer,
            startdate=startdate,
            taxfillname=taxfillname,
            template_id=template_id,
            ticketamt=ticketamt,
            website=website,
            when_charged=when_charged,
            when_delivered=when_delivered,
            when_provided=when_provided,
            when_refunded=when_refunded,
            rep_code=rep_code,
            rep_name=rep_name,
            rep_office=rep_office,
            request_options=request_options,
        )
        return _response.data


class AsyncBoardingClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawBoardingClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> AsyncRawBoardingClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawBoardingClient
        """
        return self._raw_client

    async def add_application(
        self, *, request: AddApplicationRequest, request_options: typing.Optional[RequestOptions] = None
    ) -> PayabliApiResponse00Responsedatanonobject:
        """
        Creates a boarding application in an organization. This endpoint requires an application API token.

        Parameters
        ----------
        request : AddApplicationRequest

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponse00Responsedatanonobject
            Success

        Examples
        --------
        import asyncio

        from payabli import (
            ApplicationDataPayIn,
            ApplicationDataPayInBankData,
            ApplicationDataPayInContactsItem,
            ApplicationDataPayInOwnershipItem,
            ApplicationDataPayInServices,
            ApplicationDataPayInServicesAch,
            ApplicationDataPayInServicesCard,
            Asyncpayabli,
            SignerDataRequest,
        )

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.boarding.add_application(
                request=ApplicationDataPayIn(
                    services=ApplicationDataPayInServices(
                        ach=ApplicationDataPayInServicesAch(),
                        card=ApplicationDataPayInServicesCard(
                            accept_amex=True,
                            accept_discover=True,
                            accept_mastercard=True,
                            accept_visa=True,
                        ),
                    ),
                    annual_revenue=1000.0,
                    average_bill_size="500",
                    average_monthly_bill="5650",
                    avgmonthly=1000.0,
                    baddress="123 Walnut Street",
                    baddress_1="Suite 103",
                    bank_data=ApplicationDataPayInBankData(),
                    bcity="New Vegas",
                    bcountry="US",
                    binperson=60,
                    binphone=20,
                    binweb=20,
                    bstate="FL",
                    bsummary="Brick and mortar store that sells office supplies",
                    btype="Limited Liability Company",
                    bzip="33000",
                    contacts=[
                        ApplicationDataPayInContactsItem(
                            contact_email="herman@hermanscoatings.com",
                            contact_name="Herman Martinez",
                            contact_phone="3055550000",
                            contact_title="Owner",
                        )
                    ],
                    credit_limit="creditLimit",
                    dba_name="Sunshine Gutters",
                    ein="123456789",
                    faxnumber="1234567890",
                    highticketamt=1000.0,
                    legal_name="Sunshine Services, LLC",
                    license="2222222FFG",
                    licstate="CA",
                    maddress="123 Walnut Street",
                    maddress_1="STE 900",
                    mcc="7777",
                    mcity="Johnson City",
                    mcountry="US",
                    mstate="TN",
                    mzip="37615",
                    org_id=123,
                    ownership=[
                        ApplicationDataPayInOwnershipItem(
                            oaddress="33 North St",
                            ocity="Any City",
                            ocountry="US",
                            odriverstate="CA",
                            ostate="CA",
                            ownerdob="01/01/1990",
                            ownerdriver="CA6677778",
                            owneremail="test@email.com",
                            ownername="John Smith",
                            ownerpercent=100,
                            ownerphone_1="555888111",
                            ownerphone_2="555888111",
                            ownerssn="123456789",
                            ownertitle="CEO",
                            ozip="55555",
                        )
                    ],
                    phonenumber="1234567890",
                    processing_region="US",
                    recipient_email="josephray@example.com",
                    recipient_email_notification=True,
                    resumable=True,
                    signer=SignerDataRequest(
                        address="33 North St",
                        address_1="STE 900",
                        city="Bristol",
                        country="US",
                        dob="01/01/1976",
                        email="test@email.com",
                        name="John Smith",
                        phone="555888111",
                        ssn="123456789",
                        state="TN",
                        zip="55555",
                        pci_attestation=True,
                        signed_document_reference="https://example.com/signed-document.pdf",
                        attestation_date="04/20/2025",
                        sign_date="04/20/2025",
                        additional_data='{"deviceId":"499585-389fj484-3jcj8hj3","session":"fifji4-fiu443-fn4843","timeWithCompany":"6 Years"}',
                    ),
                    startdate="01/01/1990",
                    tax_fill_name="Sunshine LLC",
                    template_id=22,
                    ticketamt=1000.0,
                    website="www.example.com",
                    when_charged="When Service Provided",
                    when_delivered="Over 30 Days",
                    when_provided="30 Days or Less",
                    when_refunded="30 Days or Less",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.add_application(request=request, request_options=request_options)
        return _response.data

    async def delete_application(
        self, app_id: int, *, request_options: typing.Optional[RequestOptions] = None
    ) -> PayabliApiResponse00Responsedatanonobject:
        """
        Deletes a boarding application by ID.

        Parameters
        ----------
        app_id : int
            Boarding application ID.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponse00Responsedatanonobject
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.boarding.delete_application(
                app_id=352,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.delete_application(app_id, request_options=request_options)
        return _response.data

    async def get_application(
        self, app_id: int, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ApplicationDetailsRecord:
        """
        Retrieves the details for a boarding application by ID.

        Parameters
        ----------
        app_id : int
            Boarding application ID.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ApplicationDetailsRecord
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.boarding.get_application(
                app_id=352,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_application(app_id, request_options=request_options)
        return _response.data

    async def get_application_by_auth(
        self,
        x_id: str,
        *,
        email: typing.Optional[Email] = OMIT,
        reference_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ApplicationQueryRecord:
        """
        Gets a boarding application by authentication information. This endpoint requires an `application` API token.

        Parameters
        ----------
        x_id : str
            The application ID in Hex format. Find this at the end of the boarding link URL returned in a call to api/Boarding/applink/{appId}/{mail2}. For example in:  `https://boarding-sandbox.payabli.com/boarding/externalapp/load/17E`, the xId is `17E`.

        email : typing.Optional[Email]
            The email address the applicant used to save the application.

        reference_id : typing.Optional[str]
            The referenceId is sent to the applicant via email when they save the application.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ApplicationQueryRecord
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.boarding.get_application_by_auth(
                x_id="17E",
                email="admin@email.com",
                reference_id="n6UCd1f1ygG7",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_application_by_auth(
            x_id, email=email, reference_id=reference_id, request_options=request_options
        )
        return _response.data

    async def get_by_id_link_application(
        self, boarding_link_id: int, *, request_options: typing.Optional[RequestOptions] = None
    ) -> BoardingLinkQueryRecord:
        """
        Retrieves details for a boarding link, by ID.

        Parameters
        ----------
        boarding_link_id : int
            The boarding link ID. You can find this at the end of the boarding link reference name. For example `https://boarding.payabli.com/boarding/app/myorgaccountname-00091`. The ID is `91`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        BoardingLinkQueryRecord
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.boarding.get_by_id_link_application(
                boarding_link_id=91,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_by_id_link_application(boarding_link_id, request_options=request_options)
        return _response.data

    async def get_by_template_id_link_application(
        self, template_id: float, *, request_options: typing.Optional[RequestOptions] = None
    ) -> BoardingLinkQueryRecord:
        """
        Get details for a boarding link using the boarding template ID. This endpoint requires an application API token.

        Parameters
        ----------
        template_id : float
            The boarding template ID. You can find this at the end of the boarding template URL in PartnerHub. Example: `https://partner-sandbox.payabli.com/myorganization/boarding/edittemplate/80`. Here, the template ID is `80`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        BoardingLinkQueryRecord
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.boarding.get_by_template_id_link_application(
                template_id=80.0,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_by_template_id_link_application(
            template_id, request_options=request_options
        )
        return _response.data

    async def get_external_application(
        self,
        app_id: int,
        mail_2: str,
        *,
        send_email: typing.Optional[bool] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PayabliApiResponse00:
        """
        Retrieves a link and the verification code used to log into an existing boarding application. You can also use this endpoint to send a link and referenceId for an existing boarding application to an email address. The recipient can use the referenceId and email address to access and edit the application.

        Parameters
        ----------
        app_id : int
            Boarding application ID.

        mail_2 : str
            Email address used to access the application. If `sendEmail` parameter is true, a link to the application is sent to this email address.

        send_email : typing.Optional[bool]
            If `true`, sends an email that includes the link to the application to the `mail2` address. Defaults to `false`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponse00
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.boarding.get_external_application(
                app_id=352,
                mail_2="mail2",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_external_application(
            app_id, mail_2, send_email=send_email, request_options=request_options
        )
        return _response.data

    async def get_link_application(
        self, boarding_link_reference: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> BoardingLinkQueryRecord:
        """
        Retrieves the details for a boarding link, by reference name. This endpoint requires an application API token.

        Parameters
        ----------
        boarding_link_reference : str
            The boarding link reference name. You can find this at the end of the boarding link URL. For example `https://boarding.payabli.com/boarding/app/myorgaccountname-00091`

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        BoardingLinkQueryRecord
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.boarding.get_link_application(
                boarding_link_reference="myorgaccountname-00091",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_link_application(
            boarding_link_reference, request_options=request_options
        )
        return _response.data

    async def list_applications(
        self,
        org_id: int,
        *,
        export_format: typing.Optional[ExportFormat] = None,
        from_record: typing.Optional[int] = None,
        limit_record: typing.Optional[int] = None,
        parameters: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None,
        sort_by: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> QueryBoardingAppsListResponse:
        """
        Returns a list of boarding applications for an organization. Use filters to limit results. Include the `exportFormat` query parameter to return the results as a file instead of a JSON response.

        Parameters
        ----------
        org_id : int
            The numeric identifier for organization, assigned by Payabli.

        export_format : typing.Optional[ExportFormat]

        from_record : typing.Optional[int]
            The number of records to skip before starting to collect the result set.

        limit_record : typing.Optional[int]
            Max number of records to return for the query. Use `0` or negative value to return all records.

        parameters : typing.Optional[typing.Dict[str, typing.Optional[str]]]
            Collection of field names, conditions, and values used to filter the query

            See [Filters and Conditions Reference](/developers/developer-guides/pay-ops-reporting-engine-overview#filters-and-conditions-reference) for help.

            List of field names accepted:
            - `createdAt` (gt, ge, lt, le, eq, ne)
            - `startDate` (gt, ge, lt, le, eq, ne)
            - `dbaname` (ct, nct)
            - `legalname` (ct, nct)
            - `ein` (ct, nct)
            - `address` (ct, nct)
            - `city` (ct, nct)
            - `state` (ct, nct)
            - `phone` (ct, nct)
            - `mcc` (ct, nct)
            - `owntype` (ct, nct)
            - `ownerName` (ct, nct)
            - `contactName` (ct, nct)
            - `status` (in, nin, eq,ne)
            - `orgParentname` (ct, nct)
            - `externalpaypointID` (ct, nct, eq, ne)
            - `repCode` (ct, nct, eq, ne)
            - `repName` (ct, nct, eq, ne)
            - `repOffice` (ct, nct, eq, ne)
            List of comparison accepted - enclosed between parentheses:
            - eq or empty => equal
            - gt => greater than
            - ge => greater or equal
            - lt => less than
            - le => less or equal
            - ne => not equal
            - ct => contains
            - nct => not contains
            - in => inside array
            - nin => not inside array

        sort_by : typing.Optional[str]
            The field name to use for sorting results. Use `desc(field_name)` to sort descending by `field_name`, and use `asc(field_name)` to sort ascending by `field_name`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        QueryBoardingAppsListResponse
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.boarding.list_applications(
                org_id=123,
                from_record=251,
                limit_record=0,
                sort_by="desc(field_name)",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_applications(
            org_id,
            export_format=export_format,
            from_record=from_record,
            limit_record=limit_record,
            parameters=parameters,
            sort_by=sort_by,
            request_options=request_options,
        )
        return _response.data

    async def list_boarding_links(
        self,
        org_id: int,
        *,
        from_record: typing.Optional[int] = None,
        limit_record: typing.Optional[int] = None,
        parameters: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None,
        sort_by: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> QueryBoardingLinksResponse:
        """
        Return a list of boarding links for an organization. Use filters to limit results.

        Parameters
        ----------
        org_id : int
            The numeric identifier for organization, assigned by Payabli.

        from_record : typing.Optional[int]
            The number of records to skip before starting to collect the result set.

        limit_record : typing.Optional[int]
            Max number of records to return for the query. Use `0` or negative value to return all records.

        parameters : typing.Optional[typing.Dict[str, typing.Optional[str]]]
            Collection of field names, conditions, and values used to filter the query

            See [Filters and Conditions Reference](/developers/developer-guides/pay-ops-reporting-engine-overview#filters-and-conditions-reference) for help.

            List of field names accepted:
            - `lastUpdated` (gt, ge, lt, le, eq, ne)
            - `templateName` (ct, nct)
            - `referenceName` (ct, nct)
            - `acceptRegister` (eq, ne)
            - `acceptAuth` (eq, ne)
            - `templateCode` (ct, nct)
            - `templateId` (eq, ne)
            - `orgParentname` (ct, nct)

            List of comparison accepted - enclosed between parentheses:
            - eq or empty => equal
            - gt => greater than
            - ge => greater or equal
            - lt => less than
            - le => less or equal
            - ne => not equal
            - ct => contains
            - nct => not contains
            - in => inside array
            - nin => not inside array

            List of parameters accepted:
            - limitRecord : max number of records for query (default="20", "0" or negative value for all)
            - fromRecord : initial record in query

            Example: templateName(ct)=hoa return all records with template title containing "hoa"

        sort_by : typing.Optional[str]
            The field name to use for sorting results. Use `desc(field_name)` to sort descending by `field_name`, and use `asc(field_name)` to sort ascending by `field_name`.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        QueryBoardingLinksResponse
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.boarding.list_boarding_links(
                org_id=123,
                from_record=251,
                limit_record=0,
                sort_by="desc(field_name)",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_boarding_links(
            org_id,
            from_record=from_record,
            limit_record=limit_record,
            parameters=parameters,
            sort_by=sort_by,
            request_options=request_options,
        )
        return _response.data

    async def update_application(
        self,
        app_id: int,
        *,
        services: typing.Optional[Services] = OMIT,
        annual_revenue: typing.Optional[Annualrevenue] = OMIT,
        attachments: typing.Optional[Attachments] = OMIT,
        avgmonthly: typing.Optional[Avgmonthly] = OMIT,
        baddress: typing.Optional[Baddress1] = OMIT,
        baddress_1: typing.Optional[Baddress2] = OMIT,
        bank_data: typing.Optional[Bank] = OMIT,
        bcity: typing.Optional[Bcity] = OMIT,
        bcountry: typing.Optional[Bcountry] = OMIT,
        binperson: typing.Optional[Binperson] = OMIT,
        binphone: typing.Optional[Binphone] = OMIT,
        binweb: typing.Optional[Binweb] = OMIT,
        bstate: typing.Optional[Bstate] = OMIT,
        bsummary: typing.Optional[Bsummary] = OMIT,
        btype: typing.Optional[OwnType] = OMIT,
        bzip: typing.Optional[Bzip] = OMIT,
        contacts: typing.Optional[ContactsField] = OMIT,
        dbaname: typing.Optional[Dbaname] = OMIT,
        ein: typing.Optional[Ein] = OMIT,
        external_paypoint_id: typing.Optional[ExternalPaypointId] = OMIT,
        faxnumber: typing.Optional[BoardingBusinessFax] = OMIT,
        highticketamt: typing.Optional[Highticketamt] = OMIT,
        legalname: typing.Optional[Legalname] = OMIT,
        license: typing.Optional[License] = OMIT,
        licstate: typing.Optional[Licensestate] = OMIT,
        maddress: typing.Optional[Maddress] = OMIT,
        maddress_1: typing.Optional[Maddress1] = OMIT,
        mcc: typing.Optional[Mcc] = OMIT,
        mcity: typing.Optional[Mcity] = OMIT,
        mcountry: typing.Optional[Mcountry] = OMIT,
        mstate: typing.Optional[Mstate] = OMIT,
        mzip: typing.Optional[Mzip] = OMIT,
        org_id: typing.Optional[Orgid] = OMIT,
        ownership: typing.Optional[Ownership] = OMIT,
        payout_average_monthly_volume: typing.Optional[PayoutAverageMonthlyVolume] = OMIT,
        payout_average_ticket_limit: typing.Optional[PayoutAverageTicketLimit] = OMIT,
        payout_credit_limit: typing.Optional[PayoutCreditLimit] = OMIT,
        payout_high_ticket_amount: typing.Optional[PayoutHighTicketAmount] = OMIT,
        phonenumber: typing.Optional[BoardingBusinessPhone] = OMIT,
        recipient_email: typing.Optional[Email] = OMIT,
        recipient_email_notification: typing.Optional[RecipientEmailNotification] = OMIT,
        resumable: typing.Optional[Resumable] = OMIT,
        signer: typing.Optional[SignerDataRequest] = OMIT,
        startdate: typing.Optional[Busstartdate] = OMIT,
        taxfillname: typing.Optional[Taxfillname] = OMIT,
        template_id: typing.Optional[TemplateId] = OMIT,
        ticketamt: typing.Optional[Ticketamt] = OMIT,
        website: typing.Optional[Website] = OMIT,
        when_charged: typing.Optional[Whencharged] = OMIT,
        when_delivered: typing.Optional[Whendelivered] = OMIT,
        when_provided: typing.Optional[Whenprovided] = OMIT,
        when_refunded: typing.Optional[Whenrefunded] = OMIT,
        rep_code: typing.Optional[RepCode] = OMIT,
        rep_name: typing.Optional[RepName] = OMIT,
        rep_office: typing.Optional[RepOffice] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PayabliApiResponse00Responsedatanonobject:
        """
        Updates a boarding application by ID. This endpoint requires an application API token.

        Parameters
        ----------
        app_id : int
            Boarding application ID.

        services : typing.Optional[Services]

        annual_revenue : typing.Optional[Annualrevenue]

        attachments : typing.Optional[Attachments]

        avgmonthly : typing.Optional[Avgmonthly]

        baddress : typing.Optional[Baddress1]

        baddress_1 : typing.Optional[Baddress2]

        bank_data : typing.Optional[Bank]

        bcity : typing.Optional[Bcity]

        bcountry : typing.Optional[Bcountry]

        binperson : typing.Optional[Binperson]

        binphone : typing.Optional[Binphone]

        binweb : typing.Optional[Binweb]

        bstate : typing.Optional[Bstate]

        bsummary : typing.Optional[Bsummary]

        btype : typing.Optional[OwnType]

        bzip : typing.Optional[Bzip]

        contacts : typing.Optional[ContactsField]

        dbaname : typing.Optional[Dbaname]

        ein : typing.Optional[Ein]

        external_paypoint_id : typing.Optional[ExternalPaypointId]

        faxnumber : typing.Optional[BoardingBusinessFax]

        highticketamt : typing.Optional[Highticketamt]

        legalname : typing.Optional[Legalname]

        license : typing.Optional[License]

        licstate : typing.Optional[Licensestate]

        maddress : typing.Optional[Maddress]

        maddress_1 : typing.Optional[Maddress1]

        mcc : typing.Optional[Mcc]

        mcity : typing.Optional[Mcity]

        mcountry : typing.Optional[Mcountry]

        mstate : typing.Optional[Mstate]

        mzip : typing.Optional[Mzip]

        org_id : typing.Optional[Orgid]

        ownership : typing.Optional[Ownership]

        payout_average_monthly_volume : typing.Optional[PayoutAverageMonthlyVolume]

        payout_average_ticket_limit : typing.Optional[PayoutAverageTicketLimit]

        payout_credit_limit : typing.Optional[PayoutCreditLimit]

        payout_high_ticket_amount : typing.Optional[PayoutHighTicketAmount]

        phonenumber : typing.Optional[BoardingBusinessPhone]

        recipient_email : typing.Optional[Email]
            Email address for the applicant. This is used to send the applicant a boarding link.

        recipient_email_notification : typing.Optional[RecipientEmailNotification]

        resumable : typing.Optional[Resumable]

        signer : typing.Optional[SignerDataRequest]

        startdate : typing.Optional[Busstartdate]

        taxfillname : typing.Optional[Taxfillname]

        template_id : typing.Optional[TemplateId]

        ticketamt : typing.Optional[Ticketamt]

        website : typing.Optional[Website]

        when_charged : typing.Optional[Whencharged]

        when_delivered : typing.Optional[Whendelivered]

        when_provided : typing.Optional[Whenprovided]

        when_refunded : typing.Optional[Whenrefunded]

        rep_code : typing.Optional[RepCode]

        rep_name : typing.Optional[RepName]

        rep_office : typing.Optional[RepOffice]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponse00Responsedatanonobject
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.boarding.update_application(
                app_id=352,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_application(
            app_id,
            services=services,
            annual_revenue=annual_revenue,
            attachments=attachments,
            avgmonthly=avgmonthly,
            baddress=baddress,
            baddress_1=baddress_1,
            bank_data=bank_data,
            bcity=bcity,
            bcountry=bcountry,
            binperson=binperson,
            binphone=binphone,
            binweb=binweb,
            bstate=bstate,
            bsummary=bsummary,
            btype=btype,
            bzip=bzip,
            contacts=contacts,
            dbaname=dbaname,
            ein=ein,
            external_paypoint_id=external_paypoint_id,
            faxnumber=faxnumber,
            highticketamt=highticketamt,
            legalname=legalname,
            license=license,
            licstate=licstate,
            maddress=maddress,
            maddress_1=maddress_1,
            mcc=mcc,
            mcity=mcity,
            mcountry=mcountry,
            mstate=mstate,
            mzip=mzip,
            org_id=org_id,
            ownership=ownership,
            payout_average_monthly_volume=payout_average_monthly_volume,
            payout_average_ticket_limit=payout_average_ticket_limit,
            payout_credit_limit=payout_credit_limit,
            payout_high_ticket_amount=payout_high_ticket_amount,
            phonenumber=phonenumber,
            recipient_email=recipient_email,
            recipient_email_notification=recipient_email_notification,
            resumable=resumable,
            signer=signer,
            startdate=startdate,
            taxfillname=taxfillname,
            template_id=template_id,
            ticketamt=ticketamt,
            website=website,
            when_charged=when_charged,
            when_delivered=when_delivered,
            when_provided=when_provided,
            when_refunded=when_refunded,
            rep_code=rep_code,
            rep_name=rep_name,
            rep_office=rep_office,
            request_options=request_options,
        )
        return _response.data
