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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class ResponsiblePartyType(enum.StrEnum):
    INSURANCE_PAY = "INSURANCE_PAY"
    SELF_PAY = "SELF_PAY"
    UNKNOWN = "UNKNOWN"
    _UNKNOWN = "__RESPONSIBLEPARTYTYPE_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) -> "ResponsiblePartyType":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        insurance_pay: typing.Callable[[], T_Result],
        self_pay: typing.Callable[[], T_Result],
        unknown: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is ResponsiblePartyType.INSURANCE_PAY:
            return insurance_pay()
        if self is ResponsiblePartyType.SELF_PAY:
            return self_pay()
        if self is ResponsiblePartyType.UNKNOWN:
            return unknown()
        return _unknown_member(self._value_)
