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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .branch_condition_yaml import BranchConditionYaml


class ConditionalBlockYaml(UniversalBaseModel):
    label: str = pydantic.Field()
    """
    Author-facing identifier; must be unique per workflow.
    """

    next_block_label: typing.Optional[str] = pydantic.Field(default=None)
    """
    Optional pointer to the label of the next block. When omitted, it will default to sequential order. See [[s-4bnl]].
    """

    continue_on_failure: typing.Optional[bool] = None
    model: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
    next_loop_on_failure: typing.Optional[bool] = None
    branch_conditions: typing.Optional[typing.List[BranchConditionYaml]] = 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
