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

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
from ..core.serialization import FieldMetadata
from .user_context_account_type import UserContextAccountType
from .user_context_context_type import UserContextContextType


class UserContext(UniversalBaseModel):
    id: typing.Optional[str] = None
    context_type: typing_extensions.Annotated[
        typing.Optional[UserContextContextType], FieldMetadata(alias="contextType")
    ] = None
    account_type: typing_extensions.Annotated[
        typing.Optional[UserContextAccountType], FieldMetadata(alias="accountType")
    ] = None
    parent: typing.Optional["UserContext"] = 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


update_forward_refs(UserContext)
