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

from __future__ import annotations

import typing

import typing_extensions
from .classification_next_entry import ClassificationNextEntryParams
from .classify_step_definition_config import ClassifyStepDefinitionConfigParams
from .conditional_extract_step_definition_config import ConditionalExtractStepDefinitionConfigParams
from .conditional_next_entry import ConditionalNextEntryParams
from .conditional_step_definition_config import ConditionalStepDefinitionConfigParams
from .external_data_validation_step_definition_config import ExternalDataValidationStepDefinitionConfigParams
from .extract_step_definition_config import ExtractStepDefinitionConfigParams
from .file_conversion_step_definition_config import FileConversionStepDefinitionConfigParams
from .merge_extract_step_definition_config import MergeExtractStepDefinitionConfigParams
from .parse_step_definition_config import ParseStepDefinitionConfigParams
from .rule_validation_next_entry import RuleValidationNextEntryParams
from .rule_validation_step_definition_config import RuleValidationStepDefinitionConfigParams
from .simple_next_entry import SimpleNextEntryParams
from .split_step_definition_config import SplitStepDefinitionConfigParams


class WorkflowStepDefinition_TriggerParams(typing_extensions.TypedDict):
    type: typing.Literal["TRIGGER"]
    name: str
    next: typing_extensions.NotRequired[typing.Sequence[SimpleNextEntryParams]]


class WorkflowStepDefinition_ParseParams(typing_extensions.TypedDict):
    type: typing.Literal["PARSE"]
    name: str
    config: typing_extensions.NotRequired[ParseStepDefinitionConfigParams]
    next: typing_extensions.NotRequired[typing.Sequence[SimpleNextEntryParams]]


class WorkflowStepDefinition_ExtractParams(typing_extensions.TypedDict):
    type: typing.Literal["EXTRACT"]
    name: str
    config: typing_extensions.NotRequired[ExtractStepDefinitionConfigParams]
    next: typing_extensions.NotRequired[typing.Sequence[SimpleNextEntryParams]]


class WorkflowStepDefinition_ClassifyParams(typing_extensions.TypedDict):
    type: typing.Literal["CLASSIFY"]
    name: str
    config: typing_extensions.NotRequired[ClassifyStepDefinitionConfigParams]
    next: typing_extensions.NotRequired[typing.Sequence[ClassificationNextEntryParams]]


class WorkflowStepDefinition_SplitParams(typing_extensions.TypedDict):
    type: typing.Literal["SPLIT"]
    name: str
    config: typing_extensions.NotRequired[SplitStepDefinitionConfigParams]
    next: typing_extensions.NotRequired[typing.Sequence[ClassificationNextEntryParams]]


class WorkflowStepDefinition_MergeExtractParams(typing_extensions.TypedDict):
    type: typing.Literal["MERGE_EXTRACT"]
    name: str
    config: typing_extensions.NotRequired[MergeExtractStepDefinitionConfigParams]
    next: typing_extensions.NotRequired[typing.Sequence[SimpleNextEntryParams]]


class WorkflowStepDefinition_ConditionalParams(typing_extensions.TypedDict):
    type: typing.Literal["CONDITIONAL"]
    name: str
    config: ConditionalStepDefinitionConfigParams
    next: typing_extensions.NotRequired[typing.Sequence[ConditionalNextEntryParams]]


class WorkflowStepDefinition_ConditionalExtractParams(typing_extensions.TypedDict):
    type: typing.Literal["CONDITIONAL_EXTRACT"]
    name: str
    config: typing_extensions.NotRequired[ConditionalExtractStepDefinitionConfigParams]
    next: typing_extensions.NotRequired[typing.Sequence[SimpleNextEntryParams]]


class WorkflowStepDefinition_ExternalDataValidationParams(typing_extensions.TypedDict):
    type: typing.Literal["EXTERNAL_DATA_VALIDATION"]
    name: str
    config: typing_extensions.NotRequired[ExternalDataValidationStepDefinitionConfigParams]
    next: typing_extensions.NotRequired[typing.Sequence[SimpleNextEntryParams]]


class WorkflowStepDefinition_WebhookResponseParams(typing_extensions.TypedDict):
    type: typing.Literal["WEBHOOK_RESPONSE"]
    name: str


class WorkflowStepDefinition_RuleValidationParams(typing_extensions.TypedDict):
    type: typing.Literal["RULE_VALIDATION"]
    name: str
    config: typing_extensions.NotRequired[RuleValidationStepDefinitionConfigParams]
    next: typing_extensions.NotRequired[typing.Sequence[RuleValidationNextEntryParams]]


class WorkflowStepDefinition_HumanReviewParams(typing_extensions.TypedDict):
    type: typing.Literal["HUMAN_REVIEW"]
    name: str
    next: typing_extensions.NotRequired[typing.Sequence[SimpleNextEntryParams]]


class WorkflowStepDefinition_CollectParams(typing_extensions.TypedDict):
    type: typing.Literal["COLLECT"]
    name: str
    next: typing_extensions.NotRequired[typing.Sequence[SimpleNextEntryParams]]


class WorkflowStepDefinition_FileConversionParams(typing_extensions.TypedDict):
    type: typing.Literal["FILE_CONVERSION"]
    name: str
    config: typing_extensions.NotRequired[FileConversionStepDefinitionConfigParams]
    next: typing_extensions.NotRequired[typing.Sequence[SimpleNextEntryParams]]


WorkflowStepDefinitionParams = typing.Union[
    WorkflowStepDefinition_TriggerParams,
    WorkflowStepDefinition_ParseParams,
    WorkflowStepDefinition_ExtractParams,
    WorkflowStepDefinition_ClassifyParams,
    WorkflowStepDefinition_SplitParams,
    WorkflowStepDefinition_MergeExtractParams,
    WorkflowStepDefinition_ConditionalParams,
    WorkflowStepDefinition_ConditionalExtractParams,
    WorkflowStepDefinition_ExternalDataValidationParams,
    WorkflowStepDefinition_WebhookResponseParams,
    WorkflowStepDefinition_RuleValidationParams,
    WorkflowStepDefinition_HumanReviewParams,
    WorkflowStepDefinition_CollectParams,
    WorkflowStepDefinition_FileConversionParams,
]
