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

import typing

from ..core import enum

T_Result = typing.TypeVar("T_Result")


class Operation(enum.StrEnum):
    """
    An enumeration.
    """

    READ = "READ"
    WRITE = "WRITE"

    def visit(self, read: typing.Callable[[], T_Result], write: typing.Callable[[], T_Result]) -> T_Result:
        if self is Operation.READ:
            return read()
        if self is Operation.WRITE:
            return write()
