mixpeek 0.15.1__py3-none-any.whl → 0.16.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mixpeek/_hooks/__init__.py +0 -1
- mixpeek/_hooks/sdkhooks.py +0 -2
- mixpeek/_version.py +1 -1
- mixpeek/assets.py +74 -56
- mixpeek/collections.py +46 -40
- mixpeek/{featureextractors.py → feature_extractors.py} +6 -6
- mixpeek/feature_search.py +330 -0
- mixpeek/features.py +44 -356
- mixpeek/health.py +3 -15
- mixpeek/{ingest.py → ingest_assets.py} +43 -25
- mixpeek/models/__init__.py +291 -160
- mixpeek/models/assignmentconfig.py +25 -0
- mixpeek/models/availablemodels.py +2 -1
- mixpeek/models/{availableindexesresponse.py → availablemodelsresponse.py} +8 -4
- mixpeek/models/classificationmatch.py +72 -0
- mixpeek/models/classificationwithfeature.py +73 -0
- mixpeek/models/classify_features_v1_entities_taxonomies_taxonomy_classify_postop.py +73 -0
- mixpeek/models/{create_api_key_organizations_users_user_email_api_keys_postop.py → create_api_key_v1_organizations_users_user_email_api_keys_postop.py} +2 -2
- mixpeek/models/{create_collection_collections_postop.py → create_collection_v1_collections_postop.py} +2 -2
- mixpeek/models/create_taxonomy_v1_entities_taxonomies_postop.py +59 -0
- mixpeek/models/createnamespacerequest.py +2 -2
- mixpeek/models/{delete_api_key_organizations_users_user_email_api_keys_key_name_deleteop.py → delete_api_key_v1_organizations_users_user_email_api_keys_key_name_deleteop.py} +2 -2
- mixpeek/models/{delete_asset_assets_asset_id_deleteop.py → delete_asset_v1_assets_asset_id_deleteop.py} +2 -2
- mixpeek/models/delete_classifications_v1_entities_taxonomies_taxonomy_classifications_classification_id_deleteop.py +70 -0
- mixpeek/models/{delete_collection_collections_collection_deleteop.py → delete_collection_v1_collections_collection_deleteop.py} +2 -2
- mixpeek/models/{delete_feature_features_feature_id_deleteop.py → delete_feature_v1_features_feature_id_deleteop.py} +2 -2
- mixpeek/models/{delete_namespace_namespaces_namespace_deleteop.py → delete_namespace_v1_namespaces_namespace_deleteop.py} +2 -2
- mixpeek/models/delete_taxonomy_v1_entities_taxonomies_taxonomy_deleteop.py +59 -0
- mixpeek/models/{delete_user_organizations_users_user_email_deleteop.py → delete_user_v1_organizations_users_user_email_deleteop.py} +2 -2
- mixpeek/models/discoverrequest.py +74 -0
- mixpeek/models/embeddingconfig.py +33 -0
- mixpeek/models/embeddingrequest.py +40 -7
- mixpeek/models/featureoptions.py +25 -0
- mixpeek/models/{full_asset_update_assets_asset_id_putop.py → full_asset_update_v1_assets_asset_id_putop.py} +2 -2
- mixpeek/models/{full_feature_update_features_feature_id_putop.py → full_feature_update_v1_features_feature_id_putop.py} +2 -2
- mixpeek/models/genericsuccessresponse.py +17 -0
- mixpeek/models/{get_asset_assets_asset_id_getop.py → get_asset_v1_assets_asset_id_getop.py} +2 -2
- mixpeek/models/{get_asset_with_features_assets_asset_id_features_getop.py → get_asset_with_features_v1_assets_asset_id_features_getop.py} +2 -2
- mixpeek/models/{get_collection_collections_collection_getop.py → get_collection_v1_collections_collection_getop.py} +2 -2
- mixpeek/models/{get_feature_features_feature_id_getop.py → get_feature_v1_features_feature_id_getop.py} +2 -2
- mixpeek/models/{get_namespace_namespaces_namespace_getop.py → get_namespace_v1_namespaces_namespace_getop.py} +2 -2
- mixpeek/models/{get_task_tasks_task_id_getop.py → get_task_v1_tasks_task_id_getop.py} +2 -2
- mixpeek/models/get_taxonomy_node_v1_entities_taxonomies_nodes_node_getop.py +59 -0
- mixpeek/models/get_taxonomy_v1_entities_taxonomies_taxonomy_getop.py +59 -0
- mixpeek/models/{get_user_organizations_users_user_email_getop.py → get_user_v1_organizations_users_user_email_getop.py} +2 -2
- mixpeek/models/{ingest_image_url_ingest_images_url_postop.py → ingest_image_url_v1_ingest_images_url_postop.py} +2 -2
- mixpeek/models/{ingest_text_ingest_text_postop.py → ingest_text_v1_ingest_text_postop.py} +2 -2
- mixpeek/models/{ingest_video_url_ingest_videos_url_postop.py → ingest_video_url_v1_ingest_videos_url_postop.py} +2 -2
- mixpeek/models/{kill_task_tasks_task_id_deleteop.py → kill_task_v1_tasks_task_id_deleteop.py} +2 -2
- mixpeek/models/{list_assets_assets_postop.py → list_assets_v1_assets_postop.py} +2 -2
- mixpeek/models/list_classifications_v1_entities_taxonomies_taxonomy_classifications_postop.py +92 -0
- mixpeek/models/{list_collections_collections_getop.py → list_collections_v1_collections_getop.py} +2 -2
- mixpeek/models/{list_features_features_postop.py → list_features_v1_features_postop.py} +2 -2
- mixpeek/models/list_taxonomies_v1_entities_taxonomies_getop.py +67 -0
- mixpeek/models/listclassificationsrequest.py +69 -0
- mixpeek/models/listclassificationsresponse.py +31 -0
- mixpeek/models/listtaxonomiesresponse.py +24 -0
- mixpeek/models/modeldetails.py +9 -5
- mixpeek/models/nodeoptions.py +16 -0
- mixpeek/models/nodeupdate.py +51 -0
- mixpeek/models/{partial_asset_update_assets_asset_id_patchop.py → partial_asset_update_v1_assets_asset_id_patchop.py} +2 -2
- mixpeek/models/permission.py +12 -0
- mixpeek/models/{search_assets_assets_search_postop.py → search_assets_v1_assets_search_postop.py} +2 -2
- mixpeek/models/{search_features_features_search_postop.py → search_features_v1_features_search_postop.py} +4 -4
- mixpeek/models/taxonomycreate.py +20 -0
- mixpeek/models/taxonomymodel.py +27 -0
- mixpeek/models/taxonomynode.py +101 -0
- mixpeek/models/taxonomynodecreate.py +63 -0
- mixpeek/models/taxonomyupdate.py +55 -0
- mixpeek/models/{update_api_key_organizations_users_user_email_api_keys_key_name_patchop.py → update_api_key_v1_organizations_users_user_email_api_keys_key_name_patchop.py} +2 -2
- mixpeek/models/{update_collection_collections_collection_putop.py → update_collection_v1_collections_collection_putop.py} +2 -2
- mixpeek/models/{update_namespace_namespaces_namespace_putop.py → update_namespace_v1_namespaces_namespace_putop.py} +2 -2
- mixpeek/models/update_node_v1_entities_taxonomies_nodes_node_patchop.py +71 -0
- mixpeek/models/update_taxonomy_v1_entities_taxonomies_taxonomy_patchop.py +71 -0
- mixpeek/models/vectormodel.py +1 -0
- mixpeek/namespaces.py +56 -56
- mixpeek/organizations.py +82 -58
- mixpeek/sdk.py +12 -6
- mixpeek/sdkconfiguration.py +4 -4
- mixpeek/tasks.py +22 -16
- mixpeek/taxonomy_entities.py +2214 -0
- {mixpeek-0.15.1.dist-info → mixpeek-0.16.0.dist-info}/METADATA +64 -49
- {mixpeek-0.15.1.dist-info → mixpeek-0.16.0.dist-info}/RECORD +84 -55
- {mixpeek-0.15.1.dist-info → mixpeek-0.16.0.dist-info}/WHEEL +1 -1
@@ -0,0 +1,330 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from .basesdk import BaseSDK
|
4
|
+
from mixpeek import models, utils
|
5
|
+
from mixpeek._hooks import HookContext
|
6
|
+
from mixpeek.types import OptionalNullable, UNSET
|
7
|
+
from mixpeek.utils import get_security_from_env
|
8
|
+
from typing import Any, List, Mapping, Optional, Union
|
9
|
+
|
10
|
+
|
11
|
+
class FeatureSearch(BaseSDK):
|
12
|
+
def search_features_v1_features_search_post(
|
13
|
+
self,
|
14
|
+
*,
|
15
|
+
queries: Union[
|
16
|
+
List[models.SearchModelSearchQuery],
|
17
|
+
List[models.SearchModelSearchQueryTypedDict],
|
18
|
+
],
|
19
|
+
collections: List[str],
|
20
|
+
offset_position: OptionalNullable[int] = UNSET,
|
21
|
+
page_size: Optional[int] = 10,
|
22
|
+
x_namespace: OptionalNullable[str] = UNSET,
|
23
|
+
filters: OptionalNullable[
|
24
|
+
Union[models.LogicalOperator, models.LogicalOperatorTypedDict]
|
25
|
+
] = UNSET,
|
26
|
+
group_by: OptionalNullable[
|
27
|
+
Union[models.GroupByOptions, models.GroupByOptionsTypedDict]
|
28
|
+
] = UNSET,
|
29
|
+
sort: OptionalNullable[
|
30
|
+
Union[models.SortOption, models.SortOptionTypedDict]
|
31
|
+
] = UNSET,
|
32
|
+
select: OptionalNullable[List[str]] = UNSET,
|
33
|
+
reranking_options: OptionalNullable[
|
34
|
+
Union[models.RerankingOptions, models.RerankingOptionsTypedDict]
|
35
|
+
] = UNSET,
|
36
|
+
session_id: OptionalNullable[str] = UNSET,
|
37
|
+
return_url: OptionalNullable[bool] = UNSET,
|
38
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
39
|
+
server_url: Optional[str] = None,
|
40
|
+
timeout_ms: Optional[int] = None,
|
41
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
42
|
+
) -> models.SearchFeaturesV1FeaturesSearchPostResponseSearchFeaturesV1FeaturesSearchPost:
|
43
|
+
r"""Search Features
|
44
|
+
|
45
|
+
This endpoint allows you to search features.
|
46
|
+
|
47
|
+
:param queries: List of search queries to perform. Behavior: - Single query: Results are returned directly from that query - Multiple queries: Results are combined using Reciprocal Rank Fusion (RRF) RRF combines results from multiple queries by: 1. Taking each item's rank position in each result list 2. Re-ranking all items by their combined RRF scores When merging lists from different sources, RRF considers all items that appear in any of the input lists, not just items that appear in all lists. This helps surface items that rank well across multiple queries while reducing the impact of outlier high rankings in single queries. NOTE: If query array is empty, it will return all features.
|
48
|
+
:param collections: List of Collection names to search within, required
|
49
|
+
:param offset_position: The position to start returning results from. Used for pagination. Does not work with group_by
|
50
|
+
:param page_size: Number of results to return per page.
|
51
|
+
:param x_namespace: Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint.
|
52
|
+
:param filters: Used for filtering across all indexes
|
53
|
+
:param group_by: Grouping options for search results
|
54
|
+
:param sort: List of fields to sort by, with direction (asc or desc). Supports dot notation for nested fields.
|
55
|
+
:param select: List of fields to return in results, supports dot notation. If None, all fields are returned.
|
56
|
+
:param reranking_options: Options for ranking the search results, including weights and feedback application
|
57
|
+
:param session_id: Identifier for tracking search session interactions
|
58
|
+
:param return_url: Return the presigned URL for the asset and preview asset, this will introduce additional latency
|
59
|
+
:param retries: Override the default retry configuration for this method
|
60
|
+
:param server_url: Override the default server URL for this method
|
61
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
62
|
+
:param http_headers: Additional headers to set or replace on requests.
|
63
|
+
"""
|
64
|
+
base_url = None
|
65
|
+
url_variables = None
|
66
|
+
if timeout_ms is None:
|
67
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
68
|
+
|
69
|
+
if server_url is not None:
|
70
|
+
base_url = server_url
|
71
|
+
|
72
|
+
request = models.SearchFeaturesV1FeaturesSearchPostRequest(
|
73
|
+
offset_position=offset_position,
|
74
|
+
page_size=page_size,
|
75
|
+
x_namespace=x_namespace,
|
76
|
+
search_request_features=models.SearchRequestFeatures(
|
77
|
+
queries=utils.get_pydantic_model(
|
78
|
+
queries, List[models.SearchModelSearchQuery]
|
79
|
+
),
|
80
|
+
collections=collections,
|
81
|
+
filters=utils.get_pydantic_model(
|
82
|
+
filters, OptionalNullable[models.LogicalOperator]
|
83
|
+
),
|
84
|
+
group_by=utils.get_pydantic_model(
|
85
|
+
group_by, OptionalNullable[models.GroupByOptions]
|
86
|
+
),
|
87
|
+
sort=utils.get_pydantic_model(
|
88
|
+
sort, OptionalNullable[models.SortOption]
|
89
|
+
),
|
90
|
+
select=select,
|
91
|
+
reranking_options=utils.get_pydantic_model(
|
92
|
+
reranking_options, OptionalNullable[models.RerankingOptions]
|
93
|
+
),
|
94
|
+
session_id=session_id,
|
95
|
+
return_url=return_url,
|
96
|
+
),
|
97
|
+
)
|
98
|
+
|
99
|
+
req = self._build_request(
|
100
|
+
method="POST",
|
101
|
+
path="/v1/features/search",
|
102
|
+
base_url=base_url,
|
103
|
+
url_variables=url_variables,
|
104
|
+
request=request,
|
105
|
+
request_body_required=True,
|
106
|
+
request_has_path_params=False,
|
107
|
+
request_has_query_params=True,
|
108
|
+
user_agent_header="user-agent",
|
109
|
+
accept_header_value="application/json",
|
110
|
+
http_headers=http_headers,
|
111
|
+
security=self.sdk_configuration.security,
|
112
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
113
|
+
request.search_request_features,
|
114
|
+
False,
|
115
|
+
False,
|
116
|
+
"json",
|
117
|
+
models.SearchRequestFeatures,
|
118
|
+
),
|
119
|
+
timeout_ms=timeout_ms,
|
120
|
+
)
|
121
|
+
|
122
|
+
if retries == UNSET:
|
123
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
124
|
+
retries = self.sdk_configuration.retry_config
|
125
|
+
|
126
|
+
retry_config = None
|
127
|
+
if isinstance(retries, utils.RetryConfig):
|
128
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
129
|
+
|
130
|
+
http_res = self.do_request(
|
131
|
+
hook_ctx=HookContext(
|
132
|
+
operation_id="search_features_v1_features_search_post",
|
133
|
+
oauth2_scopes=[],
|
134
|
+
security_source=get_security_from_env(
|
135
|
+
self.sdk_configuration.security, models.Security
|
136
|
+
),
|
137
|
+
),
|
138
|
+
request=req,
|
139
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
140
|
+
retry_config=retry_config,
|
141
|
+
)
|
142
|
+
|
143
|
+
data: Any = None
|
144
|
+
if utils.match_response(http_res, "200", "application/json"):
|
145
|
+
return utils.unmarshal_json(
|
146
|
+
http_res.text,
|
147
|
+
models.SearchFeaturesV1FeaturesSearchPostResponseSearchFeaturesV1FeaturesSearchPost,
|
148
|
+
)
|
149
|
+
if utils.match_response(
|
150
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
151
|
+
):
|
152
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
153
|
+
raise models.ErrorResponse(data=data)
|
154
|
+
if utils.match_response(http_res, "422", "application/json"):
|
155
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
156
|
+
raise models.HTTPValidationError(data=data)
|
157
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
158
|
+
http_res_text = utils.stream_to_text(http_res)
|
159
|
+
raise models.APIError(
|
160
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
161
|
+
)
|
162
|
+
|
163
|
+
content_type = http_res.headers.get("Content-Type")
|
164
|
+
http_res_text = utils.stream_to_text(http_res)
|
165
|
+
raise models.APIError(
|
166
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
167
|
+
http_res.status_code,
|
168
|
+
http_res_text,
|
169
|
+
http_res,
|
170
|
+
)
|
171
|
+
|
172
|
+
async def search_features_v1_features_search_post_async(
|
173
|
+
self,
|
174
|
+
*,
|
175
|
+
queries: Union[
|
176
|
+
List[models.SearchModelSearchQuery],
|
177
|
+
List[models.SearchModelSearchQueryTypedDict],
|
178
|
+
],
|
179
|
+
collections: List[str],
|
180
|
+
offset_position: OptionalNullable[int] = UNSET,
|
181
|
+
page_size: Optional[int] = 10,
|
182
|
+
x_namespace: OptionalNullable[str] = UNSET,
|
183
|
+
filters: OptionalNullable[
|
184
|
+
Union[models.LogicalOperator, models.LogicalOperatorTypedDict]
|
185
|
+
] = UNSET,
|
186
|
+
group_by: OptionalNullable[
|
187
|
+
Union[models.GroupByOptions, models.GroupByOptionsTypedDict]
|
188
|
+
] = UNSET,
|
189
|
+
sort: OptionalNullable[
|
190
|
+
Union[models.SortOption, models.SortOptionTypedDict]
|
191
|
+
] = UNSET,
|
192
|
+
select: OptionalNullable[List[str]] = UNSET,
|
193
|
+
reranking_options: OptionalNullable[
|
194
|
+
Union[models.RerankingOptions, models.RerankingOptionsTypedDict]
|
195
|
+
] = UNSET,
|
196
|
+
session_id: OptionalNullable[str] = UNSET,
|
197
|
+
return_url: OptionalNullable[bool] = UNSET,
|
198
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
199
|
+
server_url: Optional[str] = None,
|
200
|
+
timeout_ms: Optional[int] = None,
|
201
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
202
|
+
) -> models.SearchFeaturesV1FeaturesSearchPostResponseSearchFeaturesV1FeaturesSearchPost:
|
203
|
+
r"""Search Features
|
204
|
+
|
205
|
+
This endpoint allows you to search features.
|
206
|
+
|
207
|
+
:param queries: List of search queries to perform. Behavior: - Single query: Results are returned directly from that query - Multiple queries: Results are combined using Reciprocal Rank Fusion (RRF) RRF combines results from multiple queries by: 1. Taking each item's rank position in each result list 2. Re-ranking all items by their combined RRF scores When merging lists from different sources, RRF considers all items that appear in any of the input lists, not just items that appear in all lists. This helps surface items that rank well across multiple queries while reducing the impact of outlier high rankings in single queries. NOTE: If query array is empty, it will return all features.
|
208
|
+
:param collections: List of Collection names to search within, required
|
209
|
+
:param offset_position: The position to start returning results from. Used for pagination. Does not work with group_by
|
210
|
+
:param page_size: Number of results to return per page.
|
211
|
+
:param x_namespace: Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint.
|
212
|
+
:param filters: Used for filtering across all indexes
|
213
|
+
:param group_by: Grouping options for search results
|
214
|
+
:param sort: List of fields to sort by, with direction (asc or desc). Supports dot notation for nested fields.
|
215
|
+
:param select: List of fields to return in results, supports dot notation. If None, all fields are returned.
|
216
|
+
:param reranking_options: Options for ranking the search results, including weights and feedback application
|
217
|
+
:param session_id: Identifier for tracking search session interactions
|
218
|
+
:param return_url: Return the presigned URL for the asset and preview asset, this will introduce additional latency
|
219
|
+
:param retries: Override the default retry configuration for this method
|
220
|
+
:param server_url: Override the default server URL for this method
|
221
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
222
|
+
:param http_headers: Additional headers to set or replace on requests.
|
223
|
+
"""
|
224
|
+
base_url = None
|
225
|
+
url_variables = None
|
226
|
+
if timeout_ms is None:
|
227
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
228
|
+
|
229
|
+
if server_url is not None:
|
230
|
+
base_url = server_url
|
231
|
+
|
232
|
+
request = models.SearchFeaturesV1FeaturesSearchPostRequest(
|
233
|
+
offset_position=offset_position,
|
234
|
+
page_size=page_size,
|
235
|
+
x_namespace=x_namespace,
|
236
|
+
search_request_features=models.SearchRequestFeatures(
|
237
|
+
queries=utils.get_pydantic_model(
|
238
|
+
queries, List[models.SearchModelSearchQuery]
|
239
|
+
),
|
240
|
+
collections=collections,
|
241
|
+
filters=utils.get_pydantic_model(
|
242
|
+
filters, OptionalNullable[models.LogicalOperator]
|
243
|
+
),
|
244
|
+
group_by=utils.get_pydantic_model(
|
245
|
+
group_by, OptionalNullable[models.GroupByOptions]
|
246
|
+
),
|
247
|
+
sort=utils.get_pydantic_model(
|
248
|
+
sort, OptionalNullable[models.SortOption]
|
249
|
+
),
|
250
|
+
select=select,
|
251
|
+
reranking_options=utils.get_pydantic_model(
|
252
|
+
reranking_options, OptionalNullable[models.RerankingOptions]
|
253
|
+
),
|
254
|
+
session_id=session_id,
|
255
|
+
return_url=return_url,
|
256
|
+
),
|
257
|
+
)
|
258
|
+
|
259
|
+
req = self._build_request_async(
|
260
|
+
method="POST",
|
261
|
+
path="/v1/features/search",
|
262
|
+
base_url=base_url,
|
263
|
+
url_variables=url_variables,
|
264
|
+
request=request,
|
265
|
+
request_body_required=True,
|
266
|
+
request_has_path_params=False,
|
267
|
+
request_has_query_params=True,
|
268
|
+
user_agent_header="user-agent",
|
269
|
+
accept_header_value="application/json",
|
270
|
+
http_headers=http_headers,
|
271
|
+
security=self.sdk_configuration.security,
|
272
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
273
|
+
request.search_request_features,
|
274
|
+
False,
|
275
|
+
False,
|
276
|
+
"json",
|
277
|
+
models.SearchRequestFeatures,
|
278
|
+
),
|
279
|
+
timeout_ms=timeout_ms,
|
280
|
+
)
|
281
|
+
|
282
|
+
if retries == UNSET:
|
283
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
284
|
+
retries = self.sdk_configuration.retry_config
|
285
|
+
|
286
|
+
retry_config = None
|
287
|
+
if isinstance(retries, utils.RetryConfig):
|
288
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
289
|
+
|
290
|
+
http_res = await self.do_request_async(
|
291
|
+
hook_ctx=HookContext(
|
292
|
+
operation_id="search_features_v1_features_search_post",
|
293
|
+
oauth2_scopes=[],
|
294
|
+
security_source=get_security_from_env(
|
295
|
+
self.sdk_configuration.security, models.Security
|
296
|
+
),
|
297
|
+
),
|
298
|
+
request=req,
|
299
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
300
|
+
retry_config=retry_config,
|
301
|
+
)
|
302
|
+
|
303
|
+
data: Any = None
|
304
|
+
if utils.match_response(http_res, "200", "application/json"):
|
305
|
+
return utils.unmarshal_json(
|
306
|
+
http_res.text,
|
307
|
+
models.SearchFeaturesV1FeaturesSearchPostResponseSearchFeaturesV1FeaturesSearchPost,
|
308
|
+
)
|
309
|
+
if utils.match_response(
|
310
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
311
|
+
):
|
312
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
313
|
+
raise models.ErrorResponse(data=data)
|
314
|
+
if utils.match_response(http_res, "422", "application/json"):
|
315
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
316
|
+
raise models.HTTPValidationError(data=data)
|
317
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
318
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
319
|
+
raise models.APIError(
|
320
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
321
|
+
)
|
322
|
+
|
323
|
+
content_type = http_res.headers.get("Content-Type")
|
324
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
325
|
+
raise models.APIError(
|
326
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
327
|
+
http_res.status_code,
|
328
|
+
http_res_text,
|
329
|
+
http_res,
|
330
|
+
)
|