# 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 .invoice_recipient_tax_ids import InvoiceRecipientTaxIds
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class InvoiceRecipient(UncheckedBaseModel):
    """
    Represents a snapshot of customer data. This object stores customer data that is displayed on the invoice
    and that Square uses to deliver the invoice.

    When you provide a customer ID for a draft invoice, Square retrieves the associated customer profile and populates
    the remaining `InvoiceRecipient` fields. You cannot update these fields after the invoice is published.
    Square updates the customer ID in response to a merge operation, but does not update other fields.
    """

    customer_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the customer. This is the customer profile ID that 
    you provide when creating a draft invoice.
    """

    given_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The recipient's given (that is, first) name.
    """

    family_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The recipient's family (that is, last) name.
    """

    email_address: typing.Optional[str] = pydantic.Field(default=None)
    """
    The recipient's email address.
    """

    address: typing.Optional[Address] = pydantic.Field(default=None)
    """
    The recipient's physical address.
    """

    phone_number: typing.Optional[str] = pydantic.Field(default=None)
    """
    The recipient's phone number.
    """

    company_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the recipient's company.
    """

    tax_ids: typing.Optional[InvoiceRecipientTaxIds] = pydantic.Field(default=None)
    """
    The recipient's tax IDs. The country of the seller account determines whether this field 
    is available for the customer. For more information, see [Invoice recipient tax IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids).
    """

    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
