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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import datetime as dt
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ActivityLog(UncheckedBaseModel):
    datetime: typing.Optional[dt.datetime] = None
    duration: typing.Optional[int] = pydantic.Field(default=None)
    """
    Duration of response generation in ms
    """

    email: str
    extra_data: typing.Optional[typing.Optional[typing.Any]] = None
    http_referer: typing.Optional[str] = None
    id: typing.Optional[int] = None
    ip_address: typing.Optional[str] = None
    organization_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Organization id
    """

    project_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Project id if request has it
    """

    request_method: str
    request_url: str
    response_code: str
    user_agent: typing.Optional[str] = None
    user_id: int
    user_session: typing.Optional[str] = None
    workspace_owner_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Owner id of workspace where action performed
    """

    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
