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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .additional_data_string import AdditionalDataString
from .annualrevenue import Annualrevenue
from .app_id import AppId
from .application_details_record_messages_item import ApplicationDetailsRecordMessagesItem
from .avgmonthly import Avgmonthly
from .baddress_1 import Baddress1
from .baddress_2 import Baddress2
from .bank_data import BankData
from .bcity import Bcity
from .bcountry import Bcountry
from .binperson import Binperson
from .binphone import Binphone
from .binweb import Binweb
from .boarding_application_attachments import BoardingApplicationAttachments
from .boarding_link_id import BoardingLinkId
from .boarding_status import BoardingStatus
from .bphone import Bphone
from .bstate import Bstate
from .bsummary import Bsummary
from .builder_data import BuilderData
from .busstartdate import Busstartdate
from .bzip import Bzip
from .contacts_field import ContactsField
from .created_at import CreatedAt
from .dbaname import Dbaname
from .ein import Ein
from .external_paypoint_id import ExternalPaypointId
from .file_content import FileContent
from .general_events import GeneralEvents
from .highticketamt import Highticketamt
from .last_modified import LastModified
from .legalname import Legalname
from .license import License
from .licensestate import Licensestate
from .maddress import Maddress
from .maddress_1 import Maddress1
from .mcountry import Mcountry
from .mstate import Mstate
from .mzip import Mzip
from .org_parent_name import OrgParentName
from .orgid import Orgid
from .own_type import OwnType
from .ownership import Ownership
from .page_identifier import PageIdentifier
from .recipient_email_notification import RecipientEmailNotification
from .resumable import Resumable
from .sales_code import SalesCode
from .services import Services
from .signer_data import SignerData
from .taxfillname import Taxfillname
from .template_id import TemplateId
from .ticketamt import Ticketamt
from .website import Website
from .whencharged import Whencharged
from .whendelivered import Whendelivered
from .whenprovided import Whenprovided
from .whenrefunded import Whenrefunded


