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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class CardType(str, enum.Enum):
    CREDIT = "credit"
    DEBIT = "debit"
    PREPAID = "prepaid"
    UNKNOWN = "unknown"

    def visit(
        self,
        credit: typing.Callable[[], T_Result],
        debit: typing.Callable[[], T_Result],
        prepaid: typing.Callable[[], T_Result],
        unknown: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is CardType.CREDIT:
            return credit()
        if self is CardType.DEBIT:
            return debit()
        if self is CardType.PREPAID:
            return prepaid()
        if self is CardType.UNKNOWN:
            return unknown()
