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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class OrderTopLevelStatus(str, enum.Enum):
    """
    An enumeration.
    """

    RECEIVED = "received"
    COLLECTING_SAMPLE = "collecting_sample"
    SAMPLE_WITH_LAB = "sample_with_lab"
    COMPLETED = "completed"
    CANCELLED = "cancelled"
    FAILED = "failed"

    def visit(
        self,
        received: typing.Callable[[], T_Result],
        collecting_sample: typing.Callable[[], T_Result],
        sample_with_lab: typing.Callable[[], T_Result],
        completed: typing.Callable[[], T_Result],
        cancelled: typing.Callable[[], T_Result],
        failed: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is OrderTopLevelStatus.RECEIVED:
            return received()
        if self is OrderTopLevelStatus.COLLECTING_SAMPLE:
            return collecting_sample()
        if self is OrderTopLevelStatus.SAMPLE_WITH_LAB:
            return sample_with_lab()
        if self is OrderTopLevelStatus.COMPLETED:
            return completed()
        if self is OrderTopLevelStatus.CANCELLED:
            return cancelled()
        if self is OrderTopLevelStatus.FAILED:
            return failed()
