# 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 .billing_address_addtl_nullable import BillingAddressAddtlNullable
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
from .customer_id import CustomerId
from .customer_number_nullable import CustomerNumberNullable
from .email import Email
from .identifierfields import Identifierfields
from .phone_number import PhoneNumber
from .shippingaddress import Shippingaddress
from .shippingaddressadditional import Shippingaddressadditional
from .shippingcity import Shippingcity
from .shippingcountry import Shippingcountry
from .shippingstate import Shippingstate
from .shippingzip import Shippingzip


class PayorDataRequest(UniversalBaseModel):
    """
    Customer information. May be required, depending on the paypoint's settings. Required for subscriptions.
    """

    additional_data: typing_extensions.Annotated[
        typing.Optional[AdditionalData], FieldMetadata(alias="additionalData")
    ] = None
    billing_address_1: typing_extensions.Annotated[
        typing.Optional[BillingAddressNullable], FieldMetadata(alias="billingAddress1")
    ] = None
    billing_address_2: typing_extensions.Annotated[
        typing.Optional[BillingAddressAddtlNullable], FieldMetadata(alias="billingAddress2")
    ] = 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_email: typing_extensions.Annotated[typing.Optional[Email], FieldMetadata(alias="billingEmail")] = None
    billing_phone: typing_extensions.Annotated[typing.Optional[PhoneNumber], FieldMetadata(alias="billingPhone")] = None
    billing_state: typing_extensions.Annotated[
        typing.Optional[BillingStateNullable], FieldMetadata(alias="billingState")
    ] = None
    billing_zip: typing_extensions.Annotated[typing.Optional[BillingZip], FieldMetadata(alias="billingZip")] = (
        pydantic.Field(default=None)
    )
    """
    Customer's billing ZIP code. For Pay In functions, this field supports 5-digit and 9-digit ZIP codes and alphanumeric Canadian postal codes. For example: "37615-1234" or "37615".
    """

    company: typing.Optional[str] = pydantic.Field(default=None)
    """
    Customer's company name.
    """

    customer_id: typing_extensions.Annotated[typing.Optional[CustomerId], FieldMetadata(alias="customerId")] = None
    customer_number: typing_extensions.Annotated[
        typing.Optional[CustomerNumberNullable], FieldMetadata(alias="customerNumber")
    ] = None
    first_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="firstName")] = pydantic.Field(
        default=None
    )
    """
    Customer/Payor first name.
    """

    identifier_fields: typing_extensions.Annotated[
        typing.Optional[Identifierfields], FieldMetadata(alias="identifierFields")
    ] = None
    last_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="lastName")] = pydantic.Field(
        default=None
    )
    """
    Customer/Payor last name.
    """

    shipping_address_1: typing_extensions.Annotated[
        typing.Optional[Shippingaddress], FieldMetadata(alias="shippingAddress1")
    ] = None
    shipping_address_2: typing_extensions.Annotated[
        typing.Optional[Shippingaddressadditional], FieldMetadata(alias="shippingAddress2")
    ] = None
    shipping_city: typing_extensions.Annotated[typing.Optional[Shippingcity], FieldMetadata(alias="shippingCity")] = (
        None
    )
    shipping_country: typing_extensions.Annotated[
        typing.Optional[Shippingcountry], FieldMetadata(alias="shippingCountry")
    ] = None
    shipping_state: typing_extensions.Annotated[
        typing.Optional[Shippingstate], FieldMetadata(alias="shippingState")
    ] = None
    shipping_zip: typing_extensions.Annotated[typing.Optional[Shippingzip], FieldMetadata(alias="shippingZip")] = 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
