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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
import datetime as dt
from .api_role import ApiRole
from .api_policy import ApiPolicy
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class User(UniversalBaseModel):
    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The Vectara ID for the user.
    """

    email: typing.Optional[str] = pydantic.Field(default=None)
    """
    The email address for the user.
    """

    username: typing.Optional[str] = pydantic.Field(default=None)
    """
    The username for the user.
    """

    enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether the user is enabled or disabled.
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    The description of the user.
    """

    created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    When the user was created.
    """

    updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    When a user property was last updated.
    """

    api_roles: typing.Optional[typing.List[ApiRole]] = pydantic.Field(default=None)
    """
    The role names of the user.
    """

    api_policy: typing.Optional[ApiPolicy] = 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
