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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class CodingAttributionType(enum.StrEnum):
    CANDID = "CANDID"
    CUSTOMER = "CUSTOMER"
    TCN = "TCN"
    PJF = "PJF"
    _UNKNOWN = "__CODINGATTRIBUTIONTYPE_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) -> "CodingAttributionType":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        candid: typing.Callable[[], T_Result],
        customer: typing.Callable[[], T_Result],
        tcn: typing.Callable[[], T_Result],
        pjf: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is CodingAttributionType.CANDID:
            return candid()
        if self is CodingAttributionType.CUSTOMER:
            return customer()
        if self is CodingAttributionType.TCN:
            return tcn()
        if self is CodingAttributionType.PJF:
            return pjf()
        return _unknown_member(self._value_)
