# 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 WorkflowExecutionResponse(UniversalBaseModel):
    """
    Response schema for a workflow execution record.
    """

    id: str
    session_id: str
    workflow_id: str
    workflow_name: typing.Optional[str] = None
    trigger_event: typing.Optional[str] = None
    status: str
    result_content: typing.Optional[str] = None
    result_type: typing.Optional[str] = None
    error_message: typing.Optional[str] = None
    started_at: typing.Optional[dt.datetime] = None
    completed_at: typing.Optional[dt.datetime] = None
    execution_time_ms: typing.Optional[int] = 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
