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

from __future__ import annotations
from ..core.pydantic_utilities import UniversalBaseModel
import typing
import datetime as dt
from .report_event_type import ReportEventType
from .status import Status
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic
from .report_block import ReportBlock
from .report_state import ReportState


class ReportEventItemEventData_Progress(UniversalBaseModel):
    """
    The data for the event
    """

    type: typing.Literal["progress"] = "progress"
    timestamp: typing.Optional[dt.datetime] = None
    id: typing.Optional[str] = None
    group_id: typing.Optional[str] = None
    variant: ReportEventType
    msg: str
    progress: typing.Optional[float] = None
    status: typing.Optional[Status] = None
    extra_detail: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = 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


class ReportEventItemEventData_ReportBlockUpdate(UniversalBaseModel):
    """
    The data for the event
    """

    type: typing.Literal["report_block_update"] = "report_block_update"
    timestamp: typing.Optional[dt.datetime] = None
    msg: typing.Optional[str] = None
    block: ReportBlock

    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


class ReportEventItemEventData_ReportStateUpdate(UniversalBaseModel):
    """
    The data for the event
    """

    type: typing.Literal["report_state_update"] = "report_state_update"
    timestamp: typing.Optional[dt.datetime] = None
    msg: str
    status: ReportState

    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


ReportEventItemEventData = typing.Union[
    ReportEventItemEventData_Progress,
    ReportEventItemEventData_ReportBlockUpdate,
    ReportEventItemEventData_ReportStateUpdate,
]
