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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class ContraceptiveEntryType(str, enum.Enum):
    """
    ℹ️ This enum is non-exhaustive.
    """

    UNSPECIFIED = "unspecified"
    IMPLANT = "implant"
    INJECTION = "injection"
    IUD = "iud"
    INTRAVAGINAL_RING = "intravaginal_ring"
    ORAL = "oral"
    PATCH = "patch"
    _UNKNOWN = "__CONTRACEPTIVEENTRYTYPE_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) -> "ContraceptiveEntryType":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        unspecified: typing.Callable[[], T_Result],
        implant: typing.Callable[[], T_Result],
        injection: typing.Callable[[], T_Result],
        iud: typing.Callable[[], T_Result],
        intravaginal_ring: typing.Callable[[], T_Result],
        oral: typing.Callable[[], T_Result],
        patch: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is ContraceptiveEntryType.UNSPECIFIED:
            return unspecified()
        if self is ContraceptiveEntryType.IMPLANT:
            return implant()
        if self is ContraceptiveEntryType.INJECTION:
            return injection()
        if self is ContraceptiveEntryType.IUD:
            return iud()
        if self is ContraceptiveEntryType.INTRAVAGINAL_RING:
            return intravaginal_ring()
        if self is ContraceptiveEntryType.ORAL:
            return oral()
        if self is ContraceptiveEntryType.PATCH:
            return patch()
        return _unknown_member(self._value_)
