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

import typing

from ..core import enum

T_Result = typing.TypeVar("T_Result")


class JobRunsSortBy(enum.StrEnum):
    START_TIME = "startTime"
    DURATION = "duration"
    DEPLOYMENT_VERSION = "deploymentVersion"
    TRIGGERED_BY = "triggeredBy"
    STATUS = "status"

    def visit(
        self,
        start_time: typing.Callable[[], T_Result],
        duration: typing.Callable[[], T_Result],
        deployment_version: typing.Callable[[], T_Result],
        triggered_by: typing.Callable[[], T_Result],
        status: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is JobRunsSortBy.START_TIME:
            return start_time()
        if self is JobRunsSortBy.DURATION:
            return duration()
        if self is JobRunsSortBy.DEPLOYMENT_VERSION:
            return deployment_version()
        if self is JobRunsSortBy.TRIGGERED_BY:
            return triggered_by()
        if self is JobRunsSortBy.STATUS:
            return status()
