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


class AstOrOperatorNodeInputChildrenItem_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 AstOrOperatorNodeInputChildrenItem_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 AstOrOperatorNodeInputChildrenItem_EqOperator(UncheckedBaseModel):
    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


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


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


class AstOrOperatorNodeInputChildrenItem_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 AstOrOperatorNodeInputChildrenItem_LtOperator(UncheckedBaseModel):
    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


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


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


class AstOrOperatorNodeInputChildrenItem_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 AstOrOperatorNodeInputChildrenItem_OrOperator(UncheckedBaseModel):
    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


class AstOrOperatorNodeInputChildrenItem_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


AstOrOperatorNodeInputChildrenItem = typing_extensions.Annotated[
    typing.Union[
        AstOrOperatorNodeInputChildrenItem_AndOperator,
        AstOrOperatorNodeInputChildrenItem_BooleanLiteral,
        AstOrOperatorNodeInputChildrenItem_DynamicVariable,
        AstOrOperatorNodeInputChildrenItem_EqOperator,
        AstOrOperatorNodeInputChildrenItem_GtOperator,
        AstOrOperatorNodeInputChildrenItem_GteOperator,
        AstOrOperatorNodeInputChildrenItem_Llm,
        AstOrOperatorNodeInputChildrenItem_LtOperator,
        AstOrOperatorNodeInputChildrenItem_LteOperator,
        AstOrOperatorNodeInputChildrenItem_NeqOperator,
        AstOrOperatorNodeInputChildrenItem_NumberLiteral,
        AstOrOperatorNodeInputChildrenItem_OrOperator,
        AstOrOperatorNodeInputChildrenItem_StringLiteral,
    ],
    UnionMetadata(discriminant="type"),
]
from .ast_and_operator_node_input_children_item import AstAndOperatorNodeInputChildrenItem  # noqa: E402, I001
from .ast_equals_operator_node_input_left import AstEqualsOperatorNodeInputLeft  # noqa: E402, I001
from .ast_equals_operator_node_input_right import AstEqualsOperatorNodeInputRight  # noqa: E402, I001
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
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
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
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
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

update_forward_refs(AstOrOperatorNodeInputChildrenItem_AndOperator)
update_forward_refs(AstOrOperatorNodeInputChildrenItem_EqOperator)
update_forward_refs(AstOrOperatorNodeInputChildrenItem_GtOperator)
update_forward_refs(AstOrOperatorNodeInputChildrenItem_GteOperator)
update_forward_refs(AstOrOperatorNodeInputChildrenItem_LtOperator)
update_forward_refs(AstOrOperatorNodeInputChildrenItem_LteOperator)
update_forward_refs(AstOrOperatorNodeInputChildrenItem_NeqOperator)
update_forward_refs(AstOrOperatorNodeInputChildrenItem_OrOperator)
