# 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 CompleteInvitationResponse(UniversalBaseModel):
    """
    Schema for complete invitation response.
    """

    success: bool = pydantic.Field()
    """
    Whether the operation succeeded
    """

    user_id: str = pydantic.Field()
    """
    User ID (usr_ prefixed)
    """

    email: str = pydantic.Field()
    """
    User's email address
    """

    organization_id: str = pydantic.Field()
    """
    Organization ID the user joined
    """

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

    refresh_token: typing.Dict[str, typing.Any] = pydantic.Field()
    """
    Refresh token details
    """

    device_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Device ID if provided
    """

    recommended_username: str = pydantic.Field()
    """
    Recommended username generated from email
    """

    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
