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

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


class RetrieveTokenStatusResponse(UncheckedBaseModel):
    """
    Defines the fields that are included in the response body of
    a request to the `RetrieveTokenStatus` endpoint.
    """

    scopes: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    The list of scopes associated with an access token.
    """

    expires_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The date and time when the `access_token` expires, in RFC 3339 format. Empty if the token never expires.
    """

    client_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The Square-issued application ID associated with the access token. This is the same application ID used to obtain the token.
    """

    merchant_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the authorizing merchant's business.
    """

    errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None)
    """
     Any errors that occurred during the request.
    """

    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
