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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class StatusEnum(str, enum.Enum):
    """
    Enum for representing the status of a job
    """

    PENDING = "PENDING"
    SUCCESS = "SUCCESS"
    ERROR = "ERROR"
    CANCELED = "CANCELED"

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