|
2 | 2 |
|
3 | 3 | from __future__ import annotations |
4 | 4 |
|
5 | | -from typing import Union, Iterable |
6 | | -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict |
| 5 | +from typing import Union |
| 6 | +from typing_extensions import Literal, Annotated, TypeAlias, TypedDict |
7 | 7 |
|
8 | 8 | from .._types import SequenceNotStr |
9 | 9 | from .._utils import PropertyInfo |
| 10 | +from .shared_params.or_ import Or |
| 11 | +from .shared_params.and_ import And |
10 | 12 |
|
11 | | -__all__ = [ |
12 | | - "DocumentListParams", |
13 | | - "Filters", |
14 | | - "FiltersOr", |
15 | | - "FiltersOrOr", |
16 | | - "FiltersOrOrUnionMember0", |
17 | | - "FiltersOrOrOr", |
18 | | - "FiltersOrOrAnd", |
19 | | - "FiltersAnd", |
20 | | - "FiltersAndAnd", |
21 | | - "FiltersAndAndUnionMember0", |
22 | | - "FiltersAndAndOr", |
23 | | - "FiltersAndAndAnd", |
24 | | -] |
| 13 | +__all__ = ["DocumentListParams", "Filters"] |
25 | 14 |
|
26 | 15 |
|
27 | 16 | class DocumentListParams(TypedDict, total=False): |
@@ -54,58 +43,4 @@ class DocumentListParams(TypedDict, total=False): |
54 | 43 | """Field to sort by""" |
55 | 44 |
|
56 | 45 |
|
57 | | -class FiltersOrOrUnionMember0(TypedDict, total=False): |
58 | | - key: Required[str] |
59 | | - |
60 | | - value: Required[str] |
61 | | - |
62 | | - filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")] |
63 | | - |
64 | | - negate: Union[bool, Literal["true", "false"]] |
65 | | - |
66 | | - numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")] |
67 | | - |
68 | | - |
69 | | -class FiltersOrOrOr(TypedDict, total=False): |
70 | | - or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]] |
71 | | - |
72 | | - |
73 | | -class FiltersOrOrAnd(TypedDict, total=False): |
74 | | - and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]] |
75 | | - |
76 | | - |
77 | | -FiltersOrOr: TypeAlias = Union[FiltersOrOrUnionMember0, FiltersOrOrOr, FiltersOrOrAnd] |
78 | | - |
79 | | - |
80 | | -class FiltersOr(TypedDict, total=False): |
81 | | - or_: Required[Annotated[Iterable[FiltersOrOr], PropertyInfo(alias="OR")]] |
82 | | - |
83 | | - |
84 | | -class FiltersAndAndUnionMember0(TypedDict, total=False): |
85 | | - key: Required[str] |
86 | | - |
87 | | - value: Required[str] |
88 | | - |
89 | | - filter_type: Annotated[Literal["metadata", "numeric", "array_contains"], PropertyInfo(alias="filterType")] |
90 | | - |
91 | | - negate: Union[bool, Literal["true", "false"]] |
92 | | - |
93 | | - numeric_operator: Annotated[Literal[">", "<", ">=", "<=", "="], PropertyInfo(alias="numericOperator")] |
94 | | - |
95 | | - |
96 | | -class FiltersAndAndOr(TypedDict, total=False): |
97 | | - or_: Required[Annotated[Iterable[object], PropertyInfo(alias="OR")]] |
98 | | - |
99 | | - |
100 | | -class FiltersAndAndAnd(TypedDict, total=False): |
101 | | - and_: Required[Annotated[Iterable[object], PropertyInfo(alias="AND")]] |
102 | | - |
103 | | - |
104 | | -FiltersAndAnd: TypeAlias = Union[FiltersAndAndUnionMember0, FiltersAndAndOr, FiltersAndAndAnd] |
105 | | - |
106 | | - |
107 | | -class FiltersAnd(TypedDict, total=False): |
108 | | - and_: Required[Annotated[Iterable[FiltersAndAnd], PropertyInfo(alias="AND")]] |
109 | | - |
110 | | - |
111 | | -Filters: TypeAlias = Union[FiltersOr, FiltersAnd] |
| 46 | +Filters: TypeAlias = Union[Or, And] |
0 commit comments