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

import typing

from ..core import enum

T_Result = typing.TypeVar("T_Result")


class SpanAttributeFilterOperator(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"
    STRING_ENDS_WITH = "STRING_ENDS_WITH"
    ARRAY_HAS_ANY = "ARRAY_HAS_ANY"
    ARRAY_HAS_NONE = "ARRAY_HAS_NONE"
    PRESENT = "PRESENT"
    _UNKNOWN = "__SPANATTRIBUTEFILTEROPERATOR_UNKNOWN__"
    """
    This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`.
    """

    @classmethod
    def _missing_(cls, value: typing.Any) -> "SpanAttributeFilterOperator":
        unknown = cls._UNKNOWN
        unknown._value_ = value
        return unknown

    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],
        string_ends_with: typing.Callable[[], T_Result],
        array_has_any: typing.Callable[[], T_Result],
        array_has_none: typing.Callable[[], T_Result],
        present: typing.Callable[[], T_Result],
        _unknown_member: typing.Callable[[str], T_Result],
    ) -> T_Result:
        if self is SpanAttributeFilterOperator.EQUAL:
            return equal()
        if self is SpanAttributeFilterOperator.GREATER_THAN:
            return greater_than()
        if self is SpanAttributeFilterOperator.LESS_THAN:
            return less_than()
        if self is SpanAttributeFilterOperator.GREATER_THAN_EQUAL:
            return greater_than_equal()
        if self is SpanAttributeFilterOperator.LESS_THAN_EQUAL:
            return less_than_equal()
        if self is SpanAttributeFilterOperator.BETWEEN:
            return between()
        if self is SpanAttributeFilterOperator.IN:
            return in_()
        if self is SpanAttributeFilterOperator.NOT_IN:
            return not_in()
        if self is SpanAttributeFilterOperator.STRING_CONTAINS:
            return string_contains()
        if self is SpanAttributeFilterOperator.STRING_STARTS_WITH:
            return string_starts_with()
        if self is SpanAttributeFilterOperator.STRING_ENDS_WITH:
            return string_ends_with()
        if self is SpanAttributeFilterOperator.ARRAY_HAS_ANY:
            return array_has_any()
        if self is SpanAttributeFilterOperator.ARRAY_HAS_NONE:
            return array_has_none()
        if self is SpanAttributeFilterOperator.PRESENT:
            return present()
        return _unknown_member(self._value_)
