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

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


class LoyaltyAccountMapping(UncheckedBaseModel):
    """
    Represents the mapping that associates a loyalty account with a buyer.

    Currently, a loyalty account can only be mapped to a buyer by phone number. For more information, see
    [Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview).
    """

    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The Square-assigned ID of the mapping.
    """

    created_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp when the mapping was created, in RFC 3339 format.
    """

    phone_number: typing.Optional[str] = pydantic.Field(default=None)
    """
    The phone number of the buyer, in E.164 format. For example, "+14155551111".
    """

    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
