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

from __future__ import annotations

import typing

from .api_node_result import ApiNodeResult
from .code_execution_node_result import CodeExecutionNodeResult
from .conditional_node_result import ConditionalNodeResult
from .prompt_node_result import PromptNodeResult
from .search_node_result import SearchNodeResult
from .subworkflow_node_result import SubworkflowNodeResult
from .templating_node_result import TemplatingNodeResult
from .terminal_node_result import TerminalNodeResult


class WorkflowNodeResultData_Prompt(PromptNodeResult):
    type: typing.Literal["PROMPT"] = "PROMPT"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class WorkflowNodeResultData_Search(SearchNodeResult):
    type: typing.Literal["SEARCH"] = "SEARCH"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class WorkflowNodeResultData_Templating(TemplatingNodeResult):
    type: typing.Literal["TEMPLATING"] = "TEMPLATING"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class WorkflowNodeResultData_CodeExecution(CodeExecutionNodeResult):
    type: typing.Literal["CODE_EXECUTION"] = "CODE_EXECUTION"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class WorkflowNodeResultData_Conditional(ConditionalNodeResult):
    type: typing.Literal["CONDITIONAL"] = "CONDITIONAL"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class WorkflowNodeResultData_Api(ApiNodeResult):
    type: typing.Literal["API"] = "API"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class WorkflowNodeResultData_Terminal(TerminalNodeResult):
    type: typing.Literal["TERMINAL"] = "TERMINAL"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


class WorkflowNodeResultData_Subworkflow(SubworkflowNodeResult):
    type: typing.Literal["SUBWORKFLOW"] = "SUBWORKFLOW"

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        populate_by_name = True


WorkflowNodeResultData = typing.Union[
    WorkflowNodeResultData_Prompt,
    WorkflowNodeResultData_Search,
    WorkflowNodeResultData_Templating,
    WorkflowNodeResultData_CodeExecution,
    WorkflowNodeResultData_Conditional,
    WorkflowNodeResultData_Api,
    WorkflowNodeResultData_Terminal,
    WorkflowNodeResultData_Subworkflow,
]
