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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class AuditEntryResponse(UniversalBaseModel):
    """
    Single audit entry response.
    """

    id: str
    entity_type: str
    entity_id: str
    entity_name: typing.Optional[str] = None
    action_type: str
    actor_id: str
    actor_name: str
    actor_email: str
    target_id: typing.Optional[str] = None
    target_name: typing.Optional[str] = None
    previous_value: typing.Optional[str] = None
    new_value: typing.Optional[str] = None
    metadata: typing.Optional[typing.Dict[str, typing.Any]] = None
    organization_id: str
    department_id: typing.Optional[str] = None
    created_at: typing.Optional[dt.datetime] = 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
