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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class BlockRunFailedData(UncheckedBaseModel):
    workflow_id: str
    workflow_run_id: str
    block_id: typing.Optional[str] = None
    cost: typing.Optional[float] = None
    config: typing.Dict[str, typing.Optional[typing.Any]]
    message: str = pydantic.Field()
    """
    The reason why the job failed
    """

    metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
    state: typing.Dict[str, typing.Optional[typing.Any]]
    session_id: str
    block_type: typing.Optional[str] = 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
