|
| 1 | +from __future__ import annotations |
| 2 | + |
1 | 3 | from datetime import datetime |
2 | 4 | from typing import List |
3 | 5 | from typing import Optional |
@@ -32,6 +34,17 @@ class SearchFilterGroup(ResponseModel): |
32 | 34 | ) |
33 | 35 |
|
34 | 36 |
|
| 37 | +class SearchFilterGroupV2(ResponseModel): |
| 38 | + subgroup_clause: Optional[str] = Field( |
| 39 | + alias="subgroupClause", |
| 40 | + description="Grouping clause for subgroups.", |
| 41 | + example="AND", |
| 42 | + ) |
| 43 | + subgroups: Optional[List[Union[SearchFilterGroup, SearchFilterGroupV2]]] = Field( |
| 44 | + description="One or more FilterGroups to be combined in a query, or a FilterSubgroupV2" |
| 45 | + ) |
| 46 | + |
| 47 | + |
35 | 48 | class QueryProblem(ResponseModel): |
36 | 49 | """ |
37 | 50 | A model containing data on a query problem. |
@@ -99,7 +112,7 @@ class SavedSearch(ResponseModel): |
99 | 112 | * **created_by_username**: `str` - The username of the user who created the saved search. |
100 | 113 | * **creation_timestamp**: `datetime` - The time at which the saved search was created. |
101 | 114 | * **group_clause**: `GroupClause` - `AND` or `OR`. Grouping clause for any specified groups. Defaults to `AND`. |
102 | | - * **groups**: `List[SearchFilterGroup]` - One or more FilterGroups to be combined in a query. |
| 115 | + * **groups**: `List[Union[SearchFilterGroup, SearchFilterGroupV2]]` - One or more FilterGroups or FilterGroupV2s to be combined in a query. |
103 | 116 | * **id**: `str` - The ID for the saved search. |
104 | 117 | * **modified_by_uid**: `str` - The ID of the user who last modified the saved search. |
105 | 118 | * **modified_by_username**: `str` - The username of the user who last modified the saved search. |
@@ -139,7 +152,7 @@ class SavedSearch(ResponseModel): |
139 | 152 | description="Grouping clause for any specified groups.", |
140 | 153 | example="OR", |
141 | 154 | ) |
142 | | - groups: Optional[List[SearchFilterGroup]] = Field( |
| 155 | + groups: Optional[List[Union[SearchFilterGroup, SearchFilterGroupV2]]] = Field( |
143 | 156 | description="One or more FilterGroups to be combined in a query." |
144 | 157 | ) |
145 | 158 | id: Optional[str] = Field( |
|
0 commit comments