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

import typing

from ......core import enum

T_Result = typing.TypeVar("T_Result")


class InvoiceStatus(enum.StrEnum):
    DRAFT = "DRAFT"
    OPEN = "OPEN"
    PAID = "PAID"
    VOID = "VOID"
    UNCOLLECTIBLE = "UNCOLLECTIBLE"
    HELD = "HELD"
    _UNKNOWN = "__INVOICESTATUS_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) -> "InvoiceStatus":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    def visit(
        self,
        draft: typing.Callable[[], T_Result],
        open: typing.Callable[[], T_Result],
        paid: typing.Callable[[], T_Result],
        void: typing.Callable[[], T_Result],
        uncollectible: typing.Callable[[], T_Result],
        held: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is InvoiceStatus.DRAFT:
            return draft()
        if self is InvoiceStatus.OPEN:
            return open()
        if self is InvoiceStatus.PAID:
            return paid()
        if self is InvoiceStatus.VOID:
            return void()
        if self is InvoiceStatus.UNCOLLECTIBLE:
            return uncollectible()
        if self is InvoiceStatus.HELD:
            return held()
        return _unknown_member(self._value_)
