# 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 .achaccount import Achaccount
from .achrouting import Achrouting
from .billing_address_nullable import BillingAddressNullable
from .billing_city_nullable import BillingCityNullable
from .billing_country_nullable import BillingCountryNullable
from .billing_state_nullable import BillingStateNullable
from .billing_zip import BillingZip


class Instrument(UniversalBaseModel):
    ach_account: typing_extensions.Annotated[Achaccount, FieldMetadata(alias="achAccount")]
    ach_routing: typing_extensions.Annotated[Achrouting, FieldMetadata(alias="achRouting")]
    billing_address: typing_extensions.Annotated[
        typing.Optional[BillingAddressNullable], FieldMetadata(alias="billingAddress")
    ] = None
    billing_city: typing_extensions.Annotated[
        typing.Optional[BillingCityNullable], FieldMetadata(alias="billingCity")
    ] = None
    billing_country: typing_extensions.Annotated[
        typing.Optional[BillingCountryNullable], FieldMetadata(alias="billingCountry")
    ] = None
    billing_state: typing_extensions.Annotated[
        typing.Optional[BillingStateNullable], FieldMetadata(alias="billingState")
    ] = None
    billing_zip: typing_extensions.Annotated[typing.Optional[BillingZip], FieldMetadata(alias="billingZip")] = 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
