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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class RelatedCausesCode(enum.StrEnum):
    CAA = "AA"
    """
    Auto Accident
    """

    CAB = "AB"
    """
    Abuse
    """

    CAP = "AP"
    """
    Another Party Responsible
    """

    CEM = "EM"
    """
    Employment
    """

    COA = "OA"
    """
    Other Accident
    """

    CZZ = "ZZ"
    """
    Mutually Defined
    """

    _UNKNOWN = "__RELATEDCAUSESCODE_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) -> "RelatedCausesCode":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        caa: typing.Callable[[], T_Result],
        cab: typing.Callable[[], T_Result],
        cap: typing.Callable[[], T_Result],
        cem: typing.Callable[[], T_Result],
        coa: typing.Callable[[], T_Result],
        czz: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is RelatedCausesCode.CAA:
            return caa()
        if self is RelatedCausesCode.CAB:
            return cab()
        if self is RelatedCausesCode.CAP:
            return cap()
        if self is RelatedCausesCode.CEM:
            return cem()
        if self is RelatedCausesCode.COA:
            return coa()
        if self is RelatedCausesCode.CZZ:
            return czz()
        return _unknown_member(self._value_)
