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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .user_model import UserModel


class ActorModel(UncheckedBaseModel):
    """
    OCSF Actor object - describes the entity that performed the action.

    Spec: https://schema.ocsf.io/1.6.0/objects/actor
    """

    user: UserModel = pydantic.Field()
    """
    User who performed the action
    """

    app_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Client application or service name
    """

    app_uid: typing.Optional[str] = pydantic.Field(default=None)
    """
    Client application unique identifier
    """

    session: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Session information
    """

    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
