from typing import List, Any, Literal
from pydantic import BaseModel

class FilterConstraint(BaseModel):
    value: Any
    matchMode: Literal[
        "startsWith", "contains", "endsWith",
        "equals", "notEquals", "in", "lt", "lte", "gt", "gte"
    ]

class FieldFilter(BaseModel):
    operator: Literal["and", "or"] = "and"
    constraints: List[FilterConstraint]