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

import typing

from ..core import enum

T_Result = typing.TypeVar("T_Result")


class LogsSearchFilterType(enum.StrEnum):
    """
    Query filter type for logs search
    """

    REGEX = "regex"
    SUBSTRING = "substring"
    IGNORE_CASE_SUBSTRING = "ignore_case_substring"

    def visit(
        self,
        regex: typing.Callable[[], T_Result],
        substring: typing.Callable[[], T_Result],
        ignore_case_substring: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is LogsSearchFilterType.REGEX:
            return regex()
        if self is LogsSearchFilterType.SUBSTRING:
            return substring()
        if self is LogsSearchFilterType.IGNORE_CASE_SUBSTRING:
            return ignore_case_substring()
