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

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata


class WorkflowExpressionConditionModelInputExpression_AndOperator(UncheckedBaseModel):
    """
    Expression to evaluate.
    """

    type: typing.Literal["and_operator"] = "and_operator"
    children: typing.List["AstAndOperatorNodeInputChildrenItem"]

    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


from .ast_and_operator_node_input_children_item import AstAndOperatorNodeInputChildrenItem  # noqa: E402, I001


class WorkflowExpressionConditionModelInputExpression_BooleanLiteral(UncheckedBaseModel):
    """
    Expression to evaluate.
    """

    type: typing.Literal["boolean_literal"] = "boolean_literal"
    value: bool

    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


class WorkflowExpressionConditionModelInputExpression_DynamicVariable(UncheckedBaseModel):
    """
    Expression to evaluate.
    """

    type: typing.Literal["dynamic_variable"] = "dynamic_variable"
    name: 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


class WorkflowExpressionConditionModelInputExpression_EqOperator(UncheckedBaseModel):
    """
    Expression to evaluate.
    """

    type: typing.Literal["eq_operator"] = "eq_operator"
    left: "AstEqualsOperatorNodeInputLeft"
    right: "AstEqualsOperatorNodeInputRight"

    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


from .ast_equals_operator_node_input_left import AstEqualsOperatorNodeInputLeft  # noqa: E402, I001
from .ast_equals_operator_node_input_right import AstEqualsOperatorNodeInputRight  # noqa: E402, I001


class WorkflowExpressionConditionModelInputExpression_GtOperator(UncheckedBaseModel):
    """
    Expression to evaluate.
    """

    type: typing.Literal["gt_operator"] = "gt_operator"
    left: "AstGreaterThanOperatorNodeInputLeft"
    right: "AstGreaterThanOperatorNodeInputRight"

    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


from .ast_greater_than_operator_node_input_left import AstGreaterThanOperatorNodeInputLeft  # noqa: E402, I001
from .ast_greater_than_operator_node_input_right import AstGreaterThanOperatorNodeInputRight  # noqa: E402, I001


class WorkflowExpressionConditionModelInputExpression_GteOperator(UncheckedBaseModel):
    """
    Expression to evaluate.
    """

    type: typing.Literal["gte_operator"] = "gte_operator"
    left: "AstGreaterThanOrEqualsOperatorNodeInputLeft"
    right: "AstGreaterThanOrEqualsOperatorNodeInputRight"

    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


from .ast_greater_than_or_equals_operator_node_input_left import AstGreaterThanOrEqualsOperatorNodeInputLeft  # noqa: E402, I001
from .ast_greater_than_or_equals_operator_node_input_right import AstGreaterThanOrEqualsOperatorNodeInputRight  # noqa: E402, I001


class WorkflowExpressionConditionModelInputExpression_Llm(UncheckedBaseModel):
    """
    Expression to evaluate.
    """

    type: typing.Literal["llm"] = "llm"
    prompt: 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


class WorkflowExpressionConditionModelInputExpression_LtOperator(UncheckedBaseModel):
    """
    Expression to evaluate.
    """

    type: typing.Literal["lt_operator"] = "lt_operator"
    left: "AstLessThanOperatorNodeInputLeft"
    right: "AstLessThanOperatorNodeInputRight"

    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


from .ast_less_than_operator_node_input_left import AstLessThanOperatorNodeInputLeft  # noqa: E402, I001
from .ast_less_than_operator_node_input_right import AstLessThanOperatorNodeInputRight  # noqa: E402, I001


class WorkflowExpressionConditionModelInputExpression_LteOperator(UncheckedBaseModel):
    """
    Expression to evaluate.
    """

    type: typing.Literal["lte_operator"] = "lte_operator"
    left: "AstLessThanOrEqualsOperatorNodeInputLeft"
    right: "AstLessThanOrEqualsOperatorNodeInputRight"

    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


from .ast_less_than_or_equals_operator_node_input_left import AstLessThanOrEqualsOperatorNodeInputLeft  # noqa: E402, I001
from .ast_less_than_or_equals_operator_node_input_right import AstLessThanOrEqualsOperatorNodeInputRight  # noqa: E402, I001


class WorkflowExpressionConditionModelInputExpression_NeqOperator(UncheckedBaseModel):
    """
    Expression to evaluate.
    """

    type: typing.Literal["neq_operator"] = "neq_operator"
    left: "AstNotEqualsOperatorNodeInputLeft"
    right: "AstNotEqualsOperatorNodeInputRight"

    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


from .ast_not_equals_operator_node_input_left import AstNotEqualsOperatorNodeInputLeft  # noqa: E402, I001
from .ast_not_equals_operator_node_input_right import AstNotEqualsOperatorNodeInputRight  # noqa: E402, I001


class WorkflowExpressionConditionModelInputExpression_NumberLiteral(UncheckedBaseModel):
    """
    Expression to evaluate.
    """

    type: typing.Literal["number_literal"] = "number_literal"
    value: float

    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


class WorkflowExpressionConditionModelInputExpression_OrOperator(UncheckedBaseModel):
    """
    Expression to evaluate.
    """

    type: typing.Literal["or_operator"] = "or_operator"
    children: typing.List["AstOrOperatorNodeInputChildrenItem"]

    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


from .ast_or_operator_node_input_children_item import AstOrOperatorNodeInputChildrenItem  # noqa: E402, I001


class WorkflowExpressionConditionModelInputExpression_StringLiteral(UncheckedBaseModel):
    """
    Expression to evaluate.
    """

    type: typing.Literal["string_literal"] = "string_literal"
    value: 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


WorkflowExpressionConditionModelInputExpression = typing_extensions.Annotated[
    typing.Union[
        WorkflowExpressionConditionModelInputExpression_AndOperator,
        WorkflowExpressionConditionModelInputExpression_BooleanLiteral,
        WorkflowExpressionConditionModelInputExpression_DynamicVariable,
        WorkflowExpressionConditionModelInputExpression_EqOperator,
        WorkflowExpressionConditionModelInputExpression_GtOperator,
        WorkflowExpressionConditionModelInputExpression_GteOperator,
        WorkflowExpressionConditionModelInputExpression_Llm,
        WorkflowExpressionConditionModelInputExpression_LtOperator,
        WorkflowExpressionConditionModelInputExpression_LteOperator,
        WorkflowExpressionConditionModelInputExpression_NeqOperator,
        WorkflowExpressionConditionModelInputExpression_NumberLiteral,
        WorkflowExpressionConditionModelInputExpression_OrOperator,
        WorkflowExpressionConditionModelInputExpression_StringLiteral,
    ],
    UnionMetadata(discriminant="type"),
]
update_forward_refs(WorkflowExpressionConditionModelInputExpression_AndOperator)
update_forward_refs(WorkflowExpressionConditionModelInputExpression_EqOperator)
update_forward_refs(WorkflowExpressionConditionModelInputExpression_GtOperator)
update_forward_refs(WorkflowExpressionConditionModelInputExpression_GteOperator)
update_forward_refs(WorkflowExpressionConditionModelInputExpression_LtOperator)
update_forward_refs(WorkflowExpressionConditionModelInputExpression_LteOperator)
update_forward_refs(WorkflowExpressionConditionModelInputExpression_NeqOperator)
update_forward_refs(WorkflowExpressionConditionModelInputExpression_OrOperator)
