# 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 .vendor_contact import VendorContact
from .vendor_status import VendorStatus
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Vendor(UncheckedBaseModel):
    """
    Represents a supplier to a seller.
    """

    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    A unique Square-generated ID for the [Vendor](entity:Vendor).
    This field is required when attempting to update a [Vendor](entity:Vendor).
    """

    created_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    An RFC 3339-formatted timestamp that indicates when the
    [Vendor](entity:Vendor) was created.
    """

    updated_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    An RFC 3339-formatted timestamp that indicates when the
    [Vendor](entity:Vendor) was last updated.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the [Vendor](entity:Vendor).
    This field is required when attempting to create or update a [Vendor](entity:Vendor).
    """

    address: typing.Optional[Address] = pydantic.Field(default=None)
    """
    The address of the [Vendor](entity:Vendor).
    """

    contacts: typing.Optional[typing.List[VendorContact]] = pydantic.Field(default=None)
    """
    The contacts of the [Vendor](entity:Vendor).
    """

    account_number: typing.Optional[str] = pydantic.Field(default=None)
    """
    The account number of the [Vendor](entity:Vendor).
    """

    note: typing.Optional[str] = pydantic.Field(default=None)
    """
    A note detailing information about the [Vendor](entity:Vendor).
    """

    version: typing.Optional[int] = pydantic.Field(default=None)
    """
    The version of the [Vendor](entity:Vendor).
    """

    status: typing.Optional[VendorStatus] = pydantic.Field(default=None)
    """
    The status of the [Vendor](entity:Vendor).
    See [Status](#type-status) for possible values
    """

    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
