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

from ..core.unchecked_base_model import UncheckedBaseModel
from .workflow_run_stop_reason import WorkflowRunStopReason
import typing
from .workflow_run_state_value import WorkflowRunStateValue
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class WorkflowRun(UncheckedBaseModel):
    stop_reason: WorkflowRunStopReason
    state: typing.Optional[typing.Dict[str, typing.Optional[WorkflowRunStateValue]]] = None
    errors: typing.Optional[typing.List[str]] = None
    session_id: str
    workflow_run_id: str

    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
