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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class AuthCode(str, enum.Enum):
    SUCCESS = "success"
    FAILURE = "failure"
    DISABLED = "disabled"
    EXPIRED = "expired"
    INVITED = "invited"
    LOCKED = "locked"
    _UNKNOWN = "__AUTHCODE_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) -> "AuthCode":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        success: typing.Callable[[], T_Result],
        failure: typing.Callable[[], T_Result],
        disabled: typing.Callable[[], T_Result],
        expired: typing.Callable[[], T_Result],
        invited: typing.Callable[[], T_Result],
        locked: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is AuthCode.SUCCESS:
            return success()
        if self is AuthCode.FAILURE:
            return failure()
        if self is AuthCode.DISABLED:
            return disabled()
        if self is AuthCode.EXPIRED:
            return expired()
        if self is AuthCode.INVITED:
            return invited()
        if self is AuthCode.LOCKED:
            return locked()
        return _unknown_member(self._value_)
