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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class ExtractState(str, enum.Enum):
    CREATED = "CREATED"
    PENDING = "PENDING"
    SUCCESS = "SUCCESS"
    ERROR = "ERROR"

    def visit(
        self,
        created: typing.Callable[[], T_Result],
        pending: typing.Callable[[], T_Result],
        success: typing.Callable[[], T_Result],
        error: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is ExtractState.CREATED:
            return created()
        if self is ExtractState.PENDING:
            return pending()
        if self is ExtractState.SUCCESS:
            return success()
        if self is ExtractState.ERROR:
            return error()
