# 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 import AdditionalData
from .address_addtl_nullable import AddressAddtlNullable
from .address_nullable import AddressNullable
from .billing_data import BillingData
from .contacts_field import ContactsField
from .email import Email
from .location_code import LocationCode
from .mcc import Mcc
from .payee_name import PayeeName
from .remitaddress_1 import Remitaddress1
from .remitaddress_2 import Remitaddress2
from .remitcity import Remitcity
from .remitcountry import Remitcountry
from .remitstate import Remitstate
from .remitzip import Remitzip
from .vendor_number import VendorNumber
from .vendor_payment_method import VendorPaymentMethod
from .vendorid import Vendorid
from .vendorstatus import Vendorstatus


class VendorOutData(UniversalBaseModel):
    additional_data: typing_extensions.Annotated[
        typing.Optional[AdditionalData], FieldMetadata(alias="additionalData"), pydantic.Field(alias="additionalData")
    ] = None
    address_1: typing_extensions.Annotated[
        typing.Optional[AddressNullable],
        FieldMetadata(alias="Address1"),
        pydantic.Field(alias="Address1", description="Vendor's address"),
    ] = None
    address_2: typing_extensions.Annotated[
        typing.Optional[AddressAddtlNullable],
        FieldMetadata(alias="Address2"),
        pydantic.Field(alias="Address2", description="Additional line for vendor's address."),
    ] = None
    billing_data: typing_extensions.Annotated[
        typing.Optional[BillingData],
        FieldMetadata(alias="BillingData"),
        pydantic.Field(alias="BillingData", description="Object containing vendor's bank information."),
    ] = None
    city: typing_extensions.Annotated[
        str, FieldMetadata(alias="City"), pydantic.Field(alias="City", description="Vendor's city.")
    ]
    contacts: typing_extensions.Annotated[
        typing.Optional[ContactsField],
        FieldMetadata(alias="Contacts"),
        pydantic.Field(alias="Contacts", description="Array of objects describing the vendor's contacts."),
    ] = None
    country: typing_extensions.Annotated[
        str, FieldMetadata(alias="Country"), pydantic.Field(alias="Country", description="Vendor's country.")
    ]
    customer_vendor_account: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="customerVendorAccount"),
        pydantic.Field(alias="customerVendorAccount", description="Account number of paypoint in the vendor side."),
    ] = None
    ein: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="EIN"),
        pydantic.Field(
            alias="EIN",
            description="EIN/Tax ID for vendor. In reponses, this field is masked, and looks like: `XXXXX6789`.",
        ),
    ]
    email: typing_extensions.Annotated[
        typing.Optional[Email],
        FieldMetadata(alias="Email"),
        pydantic.Field(alias="Email", description="Vendor's email address. Required for vCard."),
    ] = None
    internal_reference_id: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="InternalReferenceId"),
        pydantic.Field(alias="InternalReferenceId", description="Internal identifier for global vendor account."),
    ] = None
    location_code: typing_extensions.Annotated[
        typing.Optional[LocationCode], FieldMetadata(alias="LocationCode"), pydantic.Field(alias="LocationCode")
    ] = None
    mcc: typing_extensions.Annotated[typing.Optional[Mcc], FieldMetadata(alias="Mcc"), pydantic.Field(alias="Mcc")] = (
        None
    )
    name_1: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="Name1"),
        pydantic.Field(alias="Name1", description="Primary name for vendor. Required for new vendor."),
    ]
    name_2: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="Name2"),
        pydantic.Field(alias="Name2", description="Secondary name for vendor."),
    ] = None
    payee_name_1: typing_extensions.Annotated[
        typing.Optional[PayeeName], FieldMetadata(alias="payeeName1"), pydantic.Field(alias="payeeName1")
    ] = None
    payee_name_2: typing_extensions.Annotated[
        typing.Optional[PayeeName], FieldMetadata(alias="payeeName2"), pydantic.Field(alias="payeeName2")
    ] = None
    payment_method: typing_extensions.Annotated[
        typing.Optional[VendorPaymentMethod],
        FieldMetadata(alias="PaymentMethod"),
        pydantic.Field(alias="PaymentMethod"),
    ] = None
    phone: typing_extensions.Annotated[
        str, FieldMetadata(alias="Phone"), pydantic.Field(alias="Phone", description="Vendor's phone number")
    ]
    remit_address_1: typing_extensions.Annotated[
        typing.Optional[Remitaddress1], FieldMetadata(alias="remitAddress1"), pydantic.Field(alias="remitAddress1")
    ] = None
    remit_address_2: typing_extensions.Annotated[
        typing.Optional[Remitaddress2], FieldMetadata(alias="remitAddress2"), pydantic.Field(alias="remitAddress2")
    ] = None
    remit_city: typing_extensions.Annotated[
        typing.Optional[Remitcity], FieldMetadata(alias="remitCity"), pydantic.Field(alias="remitCity")
    ] = None
    remit_country: typing_extensions.Annotated[
        typing.Optional[Remitcountry], FieldMetadata(alias="remitCountry"), pydantic.Field(alias="remitCountry")
    ] = None
    remit_state: typing_extensions.Annotated[
        typing.Optional[Remitstate], FieldMetadata(alias="remitState"), pydantic.Field(alias="remitState")
    ] = None
    remit_zip: typing_extensions.Annotated[
        typing.Optional[Remitzip], FieldMetadata(alias="remitZip"), pydantic.Field(alias="remitZip")
    ] = None
    state: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="State"),
        pydantic.Field(alias="State", description="Vendor's state. Must be a 2 character state code."),
    ]
    vendor_id: typing_extensions.Annotated[
        typing.Optional[Vendorid],
        FieldMetadata(alias="VendorId"),
        pydantic.Field(
            alias="VendorId",
            description="Payabli identifier for vendor record. Required when `VendorNumber` isn't included.",
        ),
    ] = None
    vendor_number: typing_extensions.Annotated[
        typing.Optional[VendorNumber], FieldMetadata(alias="VendorNumber"), pydantic.Field(alias="VendorNumber")
    ] = None
    vendor_status: typing_extensions.Annotated[
        typing.Optional[Vendorstatus], FieldMetadata(alias="VendorStatus"), pydantic.Field(alias="VendorStatus")
    ] = None
    zip: typing_extensions.Annotated[
        str, FieldMetadata(alias="Zip"), pydantic.Field(alias="Zip", description="Vendor's zip code.")
    ]

    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
