# 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 .remit_email import RemitEmail
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_ein import VendorEin
from .vendor_name_1 import VendorName1
from .vendor_name_2 import VendorName2
from .vendor_number import VendorNumber
from .vendor_payment_method_string import VendorPaymentMethodString
from .vendor_phone import VendorPhone
from .vendorstatus import Vendorstatus


class VendorData(UniversalBaseModel):
    vendor_number: typing_extensions.Annotated[typing.Optional[VendorNumber], FieldMetadata(alias="vendorNumber")] = (
        None
    )
    additional_data: typing_extensions.Annotated[
        typing.Optional[AdditionalData], FieldMetadata(alias="AdditionalData")
    ] = None
    address_1: typing_extensions.Annotated[typing.Optional[AddressNullable], FieldMetadata(alias="address1")] = (
        pydantic.Field(default=None)
    )
    """
    Vendor's address
    """

    address_2: typing_extensions.Annotated[typing.Optional[AddressAddtlNullable], FieldMetadata(alias="address2")] = (
        pydantic.Field(default=None)
    )
    """
    Additional line for vendor's address.
    """

    billing_data: typing_extensions.Annotated[typing.Optional[BillingData], FieldMetadata(alias="billingData")] = (
        pydantic.Field(default=None)
    )
    """
    Object containing vendor's bank information.
    """

    city: typing.Optional[str] = pydantic.Field(default=None)
    """
    Vendor's city.
    """

    contacts: typing.Optional[ContactsField] = pydantic.Field(default=None)
    """
    Array of objects describing the vendor's contacts.
    """

    country: typing.Optional[str] = pydantic.Field(default=None)
    """
    Vendor's country.
    """

    custom_field_1: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customField1")] = (
        pydantic.Field(default=None)
    )
    """
    Custom field 1 for vendor
    """

    custom_field_2: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customField2")] = (
        pydantic.Field(default=None)
    )
    """
    Custom field 2 for vendor
    """

    customer_vendor_account: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="customerVendorAccount")
    ] = pydantic.Field(default=None)
    """
    Account number of paypoint in the vendor side.
    """

    ein: typing.Optional[VendorEin] = None
    email: typing.Optional[Email] = pydantic.Field(default=None)
    """
    Vendor's email address. Required for vCard.
    """

    internal_reference_id: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="internalReferenceId")
    ] = pydantic.Field(default=None)
    """
    Internal identifier for global vendor account.
    """

    location_code: typing_extensions.Annotated[typing.Optional[LocationCode], FieldMetadata(alias="locationCode")] = (
        None
    )
    mcc: typing.Optional[Mcc] = None
    name_1: typing_extensions.Annotated[typing.Optional[VendorName1], FieldMetadata(alias="name1")] = None
    name_2: typing_extensions.Annotated[typing.Optional[VendorName2], FieldMetadata(alias="name2")] = None
    payee_name_1: typing_extensions.Annotated[typing.Optional[PayeeName], FieldMetadata(alias="payeeName1")] = None
    payee_name_2: typing_extensions.Annotated[typing.Optional[PayeeName], FieldMetadata(alias="payeeName2")] = None
    payment_method: typing_extensions.Annotated[
        typing.Optional[VendorPaymentMethodString], FieldMetadata(alias="paymentMethod")
    ] = None
    phone: typing.Optional[VendorPhone] = None
    remit_address_1: typing_extensions.Annotated[
        typing.Optional[Remitaddress1], FieldMetadata(alias="remitAddress1")
    ] = None
    remit_address_2: typing_extensions.Annotated[
        typing.Optional[Remitaddress2], FieldMetadata(alias="remitAddress2")
    ] = None
    remit_city: typing_extensions.Annotated[typing.Optional[Remitcity], FieldMetadata(alias="remitCity")] = None
    remit_country: typing_extensions.Annotated[typing.Optional[Remitcountry], FieldMetadata(alias="remitCountry")] = (
        None
    )
    remit_email: typing_extensions.Annotated[typing.Optional[RemitEmail], FieldMetadata(alias="remitEmail")] = None
    remit_state: typing_extensions.Annotated[typing.Optional[Remitstate], FieldMetadata(alias="remitState")] = None
    remit_zip: typing_extensions.Annotated[typing.Optional[Remitzip], FieldMetadata(alias="remitZip")] = None
    state: typing.Optional[str] = pydantic.Field(default=None)
    """
    Vendor's state. Must be a 2 character state code.
    """

    vendor_status: typing_extensions.Annotated[typing.Optional[Vendorstatus], FieldMetadata(alias="vendorStatus")] = (
        None
    )
    zip: typing.Optional[str] = pydantic.Field(default=None)
    """
    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
