# 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
from .version_event_content import VersionEventContent
from .version_event_type import VersionEventType


class VersionEventResponse(UniversalBaseModel):
    """
    Response model for a single version event.
    """

    actor_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    User ID who triggered this event
    """

    branch_id: str = pydantic.Field()
    """
    Branch ID (denormalized)
    """

    content: typing.Optional[VersionEventContent] = pydantic.Field(default=None)
    """
    Event-specific metadata
    """

    created_at: dt.datetime = pydantic.Field()
    """
    When this event was created
    """

    event_type: VersionEventType = pydantic.Field()
    """
    Type of lifecycle event
    """

    id: str = pydantic.Field()
    """
    Event ID
    """

    sequence_id: int = pydantic.Field()
    """
    Monotonically increasing sequence ID for ordering
    """

    version_id: str = pydantic.Field()
    """
    Version ID this event belongs to
    """

    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
