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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class TokenResponse(UniversalBaseModel):
    """
    Response containing token details.
    """

    id: str
    user_id: str
    name: str
    token_prefix: str
    scopes: typing.List[str]
    created_at: str
    expires_at: typing.Optional[str] = None
    revoked_at: typing.Optional[str] = None
    last_used_at: typing.Optional[str] = None
    display_token: typing.Optional[str] = None
    raw_token: typing.Optional[str] = None

    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
