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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Filter(UniversalBaseModel):
    id: typing.Optional[int] = None
    index: typing.Optional[int] = pydantic.Field(default=None)
    """
    To keep filter order
    """

    column: str = pydantic.Field()
    """
    Field name
    """

    type: str = pydantic.Field()
    """
    Field type
    """

    operator: str = pydantic.Field()
    """
    Filter operator
    """

    value: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    Filter value
    """

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

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