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

import typing

from ..core import enum

T_Result = typing.TypeVar("T_Result")


class BuildStatus(enum.StrEnum):
    STARTED = "STARTED"
    SUCCEEDED = "SUCCEEDED"
    FAILED = "FAILED"

    def visit(
        self,
        started: typing.Callable[[], T_Result],
        succeeded: typing.Callable[[], T_Result],
        failed: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is BuildStatus.STARTED:
            return started()
        if self is BuildStatus.SUCCEEDED:
            return succeeded()
        if self is BuildStatus.FAILED:
            return failed()
