# This file was auto-generated by Fern from our API Definition.

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .address import Address
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class FulfillmentRecipient(UncheckedBaseModel):
    """
    Information about the fulfillment recipient.
    """

    customer_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the customer associated with the fulfillment.
    
    If `customer_id` is provided, the fulfillment recipient's `display_name`,
    `email_address`, and `phone_number` are automatically populated from the
    targeted customer profile. If these fields are set in the request, the request
    values override the information from the customer profile. If the
    targeted customer profile does not contain the necessary information and
    these fields are left unset, the request results in an error.
    """

    display_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The display name of the fulfillment recipient. This field is required.
    
    If provided, the display name overrides the corresponding customer profile value
    indicated by `customer_id`.
    """

    email_address: typing.Optional[str] = pydantic.Field(default=None)
    """
    The email address of the fulfillment recipient.
    
    If provided, the email address overrides the corresponding customer profile value
    indicated by `customer_id`.
    """

    phone_number: typing.Optional[str] = pydantic.Field(default=None)
    """
    The phone number of the fulfillment recipient. This field is required.
    
    If provided, the phone number overrides the corresponding customer profile value
    indicated by `customer_id`.
    """

    address: typing.Optional[Address] = pydantic.Field(default=None)
    """
    The address of the fulfillment recipient. This field is required.
    
    If provided, the address overrides the corresponding customer profile value
    indicated by `customer_id`.
    """

    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
