# 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 .bank_account_holder_name import BankAccountHolderName
from .bank_account_holder_type import BankAccountHolderType
from .bank_name import BankName
from .routing_account import RoutingAccount
from .type_account import TypeAccount


class BillingData(UniversalBaseModel):
    account_number: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="accountNumber")] = (
        pydantic.Field(default=None)
    )
    """
    Account number for bank account.
    """

    bank_account_function: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="bankAccountFunction")
    ] = pydantic.Field(default=None)
    """
    Describes whether the bank account is used for deposits or withdrawals in Payabli:
      - `0`: Deposit
      - `1`: Withdrawal 
      - `2`: Deposit and withdrawal
    """

    bank_account_holder_name: typing_extensions.Annotated[
        typing.Optional[BankAccountHolderName], FieldMetadata(alias="bankAccountHolderName")
    ] = None
    bank_account_holder_type: typing_extensions.Annotated[
        typing.Optional[BankAccountHolderType], FieldMetadata(alias="bankAccountHolderType")
    ] = None
    bank_name: typing_extensions.Annotated[typing.Optional[BankName], FieldMetadata(alias="bankName")] = None
    id: typing.Optional[int] = pydantic.Field(default=None)
    """
    The bank's ID in Payabli.
    """

    routing_account: typing_extensions.Annotated[
        typing.Optional[RoutingAccount], FieldMetadata(alias="routingAccount")
    ] = None
    type_account: typing_extensions.Annotated[typing.Optional[TypeAccount], FieldMetadata(alias="typeAccount")] = 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
