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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class Ethnicity(enum.StrEnum):
    HISPANIC_OR_LATINO = "HISPANIC_OR_LATINO"
    NOT_HISPANIC_OR_LATINO = "NOT_HISPANIC_OR_LATINO"
    UNKNOWN = "UNKNOWN"
    REFUSED = "REFUSED"
    _UNKNOWN = "__ETHNICITY_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) -> "Ethnicity":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        hispanic_or_latino: typing.Callable[[], T_Result],
        not_hispanic_or_latino: 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 Ethnicity.HISPANIC_OR_LATINO:
            return hispanic_or_latino()
        if self is Ethnicity.NOT_HISPANIC_OR_LATINO:
            return not_hispanic_or_latino()
        if self is Ethnicity.UNKNOWN:
            return unknown()
        if self is Ethnicity.REFUSED:
            return refused()
        return _unknown_member(self._value_)
