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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .logs_filter_query_type import LogsFilterQueryType
from .logs_search_operator_type import LogsSearchOperatorType


class LogsFilterQuery(UniversalBaseModel):
    match_string: typing_extensions.Annotated[str, FieldMetadata(alias="matchString")] = pydantic.Field()
    """
    String that needs to be matched
    """

    type: LogsFilterQueryType = pydantic.Field()
    """
    query filter type, `regex` or `substring`
    """

    operator: LogsSearchOperatorType = pydantic.Field()
    """
    Comparison operator for filter. `equal` or `not_equal`
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow")  # type: ignore # Pydantic v2
    else:

        class Config:
            smart_union = True
            extra = pydantic.Extra.allow
