"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from openrouter.types import BaseModel, Nullable, UnrecognizedStr
from openrouter.utils import validate_open_enum
from pydantic.functional_validators import PlainValidator
from typing import Any, Dict, List, Literal, Union
from typing_extensions import Annotated, TypedDict


CompoundFilterType = Union[
    Literal[
        "and",
        "or",
    ],
    UnrecognizedStr,
]


class CompoundFilterTypedDict(TypedDict):
    r"""A compound filter that combines multiple comparison or compound filters"""

    type: CompoundFilterType
    filters: List[Dict[str, Nullable[Any]]]


class CompoundFilter(BaseModel):
    r"""A compound filter that combines multiple comparison or compound filters"""

    type: Annotated[CompoundFilterType, PlainValidator(validate_open_enum(False))]

    filters: List[Dict[str, Nullable[Any]]]
