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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import datetime as dt
import pydantic
from .report_event_type import ReportEventType
from .status import Status
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ProgressEvent(UniversalBaseModel):
    """
    Event for tracking progress of operations in workflows.
    """

    timestamp: typing.Optional[dt.datetime] = None
    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the event
    """

    group_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the group this event belongs to
    """

    variant: ReportEventType
    msg: str = pydantic.Field()
    """
    The message to display to the user
    """

    progress: typing.Optional[float] = pydantic.Field(default=None)
    """
    Progress value between 0-1 if available
    """

    status: typing.Optional[Status] = pydantic.Field(default=None)
    """
    Current status of the operation
    """

    extra_detail: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    Any extra details to display to the user
    """

    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
