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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class NameUse(enum.StrEnum):
    USUAL = "USUAL"
    OFFICIAL = "OFFICIAL"
    TEMP = "TEMP"
    NICKNAME = "NICKNAME"
    ANONYMOUS = "ANONYMOUS"
    OLD = "OLD"
    MAIDEN = "MAIDEN"
    _UNKNOWN = "__NAMEUSE_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) -> "NameUse":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        usual: typing.Callable[[], T_Result],
        official: typing.Callable[[], T_Result],
        temp: typing.Callable[[], T_Result],
        nickname: typing.Callable[[], T_Result],
        anonymous: typing.Callable[[], T_Result],
        old: typing.Callable[[], T_Result],
        maiden: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is NameUse.USUAL:
            return usual()
        if self is NameUse.OFFICIAL:
            return official()
        if self is NameUse.TEMP:
            return temp()
        if self is NameUse.NICKNAME:
            return nickname()
        if self is NameUse.ANONYMOUS:
            return anonymous()
        if self is NameUse.OLD:
            return old()
        if self is NameUse.MAIDEN:
            return maiden()
        return _unknown_member(self._value_)