class ApplicationDetailsRecord(UniversalBaseModel):
    annual_revenue: typing_extensions.Annotated[
        typing.Optional[Annualrevenue], FieldMetadata(alias="annualRevenue")
    ] = None
    average_monthly_volume: typing_extensions.Annotated[
        typing.Optional[Avgmonthly], FieldMetadata(alias="averageMonthlyVolume")
    ] = None
    average_ticket_amount: typing_extensions.Annotated[
        typing.Optional[Ticketamt], FieldMetadata(alias="averageTicketAmount")
    ] = None
    b_address_1: typing_extensions.Annotated[typing.Optional[Baddress1], FieldMetadata(alias="bAddress1")] = None
    b_address_2: typing_extensions.Annotated[typing.Optional[Baddress2], FieldMetadata(alias="bAddress2")] = None
    bank_data: typing_extensions.Annotated[typing.Optional[BankData], FieldMetadata(alias="bankData")] = None
    b_city: typing_extensions.Annotated[typing.Optional[Bcity], FieldMetadata(alias="bCity")] = None
    b_country: typing_extensions.Annotated[typing.Optional[Bcountry], FieldMetadata(alias="bCountry")] = None
    b_fax: typing_extensions.Annotated[typing.Optional[Bphone], FieldMetadata(alias="bFax")] = pydantic.Field(
        default=None
    )
    """
    The business's fax number.
    """

    bin_person: typing_extensions.Annotated[typing.Optional[Binperson], FieldMetadata(alias="binPerson")] = None
    bin_phone: typing_extensions.Annotated[typing.Optional[Binphone], FieldMetadata(alias="binPhone")] = None
    bin_web: typing_extensions.Annotated[typing.Optional[Binweb], FieldMetadata(alias="binWeb")] = None
    boarding_link_id: typing_extensions.Annotated[
        typing.Optional[BoardingLinkId], FieldMetadata(alias="boardingLinkId")
    ] = None
    boarding_status: typing_extensions.Annotated[
        typing.Optional[BoardingStatus], FieldMetadata(alias="boardingStatus")
    ] = None
    boarding_sub_status: typing_extensions.Annotated[
        typing.Optional[BoardingStatus], FieldMetadata(alias="boardingSubStatus")
    ] = None
    b_phone: typing_extensions.Annotated[typing.Optional[Bphone], FieldMetadata(alias="bPhone")] = None
    b_startdate: typing_extensions.Annotated[typing.Optional[Busstartdate], FieldMetadata(alias="bStartdate")] = None
    b_state: typing_extensions.Annotated[typing.Optional[Bstate], FieldMetadata(alias="bState")] = None
    b_summary: typing_extensions.Annotated[typing.Optional[Bsummary], FieldMetadata(alias="bSummary")] = None
    builder_data: typing_extensions.Annotated[typing.Optional[BuilderData], FieldMetadata(alias="builderData")] = None
    b_zip: typing_extensions.Annotated[typing.Optional[Bzip], FieldMetadata(alias="bZip")] = None
    contact_data: typing_extensions.Annotated[typing.Optional[ContactsField], FieldMetadata(alias="contactData")] = None
    created_at: typing_extensions.Annotated[typing.Optional[CreatedAt], FieldMetadata(alias="createdAt")] = None
    dba_name: typing_extensions.Annotated[typing.Optional[Dbaname], FieldMetadata(alias="dbaName")] = None
    documents_ref: typing_extensions.Annotated[
        typing.Optional[BoardingApplicationAttachments], FieldMetadata(alias="documentsRef")
    ] = None
    ein: typing.Optional[Ein] = None
    external_paypoint_id: typing_extensions.Annotated[
        typing.Optional[ExternalPaypointId], FieldMetadata(alias="externalPaypointId")
    ] = None
    general_events: typing_extensions.Annotated[
        typing.Optional[typing.List[GeneralEvents]], FieldMetadata(alias="generalEvents")
    ] = pydantic.Field(default=None)
    """
    Events associated with the application.
    """

    high_ticket_amount: typing_extensions.Annotated[
        typing.Optional[Highticketamt], FieldMetadata(alias="highTicketAmount")
    ] = None
    id_application: typing_extensions.Annotated[typing.Optional[AppId], FieldMetadata(alias="idApplication")] = None
    last_modified: typing_extensions.Annotated[typing.Optional[LastModified], FieldMetadata(alias="lastModified")] = (
        None
    )
    legal_name: typing_extensions.Annotated[typing.Optional[Legalname], FieldMetadata(alias="legalName")] = None
    license: typing.Optional[License] = None
    license_state: typing_extensions.Annotated[typing.Optional[Licensestate], FieldMetadata(alias="licenseState")] = (
        None
    )
    logo: typing.Optional[FileContent] = pydantic.Field(default=None)
    """
    Object containing logo file.
    """

    m_address_1: typing_extensions.Annotated[typing.Optional[Maddress], FieldMetadata(alias="mAddress1")] = None
    m_address_2: typing_extensions.Annotated[typing.Optional[Maddress1], FieldMetadata(alias="mAddress2")] = None
    mccid: typing.Optional[str] = None
    m_city: typing_extensions.Annotated[typing.Optional[Mstate], FieldMetadata(alias="mCity")] = None
    m_country: typing_extensions.Annotated[typing.Optional[Mcountry], FieldMetadata(alias="mCountry")] = None
    messages: typing.Optional[typing.List[ApplicationDetailsRecordMessagesItem]] = None
    m_state: typing_extensions.Annotated[typing.Optional[Mstate], FieldMetadata(alias="mState")] = None
    m_zip: typing_extensions.Annotated[typing.Optional[Mzip], FieldMetadata(alias="mZip")] = None
    org_id: typing_extensions.Annotated[typing.Optional[Orgid], FieldMetadata(alias="orgId")] = None
    org_parent_name: typing_extensions.Annotated[
        typing.Optional[OrgParentName], FieldMetadata(alias="orgParentName")
    ] = None
    owner_data: typing_extensions.Annotated[typing.Optional[Ownership], FieldMetadata(alias="ownerData")] = None
    own_type: typing_extensions.Annotated[typing.Optional[OwnType], FieldMetadata(alias="ownType")] = None
    pageidentifier: typing.Optional[PageIdentifier] = None
    recipient_email_notification: typing_extensions.Annotated[
        typing.Optional[RecipientEmailNotification], FieldMetadata(alias="recipientEmailNotification")
    ] = None
    resumable: typing.Optional[Resumable] = None
    sales_code: typing_extensions.Annotated[typing.Optional[SalesCode], FieldMetadata(alias="salesCode")] = None
    service_data: typing_extensions.Annotated[typing.Optional[Services], FieldMetadata(alias="serviceData")] = None
    signer: typing.Optional[SignerData] = None
    taxfillname: typing.Optional[Taxfillname] = None
    template_id: typing_extensions.Annotated[typing.Optional[TemplateId], FieldMetadata(alias="templateId")] = None
    website_address: typing_extensions.Annotated[typing.Optional[Website], FieldMetadata(alias="websiteAddress")] = None
    whencharged: typing.Optional[Whencharged] = None
    whendelivered: typing.Optional[Whendelivered] = None
    when_provided: typing_extensions.Annotated[typing.Optional[Whenprovided], FieldMetadata(alias="whenProvided")] = (
        None
    )
    whenrefund: typing.Optional[Whenrefunded] = None
    additional_data: typing_extensions.Annotated[
        typing.Optional[AdditionalDataString], FieldMetadata(alias="additionalData")
    ] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
