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

import typing

from ..core import enum

T_Result = typing.TypeVar("T_Result")


class CustomGuardrailConfigOperation(enum.StrEnum):
    """
    The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests.
    Validate guardrails are run in parallel while mutate guardrails are run sequentially.
    """

    VALIDATE = "validate"
    MUTATE = "mutate"

    def visit(self, validate: typing.Callable[[], T_Result], mutate: typing.Callable[[], T_Result]) -> T_Result:
        if self is CustomGuardrailConfigOperation.VALIDATE:
            return validate()
        if self is CustomGuardrailConfigOperation.MUTATE:
            return mutate()
