# 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 CliTokenResponse(UniversalBaseModel):
    """
    Response for CLI token exchange.
    """

    email: typing.Optional[str] = pydantic.Field(default=None)
    """
    User email
    """

    expires_in: int = pydantic.Field()
    """
    Token expiration in seconds
    """

    member_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    User ID from WorkOS
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    User display name
    """

    org_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Organization ID (if applicable)
    """

    refresh_token: typing.Optional[str] = pydantic.Field(default=None)
    """
    Refresh token for obtaining new access tokens
    """

    session_jwt: str = pydantic.Field()
    """
    Session JWT (WorkOS access token)
    """

    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
