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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class TransactionStatus(str, enum.Enum):
    CREATED = "created"
    PENDING = "pending"
    COMPLETED = "completed"
    FAILED = "failed"
    REVERSED = "reversed"
    QUEUED = "queued"
    CANCELED = "canceled"

    def visit(
        self,
        created: typing.Callable[[], T_Result],
        pending: typing.Callable[[], T_Result],
        completed: typing.Callable[[], T_Result],
        failed: typing.Callable[[], T_Result],
        reversed: typing.Callable[[], T_Result],
        queued: typing.Callable[[], T_Result],
        canceled: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is TransactionStatus.CREATED:
            return created()
        if self is TransactionStatus.PENDING:
            return pending()
        if self is TransactionStatus.COMPLETED:
            return completed()
        if self is TransactionStatus.FAILED:
            return failed()
        if self is TransactionStatus.REVERSED:
            return reversed()
        if self is TransactionStatus.QUEUED:
            return queued()
        if self is TransactionStatus.CANCELED:
            return canceled()
