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

import typing

from ..core import enum

T_Result = typing.TypeVar("T_Result")


class SpanFieldFilterOperator(enum.StrEnum):
    EQUAL = "EQUAL"
    GREATER_THAN = "GREATER_THAN"
    LESS_THAN = "LESS_THAN"
    GREATER_THAN_EQUAL = "GREATER_THAN_EQUAL"
    LESS_THAN_EQUAL = "LESS_THAN_EQUAL"
    BETWEEN = "BETWEEN"
    IN = "IN"
    NOT_IN = "NOT_IN"
    STRING_CONTAINS = "STRING_CONTAINS"
    STRING_STARTS_WITH = "STRING_STARTS_WITH"
    ARRAY_HAS_ANY = "ARRAY_HAS_ANY"
    ARRAY_HAS_NONE = "ARRAY_HAS_NONE"

    def visit(
        self,
        equal: typing.Callable[[], T_Result],
        greater_than: typing.Callable[[], T_Result],
        less_than: typing.Callable[[], T_Result],
        greater_than_equal: typing.Callable[[], T_Result],
        less_than_equal: typing.Callable[[], T_Result],
        between: typing.Callable[[], T_Result],
        in_: typing.Callable[[], T_Result],
        not_in: typing.Callable[[], T_Result],
        string_contains: typing.Callable[[], T_Result],
        string_starts_with: typing.Callable[[], T_Result],
        array_has_any: typing.Callable[[], T_Result],
        array_has_none: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is SpanFieldFilterOperator.EQUAL:
            return equal()
        if self is SpanFieldFilterOperator.GREATER_THAN:
            return greater_than()
        if self is SpanFieldFilterOperator.LESS_THAN:
            return less_than()
        if self is SpanFieldFilterOperator.GREATER_THAN_EQUAL:
            return greater_than_equal()
        if self is SpanFieldFilterOperator.LESS_THAN_EQUAL:
            return less_than_equal()
        if self is SpanFieldFilterOperator.BETWEEN:
            return between()
        if self is SpanFieldFilterOperator.IN:
            return in_()
        if self is SpanFieldFilterOperator.NOT_IN:
            return not_in()
        if self is SpanFieldFilterOperator.STRING_CONTAINS:
            return string_contains()
        if self is SpanFieldFilterOperator.STRING_STARTS_WITH:
            return string_starts_with()
        if self is SpanFieldFilterOperator.ARRAY_HAS_ANY:
            return array_has_any()
        if self is SpanFieldFilterOperator.ARRAY_HAS_NONE:
            return array_has_none()
