# 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 AstOrOperatorNodeOutputChildrenItem_AndOperator(UncheckedBaseModel):
    type: typing.Literal["and_operator"] = "and_operator"
    children: typing.List["AstAndOperatorNodeOutputChildrenItem"]

    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 AstOrOperatorNodeOutputChildrenItem_BooleanLiteral(UncheckedBaseModel):
    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 AstOrOperatorNodeOutputChildrenItem_DynamicVariable(UncheckedBaseModel):
    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 AstOrOperatorNodeOutputChildrenItem_EqOperator(UncheckedBaseModel):
    type: typing.Literal["eq_operator"] = "eq_operator"
    left: "AstEqualsOperatorNodeOutputLeft"
    right: "AstEqualsOperatorNodeOutputRight"

    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 AstOrOperatorNodeOutputChildrenItem_GtOperator(UncheckedBaseModel):
    type: typing.Literal["gt_operator"] = "gt_operator"
    left: "AstGreaterThanOperatorNodeOutputLeft"
    right: "AstGreaterThanOperatorNodeOutputRight"

    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 AstOrOperatorNodeOutputChildrenItem_GteOperator(UncheckedBaseModel):
    type: typing.Literal["gte_operator"] = "gte_operator"
    left: "AstGreaterThanOrEqualsOperatorNodeOutputLeft"
    right: "AstGreaterThanOrEqualsOperatorNodeOutputRight"

    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 AstOrOperatorNodeOutputChildrenItem_Llm(UncheckedBaseModel):
    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 AstOrOperatorNodeOutputChildrenItem_LtOperator(UncheckedBaseModel):
    type: typing.Literal["lt_operator"] = "lt_operator"
    left: "AstLessThanOperatorNodeOutputLeft"
    right: "AstLessThanOperatorNodeOutputRight"

    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 AstOrOperatorNodeOutputChildrenItem_LteOperator(UncheckedBaseModel):
    type: typing.Literal["lte_operator"] = "lte_operator"
    left: "AstLessThanOrEqualsOperatorNodeOutputLeft"
    right: "AstLessThanOrEqualsOperatorNodeOutputRight"

    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 AstOrOperatorNodeOutputChildrenItem_NeqOperator(UncheckedBaseModel):
    type: typing.Literal["neq_operator"] = "neq_operator"
    left: "AstNotEqualsOperatorNodeOutputLeft"
    right: "AstNotEqualsOperatorNodeOutputRight"

    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 AstOrOperatorNodeOutputChildrenItem_NumberLiteral(UncheckedBaseModel):
    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 AstOrOperatorNodeOutputChildrenItem_OrOperator(UncheckedBaseModel):
    type: typing.Literal["or_operator"] = "or_operator"
    children: typing.List["AstOrOperatorNodeOutputChildrenItem"]

    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 AstOrOperatorNodeOutputChildrenItem_StringLiteral(UncheckedBaseModel):
    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


AstOrOperatorNodeOutputChildrenItem = typing_extensions.Annotated[
    typing.Union[
        AstOrOperatorNodeOutputChildrenItem_AndOperator,
        AstOrOperatorNodeOutputChildrenItem_BooleanLiteral,
        AstOrOperatorNodeOutputChildrenItem_DynamicVariable,
        AstOrOperatorNodeOutputChildrenItem_EqOperator,
        AstOrOperatorNodeOutputChildrenItem_GtOperator,
        AstOrOperatorNodeOutputChildrenItem_GteOperator,
        AstOrOperatorNodeOutputChildrenItem_Llm,
        AstOrOperatorNodeOutputChildrenItem_LtOperator,
        AstOrOperatorNodeOutputChildrenItem_LteOperator,
        AstOrOperatorNodeOutputChildrenItem_NeqOperator,
        AstOrOperatorNodeOutputChildrenItem_NumberLiteral,
        AstOrOperatorNodeOutputChildrenItem_OrOperator,
        AstOrOperatorNodeOutputChildrenItem_StringLiteral,
    ],
    UnionMetadata(discriminant="type"),
]
from .ast_and_operator_node_output_children_item import AstAndOperatorNodeOutputChildrenItem  # noqa: E402, I001
from .ast_equals_operator_node_output_left import AstEqualsOperatorNodeOutputLeft  # noqa: E402, I001
from .ast_equals_operator_node_output_right import AstEqualsOperatorNodeOutputRight  # noqa: E402, I001
from .ast_greater_than_operator_node_output_left import AstGreaterThanOperatorNodeOutputLeft  # noqa: E402, I001
from .ast_greater_than_operator_node_output_right import AstGreaterThanOperatorNodeOutputRight  # noqa: E402, I001
from .ast_greater_than_or_equals_operator_node_output_left import AstGreaterThanOrEqualsOperatorNodeOutputLeft  # noqa: E402, I001
from .ast_greater_than_or_equals_operator_node_output_right import AstGreaterThanOrEqualsOperatorNodeOutputRight  # noqa: E402, I001
from .ast_less_than_operator_node_output_left import AstLessThanOperatorNodeOutputLeft  # noqa: E402, I001
from .ast_less_than_operator_node_output_right import AstLessThanOperatorNodeOutputRight  # noqa: E402, I001
from .ast_less_than_or_equals_operator_node_output_left import AstLessThanOrEqualsOperatorNodeOutputLeft  # noqa: E402, I001
from .ast_less_than_or_equals_operator_node_output_right import AstLessThanOrEqualsOperatorNodeOutputRight  # noqa: E402, I001
from .ast_not_equals_operator_node_output_left import AstNotEqualsOperatorNodeOutputLeft  # noqa: E402, I001
from .ast_not_equals_operator_node_output_right import AstNotEqualsOperatorNodeOutputRight  # noqa: E402, I001

update_forward_refs(AstOrOperatorNodeOutputChildrenItem_AndOperator)
update_forward_refs(AstOrOperatorNodeOutputChildrenItem_EqOperator)
update_forward_refs(AstOrOperatorNodeOutputChildrenItem_GtOperator)
update_forward_refs(AstOrOperatorNodeOutputChildrenItem_GteOperator)
update_forward_refs(AstOrOperatorNodeOutputChildrenItem_LtOperator)
update_forward_refs(AstOrOperatorNodeOutputChildrenItem_LteOperator)
update_forward_refs(AstOrOperatorNodeOutputChildrenItem_NeqOperator)
update_forward_refs(AstOrOperatorNodeOutputChildrenItem_OrOperator)
