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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class Race(enum.StrEnum):
    AMERICAN_INDIAN_OR_ALASKA_NATIVE = "AMERICAN_INDIAN_OR_ALASKA_NATIVE"
    WHITE = "WHITE"
    BLACK = "BLACK"
    ASIAN = "ASIAN"
    NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER = "NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER"
    MIDDLE_EASTERN_OR_NORTH_AFRICAN = "MIDDLE_EASTERN_OR_NORTH_AFRICAN"
    OTHER = "OTHER"
    UNKNOWN = "UNKNOWN"
    REFUSED = "REFUSED"
    _UNKNOWN = "__RACE_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) -> "Race":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        american_indian_or_alaska_native: typing.Callable[[], T_Result],
        white: typing.Callable[[], T_Result],
        black: typing.Callable[[], T_Result],
        asian: typing.Callable[[], T_Result],
        native_hawaiian_or_other_pacific_islander: typing.Callable[[], T_Result],
        middle_eastern_or_north_african: typing.Callable[[], T_Result],
        other: typing.Callable[[], T_Result],
        unknown: typing.Callable[[], T_Result],
        refused: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is Race.AMERICAN_INDIAN_OR_ALASKA_NATIVE:
            return american_indian_or_alaska_native()
        if self is Race.WHITE:
            return white()
        if self is Race.BLACK:
            return black()
        if self is Race.ASIAN:
            return asian()
        if self is Race.NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER:
            return native_hawaiian_or_other_pacific_islander()
        if self is Race.MIDDLE_EASTERN_OR_NORTH_AFRICAN:
            return middle_eastern_or_north_african()
        if self is Race.OTHER:
            return other()
        if self is Race.UNKNOWN:
            return unknown()
        if self is Race.REFUSED:
            return refused()
        return _unknown_member(self._value_)
