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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class SexualOrientation(enum.StrEnum):
    HETEROSEXUAL = "HETEROSEXUAL"
    HOMOSEXUAL = "HOMOSEXUAL"
    BISEXUAL = "BISEXUAL"
    TWO_SPIRIT = "TWO_SPIRIT"
    OTHER = "OTHER"
    UNKNOWN = "UNKNOWN"
    REFUSED = "REFUSED"
    _UNKNOWN = "__SEXUALORIENTATION_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) -> "SexualOrientation":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        heterosexual: typing.Callable[[], T_Result],
        homosexual: typing.Callable[[], T_Result],
        bisexual: typing.Callable[[], T_Result],
        two_spirit: 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 SexualOrientation.HETEROSEXUAL:
            return heterosexual()
        if self is SexualOrientation.HOMOSEXUAL:
            return homosexual()
        if self is SexualOrientation.BISEXUAL:
            return bisexual()
        if self is SexualOrientation.TWO_SPIRIT:
            return two_spirit()
        if self is SexualOrientation.OTHER:
            return other()
        if self is SexualOrientation.UNKNOWN:
            return unknown()
        if self is SexualOrientation.REFUSED:
            return refused()
        return _unknown_member(self._value_)
