"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from acuvity.types import BaseModel
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class PrincipalappuserTypedDict(TypedDict):
    r"""Describes the optional principal information of the user of an application which
    is being derived from a bearer token of a request.
    """

    email: NotRequired[str]
    r"""The Email address of the user. This will be derived from the email claims of a
    token like email, emailAddress or upn.
    """
    name: NotRequired[str]
    r"""The given name of the user. This will be derived from the common name claims of
    a token like name or given_name.
    """
    token_validated: NotRequired[bool]
    r"""This will be true if the apex was able to validate the token in the request."""


class Principalappuser(BaseModel):
    r"""Describes the optional principal information of the user of an application which
    is being derived from a bearer token of a request.
    """

    email: Optional[str] = None
    r"""The Email address of the user. This will be derived from the email claims of a
    token like email, emailAddress or upn.
    """

    name: Optional[str] = None
    r"""The given name of the user. This will be derived from the common name claims of
    a token like name or given_name.
    """

    token_validated: Annotated[
        Optional[bool], pydantic.Field(alias="tokenValidated")
    ] = None
    r"""This will be true if the apex was able to validate the token in the request."""
