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

import typing

from ..core import enum

T_Result = typing.TypeVar("T_Result")


class FileConversionStepDefinitionConfigFailureBehavior(enum.StrEnum):
    """
    Whether to continue or exit the workflow if file conversion fails. Defaults to `EXIT`.

    See the [File Conversion step docs](https://docs.extend.ai/2026-02-09/product/workflows/configuring-workflows-via-api#file-conversion-step).
    """

    CONTINUE = "CONTINUE"
    EXIT = "EXIT"
    _UNKNOWN = "__FILECONVERSIONSTEPDEFINITIONCONFIGFAILUREBEHAVIOR_UNKNOWN__"
    """
    This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`.
    """

    @classmethod
    def _missing_(cls, value: typing.Any) -> "FileConversionStepDefinitionConfigFailureBehavior":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        continue_: typing.Callable[[], T_Result],
        exit: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is FileConversionStepDefinitionConfigFailureBehavior.CONTINUE:
            return continue_()
        if self is FileConversionStepDefinitionConfigFailureBehavior.EXIT:
            return exit()
        return _unknown_member(self._value_)
