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

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class ContinuousQueryTaskStatus(str, enum.Enum):
    """
    This has to match the `continuous_query_task_status` enum type in postgres. ℹ️ This enum is non-exhaustive.
    """

    SCHEDULED = "scheduled"
    STARTED = "started"
    COMPLETED = "completed"
    ERROR = "error"

    def visit(
        self,
        scheduled: typing.Callable[[], T_Result],
        started: typing.Callable[[], T_Result],
        completed: typing.Callable[[], T_Result],
        error: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is ContinuousQueryTaskStatus.SCHEDULED:
            return scheduled()
        if self is ContinuousQueryTaskStatus.STARTED:
            return started()
        if self is ContinuousQueryTaskStatus.COMPLETED:
            return completed()
        if self is ContinuousQueryTaskStatus.ERROR:
            return error()
