mixpeek 0.12.0__py3-none-any.whl → 0.13__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/__init__.py +5 -79
- mixpeek/_hooks/__init__.py +5 -0
- mixpeek/_hooks/registration.py +13 -0
- mixpeek/_hooks/sdkhooks.py +76 -0
- mixpeek/_hooks/types.py +94 -0
- mixpeek/_version.py +11 -3
- mixpeek/assets.py +1561 -0
- mixpeek/basesdk.py +350 -0
- mixpeek/collections.py +1029 -0
- mixpeek/featureextractors.py +205 -0
- mixpeek/features.py +1181 -0
- mixpeek/health.py +167 -0
- mixpeek/httpclient.py +84 -0
- mixpeek/ingest.py +831 -0
- mixpeek/interactions.py +221 -0
- mixpeek/models/__init__.py +751 -0
- mixpeek/models/actionusage.py +16 -0
- mixpeek/models/apierror.py +22 -0
- mixpeek/models/apikey.py +25 -0
- mixpeek/models/apikeyupdate.py +49 -0
- mixpeek/models/assetfeatures.py +55 -0
- mixpeek/models/assetresponse.py +166 -0
- mixpeek/models/assets_model_searchquery.py +21 -0
- mixpeek/models/assetupdate.py +28 -0
- mixpeek/models/availableindexesresponse.py +23 -0
- mixpeek/models/availablemodels.py +12 -0
- mixpeek/models/boolindexparams.py +18 -0
- mixpeek/models/collectionmodel.py +70 -0
- mixpeek/models/collectionresult.py +73 -0
- mixpeek/models/create_api_key_organizations_users_user_email_api_keys_postop.py +23 -0
- mixpeek/models/create_collection_collections_postop.py +62 -0
- mixpeek/models/create_interaction_features_search_interactions_postop.py +59 -0
- mixpeek/models/createcollectionrequest.py +59 -0
- mixpeek/models/createnamespacerequest.py +62 -0
- mixpeek/models/datetimeindexparams.py +18 -0
- mixpeek/models/dateusage.py +22 -0
- mixpeek/models/db_model_paginationresponse.py +59 -0
- mixpeek/models/db_model_taskresponse.py +20 -0
- mixpeek/models/delete_api_key_organizations_users_user_email_api_keys_key_name_deleteop.py +23 -0
- mixpeek/models/delete_asset_assets_asset_id_deleteop.py +57 -0
- mixpeek/models/delete_collection_collections_collection_deleteop.py +59 -0
- mixpeek/models/delete_feature_features_feature_id_deleteop.py +57 -0
- mixpeek/models/delete_interaction_features_search_interactions_interaction_id_deleteop.py +59 -0
- mixpeek/models/delete_namespace_namespaces_namespace_deleteop.py +18 -0
- mixpeek/models/delete_user_organizations_users_user_email_deleteop.py +16 -0
- mixpeek/models/denseembedding.py +16 -0
- mixpeek/models/embeddingrequest.py +59 -0
- mixpeek/models/embeddingresponse.py +64 -0
- mixpeek/models/errormessage.py +13 -0
- mixpeek/models/errorresponse.py +21 -0
- mixpeek/models/facedetectsettings.py +52 -0
- mixpeek/models/featureextractionembeddingrequest.py +54 -0
- mixpeek/models/featureresponse.py +74 -0
- mixpeek/models/features_model_paginationresponse.py +59 -0
- mixpeek/models/featureupdaterequest.py +21 -0
- mixpeek/models/filtercondition.py +74 -0
- mixpeek/models/floatindexparams.py +18 -0
- mixpeek/models/full_asset_update_assets_asset_id_putop.py +69 -0
- mixpeek/models/full_feature_update_features_feature_id_putop.py +69 -0
- mixpeek/models/geoindexparams.py +18 -0
- mixpeek/models/get_asset_assets_asset_id_getop.py +73 -0
- mixpeek/models/get_asset_with_features_assets_asset_id_features_getop.py +73 -0
- mixpeek/models/get_collection_collections_collection_getop.py +59 -0
- mixpeek/models/get_feature_features_feature_id_getop.py +70 -0
- mixpeek/models/get_interaction_features_search_interactions_interaction_id_getop.py +59 -0
- mixpeek/models/get_namespace_namespaces_namespace_getop.py +18 -0
- mixpeek/models/get_task_tasks_task_id_getop.py +57 -0
- mixpeek/models/get_user_organizations_users_user_email_getop.py +16 -0
- mixpeek/models/groupbyoptions.py +71 -0
- mixpeek/models/groupbyoptionsasset.py +71 -0
- mixpeek/models/groupedassetdata.py +18 -0
- mixpeek/models/healthcheckresponse.py +13 -0
- mixpeek/models/httpvalidationerror.py +21 -0
- mixpeek/models/imagedescribesettings.py +82 -0
- mixpeek/models/imagedetectsettings.py +53 -0
- mixpeek/models/imagereadsettings.py +71 -0
- mixpeek/models/imagesettings.py +79 -0
- mixpeek/models/ingest_image_url_ingest_images_url_postop.py +59 -0
- mixpeek/models/ingest_text_ingest_text_postop.py +59 -0
- mixpeek/models/ingest_video_url_ingest_videos_url_postop.py +59 -0
- mixpeek/models/inputtype.py +11 -0
- mixpeek/models/integerindexparams.py +24 -0
- mixpeek/models/interactionresponse.py +87 -0
- mixpeek/models/interactiontype.py +11 -0
- mixpeek/models/jsonimageoutputsettings.py +55 -0
- mixpeek/models/jsontextoutputsettings.py +55 -0
- mixpeek/models/jsonvideooutputsettings.py +55 -0
- mixpeek/models/keywordindexparams.py +21 -0
- mixpeek/models/kill_task_tasks_task_id_deleteop.py +57 -0
- mixpeek/models/list_assets_assets_postop.py +77 -0
- mixpeek/models/list_collections_collections_getop.py +65 -0
- mixpeek/models/list_features_features_postop.py +79 -0
- mixpeek/models/list_interactions_features_search_interactions_getop.py +96 -0
- mixpeek/models/listassetsrequest.py +75 -0
- mixpeek/models/listassetsresponse.py +22 -0
- mixpeek/models/listcollectionsresponse.py +22 -0
- mixpeek/models/listfeaturesrequest.py +77 -0
- mixpeek/models/listfeaturesresponse.py +22 -0
- mixpeek/models/logicaloperator_input.py +88 -0
- mixpeek/models/logicaloperator_output.py +103 -0
- mixpeek/models/logodetectsettings.py +52 -0
- mixpeek/models/modality.py +13 -0
- mixpeek/models/modeldetails.py +57 -0
- mixpeek/models/namespaceresponse.py +54 -0
- mixpeek/models/organizationmodel.py +45 -0
- mixpeek/models/partial_asset_update_assets_asset_id_patchop.py +69 -0
- mixpeek/models/payloadindexconfig.py +94 -0
- mixpeek/models/payloadindextype.py +17 -0
- mixpeek/models/payloadschematype.py +15 -0
- mixpeek/models/percolaterequest.py +57 -0
- mixpeek/models/permission.py +10 -0
- mixpeek/models/processimageurlinput.py +99 -0
- mixpeek/models/processtextinput.py +94 -0
- mixpeek/models/processvideourlinput.py +99 -0
- mixpeek/models/querysettings.py +56 -0
- mixpeek/models/rerankingoptions.py +47 -0
- mixpeek/models/search_assets_assets_search_postop.py +59 -0
- mixpeek/models/search_features_features_search_postop.py +96 -0
- mixpeek/models/search_model_searchquery_input.py +76 -0
- mixpeek/models/searchassetsrequest.py +78 -0
- mixpeek/models/searchinteraction.py +82 -0
- mixpeek/models/searchquery_output.py +79 -0
- mixpeek/models/searchrequestfeatures_input.py +151 -0
- mixpeek/models/searchrequestfeatures_output.py +151 -0
- mixpeek/models/sortoption.py +28 -0
- mixpeek/models/sparseembedding.py +21 -0
- mixpeek/models/tasks_model_taskresponse.py +24 -0
- mixpeek/models/taskstatus.py +16 -0
- mixpeek/models/textindexparams.py +31 -0
- mixpeek/models/textsettings.py +61 -0
- mixpeek/models/tokenizertype.py +11 -0
- mixpeek/models/update_api_key_organizations_users_user_email_api_keys_key_name_patchop.py +30 -0
- mixpeek/models/update_collection_collections_collection_putop.py +74 -0
- mixpeek/models/update_namespace_namespaces_namespace_putop.py +28 -0
- mixpeek/models/updateassetrequest.py +60 -0
- mixpeek/models/updatenamespacerequest.py +26 -0
- mixpeek/models/usage.py +18 -0
- mixpeek/models/usermodel_input.py +36 -0
- mixpeek/models/usermodel_output.py +36 -0
- mixpeek/models/uuidindexparams.py +21 -0
- mixpeek/models/validationerror.py +26 -0
- mixpeek/models/vectormodel.py +11 -0
- mixpeek/models/vectortype.py +9 -0
- mixpeek/models/videodescribesettings.py +82 -0
- mixpeek/models/videodetectsettings.py +53 -0
- mixpeek/models/videoreadsettings.py +71 -0
- mixpeek/models/videosettings.py +101 -0
- mixpeek/models/videotranscriptionsettings.py +69 -0
- mixpeek/namespaces.py +1143 -0
- mixpeek/organizations.py +1508 -0
- mixpeek/py.typed +1 -0
- mixpeek/sdk.py +135 -0
- mixpeek/sdkconfiguration.py +45 -0
- mixpeek/searchinteractions.py +647 -0
- mixpeek/tasks.py +387 -0
- mixpeek/types/__init__.py +19 -29
- mixpeek/types/basemodel.py +39 -0
- mixpeek/utils/__init__.py +97 -0
- mixpeek/utils/annotations.py +55 -0
- mixpeek/utils/enums.py +34 -0
- mixpeek/utils/eventstreaming.py +238 -0
- mixpeek/utils/forms.py +202 -0
- mixpeek/utils/headers.py +136 -0
- mixpeek/utils/logger.py +27 -0
- mixpeek/utils/metadata.py +118 -0
- mixpeek/utils/queryparams.py +205 -0
- mixpeek/utils/requestbodies.py +66 -0
- mixpeek/utils/retries.py +217 -0
- mixpeek/utils/security.py +174 -0
- mixpeek/utils/serializers.py +215 -0
- mixpeek/utils/url.py +155 -0
- mixpeek/utils/values.py +134 -0
- mixpeek-0.13.dist-info/METADATA +439 -0
- mixpeek-0.13.dist-info/RECORD +176 -0
- {mixpeek-0.12.0.dist-info → mixpeek-0.13.dist-info}/WHEEL +1 -1
- py.typed +1 -0
- mixpeek/_base_client.py +0 -2041
- mixpeek/_client.py +0 -444
- mixpeek/_compat.py +0 -221
- mixpeek/_constants.py +0 -14
- mixpeek/_exceptions.py +0 -108
- mixpeek/_files.py +0 -123
- mixpeek/_models.py +0 -788
- mixpeek/_qs.py +0 -150
- mixpeek/_resource.py +0 -43
- mixpeek/_response.py +0 -824
- mixpeek/_streaming.py +0 -333
- mixpeek/_types.py +0 -219
- mixpeek/_utils/__init__.py +0 -56
- mixpeek/_utils/_logs.py +0 -25
- mixpeek/_utils/_proxy.py +0 -62
- mixpeek/_utils/_reflection.py +0 -42
- mixpeek/_utils/_streams.py +0 -12
- mixpeek/_utils/_sync.py +0 -81
- mixpeek/_utils/_transform.py +0 -387
- mixpeek/_utils/_typing.py +0 -120
- mixpeek/_utils/_utils.py +0 -414
- mixpeek/lib/.keep +0 -4
- mixpeek/resources/__init__.py +0 -117
- mixpeek/resources/accounts.py +0 -271
- mixpeek/resources/assets/__init__.py +0 -33
- mixpeek/resources/assets/assets.py +0 -708
- mixpeek/resources/assets/features.py +0 -172
- mixpeek/resources/collections.py +0 -283
- mixpeek/resources/entities/__init__.py +0 -47
- mixpeek/resources/entities/entities.py +0 -134
- mixpeek/resources/entities/faces.py +0 -514
- mixpeek/resources/entities/labels.py +0 -388
- mixpeek/resources/features/__init__.py +0 -33
- mixpeek/resources/features/features.py +0 -562
- mixpeek/resources/features/search.py +0 -731
- mixpeek/resources/healthcheck.py +0 -135
- mixpeek/resources/index/__init__.py +0 -47
- mixpeek/resources/index/images.py +0 -249
- mixpeek/resources/index/index.py +0 -289
- mixpeek/resources/index/videos.py +0 -249
- mixpeek/resources/tasks.py +0 -258
- mixpeek/types/account_update_params.py +0 -28
- mixpeek/types/asset_create_params.py +0 -36
- mixpeek/types/asset_create_response.py +0 -15
- mixpeek/types/asset_response.py +0 -46
- mixpeek/types/asset_search_params.py +0 -43
- mixpeek/types/asset_search_response.py +0 -15
- mixpeek/types/asset_update_params.py +0 -25
- mixpeek/types/asset_update_response.py +0 -11
- mixpeek/types/assets/__init__.py +0 -3
- mixpeek/types/collection_list_params.py +0 -19
- mixpeek/types/collection_list_response.py +0 -14
- mixpeek/types/entities/__init__.py +0 -13
- mixpeek/types/entities/face_create_params.py +0 -21
- mixpeek/types/entities/face_list_params.py +0 -18
- mixpeek/types/entities/face_list_response.py +0 -15
- mixpeek/types/entities/face_response.py +0 -17
- mixpeek/types/entities/face_update_params.py +0 -22
- mixpeek/types/entities/label_list_params.py +0 -18
- mixpeek/types/entities/label_list_response.py +0 -30
- mixpeek/types/entities/label_response.py +0 -30
- mixpeek/types/entities/label_update_params.py +0 -21
- mixpeek/types/feature.py +0 -32
- mixpeek/types/feature_list_params.py +0 -37
- mixpeek/types/feature_list_response.py +0 -28
- mixpeek/types/feature_retrieve_params.py +0 -18
- mixpeek/types/feature_update_params.py +0 -16
- mixpeek/types/features/__init__.py +0 -8
- mixpeek/types/features/search_feedback_params.py +0 -23
- mixpeek/types/features/search_file_params.py +0 -29
- mixpeek/types/features/search_text_params.py +0 -72
- mixpeek/types/features/search_url_params.py +0 -72
- mixpeek/types/grouped_asset_data.py +0 -24
- mixpeek/types/health_check_response.py +0 -10
- mixpeek/types/index/__init__.py +0 -8
- mixpeek/types/index/image_url_params.py +0 -135
- mixpeek/types/index/image_url_response.py +0 -20
- mixpeek/types/index/video_url_params.py +0 -154
- mixpeek/types/index/video_url_response.py +0 -20
- mixpeek/types/index_text_params.py +0 -77
- mixpeek/types/index_text_response.py +0 -14
- mixpeek/types/shared/__init__.py +0 -7
- mixpeek/types/shared/filter_condition.py +0 -19
- mixpeek/types/shared/logical_operator.py +0 -12
- mixpeek/types/shared/model_pagination_response.py +0 -21
- mixpeek/types/shared/sort_option.py +0 -15
- mixpeek/types/shared/task_response.py +0 -15
- mixpeek/types/shared_params/__init__.py +0 -4
- mixpeek/types/shared_params/logical_operator.py +0 -13
- mixpeek/types/shared_params/sort_option.py +0 -15
- mixpeek/types/user.py +0 -34
- mixpeek-0.12.0.dist-info/METADATA +0 -345
- mixpeek-0.12.0.dist-info/RECORD +0 -99
- mixpeek-0.12.0.dist-info/licenses/LICENSE +0 -201
mixpeek/tasks.py
ADDED
@@ -0,0 +1,387 @@
|
|
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 typing import Any, Mapping, Optional
|
8
|
+
|
9
|
+
|
10
|
+
class Tasks(BaseSDK):
|
11
|
+
def delete(
|
12
|
+
self,
|
13
|
+
*,
|
14
|
+
task_id: str,
|
15
|
+
x_namespace: OptionalNullable[str] = UNSET,
|
16
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
17
|
+
server_url: Optional[str] = None,
|
18
|
+
timeout_ms: Optional[int] = None,
|
19
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
20
|
+
) -> Any:
|
21
|
+
r"""Kill Task
|
22
|
+
|
23
|
+
:param task_id:
|
24
|
+
: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.
|
25
|
+
:param retries: Override the default retry configuration for this method
|
26
|
+
:param server_url: Override the default server URL for this method
|
27
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
28
|
+
:param http_headers: Additional headers to set or replace on requests.
|
29
|
+
"""
|
30
|
+
base_url = None
|
31
|
+
url_variables = None
|
32
|
+
if timeout_ms is None:
|
33
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
34
|
+
|
35
|
+
if server_url is not None:
|
36
|
+
base_url = server_url
|
37
|
+
|
38
|
+
request = models.KillTaskTasksTaskIDDeleteRequest(
|
39
|
+
task_id=task_id,
|
40
|
+
x_namespace=x_namespace,
|
41
|
+
)
|
42
|
+
|
43
|
+
req = self.build_request(
|
44
|
+
method="DELETE",
|
45
|
+
path="/tasks/{task_id}",
|
46
|
+
base_url=base_url,
|
47
|
+
url_variables=url_variables,
|
48
|
+
request=request,
|
49
|
+
request_body_required=False,
|
50
|
+
request_has_path_params=True,
|
51
|
+
request_has_query_params=False,
|
52
|
+
user_agent_header="user-agent",
|
53
|
+
accept_header_value="application/json",
|
54
|
+
http_headers=http_headers,
|
55
|
+
timeout_ms=timeout_ms,
|
56
|
+
)
|
57
|
+
|
58
|
+
if retries == UNSET:
|
59
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
60
|
+
retries = self.sdk_configuration.retry_config
|
61
|
+
|
62
|
+
retry_config = None
|
63
|
+
if isinstance(retries, utils.RetryConfig):
|
64
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
65
|
+
|
66
|
+
http_res = self.do_request(
|
67
|
+
hook_ctx=HookContext(
|
68
|
+
operation_id="kill_task_tasks__task_id__delete",
|
69
|
+
oauth2_scopes=[],
|
70
|
+
security_source=None,
|
71
|
+
),
|
72
|
+
request=req,
|
73
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
74
|
+
retry_config=retry_config,
|
75
|
+
)
|
76
|
+
|
77
|
+
data: Any = None
|
78
|
+
if utils.match_response(http_res, "200", "application/json"):
|
79
|
+
return utils.unmarshal_json(http_res.text, Any)
|
80
|
+
if utils.match_response(
|
81
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
82
|
+
):
|
83
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
84
|
+
raise models.ErrorResponse(data=data)
|
85
|
+
if utils.match_response(http_res, "422", "application/json"):
|
86
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
87
|
+
raise models.HTTPValidationError(data=data)
|
88
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
89
|
+
http_res_text = utils.stream_to_text(http_res)
|
90
|
+
raise models.APIError(
|
91
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
92
|
+
)
|
93
|
+
|
94
|
+
content_type = http_res.headers.get("Content-Type")
|
95
|
+
http_res_text = utils.stream_to_text(http_res)
|
96
|
+
raise models.APIError(
|
97
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
98
|
+
http_res.status_code,
|
99
|
+
http_res_text,
|
100
|
+
http_res,
|
101
|
+
)
|
102
|
+
|
103
|
+
async def delete_async(
|
104
|
+
self,
|
105
|
+
*,
|
106
|
+
task_id: str,
|
107
|
+
x_namespace: OptionalNullable[str] = UNSET,
|
108
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
109
|
+
server_url: Optional[str] = None,
|
110
|
+
timeout_ms: Optional[int] = None,
|
111
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
112
|
+
) -> Any:
|
113
|
+
r"""Kill Task
|
114
|
+
|
115
|
+
:param task_id:
|
116
|
+
: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.
|
117
|
+
:param retries: Override the default retry configuration for this method
|
118
|
+
:param server_url: Override the default server URL for this method
|
119
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
120
|
+
:param http_headers: Additional headers to set or replace on requests.
|
121
|
+
"""
|
122
|
+
base_url = None
|
123
|
+
url_variables = None
|
124
|
+
if timeout_ms is None:
|
125
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
126
|
+
|
127
|
+
if server_url is not None:
|
128
|
+
base_url = server_url
|
129
|
+
|
130
|
+
request = models.KillTaskTasksTaskIDDeleteRequest(
|
131
|
+
task_id=task_id,
|
132
|
+
x_namespace=x_namespace,
|
133
|
+
)
|
134
|
+
|
135
|
+
req = self.build_request_async(
|
136
|
+
method="DELETE",
|
137
|
+
path="/tasks/{task_id}",
|
138
|
+
base_url=base_url,
|
139
|
+
url_variables=url_variables,
|
140
|
+
request=request,
|
141
|
+
request_body_required=False,
|
142
|
+
request_has_path_params=True,
|
143
|
+
request_has_query_params=False,
|
144
|
+
user_agent_header="user-agent",
|
145
|
+
accept_header_value="application/json",
|
146
|
+
http_headers=http_headers,
|
147
|
+
timeout_ms=timeout_ms,
|
148
|
+
)
|
149
|
+
|
150
|
+
if retries == UNSET:
|
151
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
152
|
+
retries = self.sdk_configuration.retry_config
|
153
|
+
|
154
|
+
retry_config = None
|
155
|
+
if isinstance(retries, utils.RetryConfig):
|
156
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
157
|
+
|
158
|
+
http_res = await self.do_request_async(
|
159
|
+
hook_ctx=HookContext(
|
160
|
+
operation_id="kill_task_tasks__task_id__delete",
|
161
|
+
oauth2_scopes=[],
|
162
|
+
security_source=None,
|
163
|
+
),
|
164
|
+
request=req,
|
165
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
166
|
+
retry_config=retry_config,
|
167
|
+
)
|
168
|
+
|
169
|
+
data: Any = None
|
170
|
+
if utils.match_response(http_res, "200", "application/json"):
|
171
|
+
return utils.unmarshal_json(http_res.text, Any)
|
172
|
+
if utils.match_response(
|
173
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
174
|
+
):
|
175
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
176
|
+
raise models.ErrorResponse(data=data)
|
177
|
+
if utils.match_response(http_res, "422", "application/json"):
|
178
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
179
|
+
raise models.HTTPValidationError(data=data)
|
180
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
181
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
182
|
+
raise models.APIError(
|
183
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
184
|
+
)
|
185
|
+
|
186
|
+
content_type = http_res.headers.get("Content-Type")
|
187
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
188
|
+
raise models.APIError(
|
189
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
190
|
+
http_res.status_code,
|
191
|
+
http_res_text,
|
192
|
+
http_res,
|
193
|
+
)
|
194
|
+
|
195
|
+
def get(
|
196
|
+
self,
|
197
|
+
*,
|
198
|
+
task_id: str,
|
199
|
+
x_namespace: OptionalNullable[str] = UNSET,
|
200
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
201
|
+
server_url: Optional[str] = None,
|
202
|
+
timeout_ms: Optional[int] = None,
|
203
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
204
|
+
) -> models.TasksModelTaskResponse:
|
205
|
+
r"""Get Task Information
|
206
|
+
|
207
|
+
Retrieve a task by its ID.
|
208
|
+
|
209
|
+
A task may have an expiration time, after which it will still be returned but marked as expired.
|
210
|
+
This allows tracking of historical tasks while indicating their current validity state.
|
211
|
+
|
212
|
+
:param task_id:
|
213
|
+
: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.
|
214
|
+
:param retries: Override the default retry configuration for this method
|
215
|
+
:param server_url: Override the default server URL for this method
|
216
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
217
|
+
:param http_headers: Additional headers to set or replace on requests.
|
218
|
+
"""
|
219
|
+
base_url = None
|
220
|
+
url_variables = None
|
221
|
+
if timeout_ms is None:
|
222
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
223
|
+
|
224
|
+
if server_url is not None:
|
225
|
+
base_url = server_url
|
226
|
+
|
227
|
+
request = models.GetTaskTasksTaskIDGetRequest(
|
228
|
+
task_id=task_id,
|
229
|
+
x_namespace=x_namespace,
|
230
|
+
)
|
231
|
+
|
232
|
+
req = self.build_request(
|
233
|
+
method="GET",
|
234
|
+
path="/tasks/{task_id}",
|
235
|
+
base_url=base_url,
|
236
|
+
url_variables=url_variables,
|
237
|
+
request=request,
|
238
|
+
request_body_required=False,
|
239
|
+
request_has_path_params=True,
|
240
|
+
request_has_query_params=False,
|
241
|
+
user_agent_header="user-agent",
|
242
|
+
accept_header_value="application/json",
|
243
|
+
http_headers=http_headers,
|
244
|
+
timeout_ms=timeout_ms,
|
245
|
+
)
|
246
|
+
|
247
|
+
if retries == UNSET:
|
248
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
249
|
+
retries = self.sdk_configuration.retry_config
|
250
|
+
|
251
|
+
retry_config = None
|
252
|
+
if isinstance(retries, utils.RetryConfig):
|
253
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
254
|
+
|
255
|
+
http_res = self.do_request(
|
256
|
+
hook_ctx=HookContext(
|
257
|
+
operation_id="get_task_tasks__task_id__get",
|
258
|
+
oauth2_scopes=[],
|
259
|
+
security_source=None,
|
260
|
+
),
|
261
|
+
request=req,
|
262
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
263
|
+
retry_config=retry_config,
|
264
|
+
)
|
265
|
+
|
266
|
+
data: Any = None
|
267
|
+
if utils.match_response(http_res, "200", "application/json"):
|
268
|
+
return utils.unmarshal_json(http_res.text, models.TasksModelTaskResponse)
|
269
|
+
if utils.match_response(
|
270
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
271
|
+
):
|
272
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
273
|
+
raise models.ErrorResponse(data=data)
|
274
|
+
if utils.match_response(http_res, "422", "application/json"):
|
275
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
276
|
+
raise models.HTTPValidationError(data=data)
|
277
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
278
|
+
http_res_text = utils.stream_to_text(http_res)
|
279
|
+
raise models.APIError(
|
280
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
281
|
+
)
|
282
|
+
|
283
|
+
content_type = http_res.headers.get("Content-Type")
|
284
|
+
http_res_text = utils.stream_to_text(http_res)
|
285
|
+
raise models.APIError(
|
286
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
287
|
+
http_res.status_code,
|
288
|
+
http_res_text,
|
289
|
+
http_res,
|
290
|
+
)
|
291
|
+
|
292
|
+
async def get_async(
|
293
|
+
self,
|
294
|
+
*,
|
295
|
+
task_id: str,
|
296
|
+
x_namespace: OptionalNullable[str] = UNSET,
|
297
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
298
|
+
server_url: Optional[str] = None,
|
299
|
+
timeout_ms: Optional[int] = None,
|
300
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
301
|
+
) -> models.TasksModelTaskResponse:
|
302
|
+
r"""Get Task Information
|
303
|
+
|
304
|
+
Retrieve a task by its ID.
|
305
|
+
|
306
|
+
A task may have an expiration time, after which it will still be returned but marked as expired.
|
307
|
+
This allows tracking of historical tasks while indicating their current validity state.
|
308
|
+
|
309
|
+
:param task_id:
|
310
|
+
: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.
|
311
|
+
:param retries: Override the default retry configuration for this method
|
312
|
+
:param server_url: Override the default server URL for this method
|
313
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
314
|
+
:param http_headers: Additional headers to set or replace on requests.
|
315
|
+
"""
|
316
|
+
base_url = None
|
317
|
+
url_variables = None
|
318
|
+
if timeout_ms is None:
|
319
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
320
|
+
|
321
|
+
if server_url is not None:
|
322
|
+
base_url = server_url
|
323
|
+
|
324
|
+
request = models.GetTaskTasksTaskIDGetRequest(
|
325
|
+
task_id=task_id,
|
326
|
+
x_namespace=x_namespace,
|
327
|
+
)
|
328
|
+
|
329
|
+
req = self.build_request_async(
|
330
|
+
method="GET",
|
331
|
+
path="/tasks/{task_id}",
|
332
|
+
base_url=base_url,
|
333
|
+
url_variables=url_variables,
|
334
|
+
request=request,
|
335
|
+
request_body_required=False,
|
336
|
+
request_has_path_params=True,
|
337
|
+
request_has_query_params=False,
|
338
|
+
user_agent_header="user-agent",
|
339
|
+
accept_header_value="application/json",
|
340
|
+
http_headers=http_headers,
|
341
|
+
timeout_ms=timeout_ms,
|
342
|
+
)
|
343
|
+
|
344
|
+
if retries == UNSET:
|
345
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
346
|
+
retries = self.sdk_configuration.retry_config
|
347
|
+
|
348
|
+
retry_config = None
|
349
|
+
if isinstance(retries, utils.RetryConfig):
|
350
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
351
|
+
|
352
|
+
http_res = await self.do_request_async(
|
353
|
+
hook_ctx=HookContext(
|
354
|
+
operation_id="get_task_tasks__task_id__get",
|
355
|
+
oauth2_scopes=[],
|
356
|
+
security_source=None,
|
357
|
+
),
|
358
|
+
request=req,
|
359
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
360
|
+
retry_config=retry_config,
|
361
|
+
)
|
362
|
+
|
363
|
+
data: Any = None
|
364
|
+
if utils.match_response(http_res, "200", "application/json"):
|
365
|
+
return utils.unmarshal_json(http_res.text, models.TasksModelTaskResponse)
|
366
|
+
if utils.match_response(
|
367
|
+
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
368
|
+
):
|
369
|
+
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
370
|
+
raise models.ErrorResponse(data=data)
|
371
|
+
if utils.match_response(http_res, "422", "application/json"):
|
372
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
373
|
+
raise models.HTTPValidationError(data=data)
|
374
|
+
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
375
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
376
|
+
raise models.APIError(
|
377
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
378
|
+
)
|
379
|
+
|
380
|
+
content_type = http_res.headers.get("Content-Type")
|
381
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
382
|
+
raise models.APIError(
|
383
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
384
|
+
http_res.status_code,
|
385
|
+
http_res_text,
|
386
|
+
http_res,
|
387
|
+
)
|
mixpeek/types/__init__.py
CHANGED
@@ -1,31 +1,21 @@
|
|
1
|
-
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
2
|
|
3
|
-
from
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
ModelPaginationResponse as ModelPaginationResponse,
|
3
|
+
from .basemodel import (
|
4
|
+
BaseModel,
|
5
|
+
Nullable,
|
6
|
+
OptionalNullable,
|
7
|
+
UnrecognizedInt,
|
8
|
+
UnrecognizedStr,
|
9
|
+
UNSET,
|
10
|
+
UNSET_SENTINEL,
|
12
11
|
)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
from .asset_create_response import AssetCreateResponse as AssetCreateResponse
|
24
|
-
from .asset_search_response import AssetSearchResponse as AssetSearchResponse
|
25
|
-
from .asset_update_response import AssetUpdateResponse as AssetUpdateResponse
|
26
|
-
from .feature_list_response import FeatureListResponse as FeatureListResponse
|
27
|
-
from .feature_update_params import FeatureUpdateParams as FeatureUpdateParams
|
28
|
-
from .health_check_response import HealthCheckResponse as HealthCheckResponse
|
29
|
-
from .collection_list_params import CollectionListParams as CollectionListParams
|
30
|
-
from .feature_retrieve_params import FeatureRetrieveParams as FeatureRetrieveParams
|
31
|
-
from .collection_list_response import CollectionListResponse as CollectionListResponse
|
12
|
+
|
13
|
+
__all__ = [
|
14
|
+
"BaseModel",
|
15
|
+
"Nullable",
|
16
|
+
"OptionalNullable",
|
17
|
+
"UnrecognizedInt",
|
18
|
+
"UnrecognizedStr",
|
19
|
+
"UNSET",
|
20
|
+
"UNSET_SENTINEL",
|
21
|
+
]
|
@@ -0,0 +1,39 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from pydantic import ConfigDict, model_serializer
|
4
|
+
from pydantic import BaseModel as PydanticBaseModel
|
5
|
+
from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union, NewType
|
6
|
+
from typing_extensions import TypeAliasType, TypeAlias
|
7
|
+
|
8
|
+
|
9
|
+
class BaseModel(PydanticBaseModel):
|
10
|
+
model_config = ConfigDict(
|
11
|
+
populate_by_name=True, arbitrary_types_allowed=True, protected_namespaces=()
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
class Unset(BaseModel):
|
16
|
+
@model_serializer(mode="plain")
|
17
|
+
def serialize_model(self):
|
18
|
+
return UNSET_SENTINEL
|
19
|
+
|
20
|
+
def __bool__(self) -> Literal[False]:
|
21
|
+
return False
|
22
|
+
|
23
|
+
|
24
|
+
UNSET = Unset()
|
25
|
+
UNSET_SENTINEL = "~?~unset~?~sentinel~?~"
|
26
|
+
|
27
|
+
|
28
|
+
T = TypeVar("T")
|
29
|
+
if TYPE_CHECKING:
|
30
|
+
Nullable: TypeAlias = Union[T, None]
|
31
|
+
OptionalNullable: TypeAlias = Union[Optional[Nullable[T]], Unset]
|
32
|
+
else:
|
33
|
+
Nullable = TypeAliasType("Nullable", Union[T, None], type_params=(T,))
|
34
|
+
OptionalNullable = TypeAliasType(
|
35
|
+
"OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,)
|
36
|
+
)
|
37
|
+
|
38
|
+
UnrecognizedInt = NewType("UnrecognizedInt", int)
|
39
|
+
UnrecognizedStr = NewType("UnrecognizedStr", str)
|
@@ -0,0 +1,97 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from .annotations import get_discriminator
|
4
|
+
from .enums import OpenEnumMeta
|
5
|
+
from .headers import get_headers, get_response_headers
|
6
|
+
from .metadata import (
|
7
|
+
FieldMetadata,
|
8
|
+
find_metadata,
|
9
|
+
FormMetadata,
|
10
|
+
HeaderMetadata,
|
11
|
+
MultipartFormMetadata,
|
12
|
+
PathParamMetadata,
|
13
|
+
QueryParamMetadata,
|
14
|
+
RequestMetadata,
|
15
|
+
SecurityMetadata,
|
16
|
+
)
|
17
|
+
from .queryparams import get_query_params
|
18
|
+
from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig
|
19
|
+
from .requestbodies import serialize_request_body, SerializedRequestBody
|
20
|
+
from .security import get_security
|
21
|
+
from .serializers import (
|
22
|
+
get_pydantic_model,
|
23
|
+
marshal_json,
|
24
|
+
unmarshal,
|
25
|
+
unmarshal_json,
|
26
|
+
serialize_decimal,
|
27
|
+
serialize_float,
|
28
|
+
serialize_int,
|
29
|
+
stream_to_text,
|
30
|
+
stream_to_text_async,
|
31
|
+
stream_to_bytes,
|
32
|
+
stream_to_bytes_async,
|
33
|
+
validate_const,
|
34
|
+
validate_decimal,
|
35
|
+
validate_float,
|
36
|
+
validate_int,
|
37
|
+
validate_open_enum,
|
38
|
+
)
|
39
|
+
from .url import generate_url, template_url, remove_suffix
|
40
|
+
from .values import (
|
41
|
+
get_global_from_env,
|
42
|
+
match_content_type,
|
43
|
+
match_status_codes,
|
44
|
+
match_response,
|
45
|
+
)
|
46
|
+
from .logger import Logger, get_body_content, get_default_logger
|
47
|
+
|
48
|
+
__all__ = [
|
49
|
+
"BackoffStrategy",
|
50
|
+
"FieldMetadata",
|
51
|
+
"find_metadata",
|
52
|
+
"FormMetadata",
|
53
|
+
"generate_url",
|
54
|
+
"get_body_content",
|
55
|
+
"get_default_logger",
|
56
|
+
"get_discriminator",
|
57
|
+
"get_global_from_env",
|
58
|
+
"get_headers",
|
59
|
+
"get_pydantic_model",
|
60
|
+
"get_query_params",
|
61
|
+
"get_response_headers",
|
62
|
+
"get_security",
|
63
|
+
"HeaderMetadata",
|
64
|
+
"Logger",
|
65
|
+
"marshal_json",
|
66
|
+
"match_content_type",
|
67
|
+
"match_status_codes",
|
68
|
+
"match_response",
|
69
|
+
"MultipartFormMetadata",
|
70
|
+
"OpenEnumMeta",
|
71
|
+
"PathParamMetadata",
|
72
|
+
"QueryParamMetadata",
|
73
|
+
"remove_suffix",
|
74
|
+
"Retries",
|
75
|
+
"retry",
|
76
|
+
"retry_async",
|
77
|
+
"RetryConfig",
|
78
|
+
"RequestMetadata",
|
79
|
+
"SecurityMetadata",
|
80
|
+
"serialize_decimal",
|
81
|
+
"serialize_float",
|
82
|
+
"serialize_int",
|
83
|
+
"serialize_request_body",
|
84
|
+
"SerializedRequestBody",
|
85
|
+
"stream_to_text",
|
86
|
+
"stream_to_text_async",
|
87
|
+
"stream_to_bytes",
|
88
|
+
"stream_to_bytes_async",
|
89
|
+
"template_url",
|
90
|
+
"unmarshal",
|
91
|
+
"unmarshal_json",
|
92
|
+
"validate_decimal",
|
93
|
+
"validate_const",
|
94
|
+
"validate_float",
|
95
|
+
"validate_int",
|
96
|
+
"validate_open_enum",
|
97
|
+
]
|
@@ -0,0 +1,55 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from enum import Enum
|
4
|
+
from typing import Any, Optional
|
5
|
+
|
6
|
+
def get_discriminator(model: Any, fieldname: str, key: str) -> str:
|
7
|
+
"""
|
8
|
+
Recursively search for the discriminator attribute in a model.
|
9
|
+
|
10
|
+
Args:
|
11
|
+
model (Any): The model to search within.
|
12
|
+
fieldname (str): The name of the field to search for.
|
13
|
+
key (str): The key to search for in dictionaries.
|
14
|
+
|
15
|
+
Returns:
|
16
|
+
str: The name of the discriminator attribute.
|
17
|
+
|
18
|
+
Raises:
|
19
|
+
ValueError: If the discriminator attribute is not found.
|
20
|
+
"""
|
21
|
+
upper_fieldname = fieldname.upper()
|
22
|
+
|
23
|
+
def get_field_discriminator(field: Any) -> Optional[str]:
|
24
|
+
"""Search for the discriminator attribute in a given field."""
|
25
|
+
|
26
|
+
if isinstance(field, dict):
|
27
|
+
if key in field:
|
28
|
+
return f'{field[key]}'
|
29
|
+
|
30
|
+
if hasattr(field, fieldname):
|
31
|
+
attr = getattr(field, fieldname)
|
32
|
+
if isinstance(attr, Enum):
|
33
|
+
return f'{attr.value}'
|
34
|
+
return f'{attr}'
|
35
|
+
|
36
|
+
if hasattr(field, upper_fieldname):
|
37
|
+
attr = getattr(field, upper_fieldname)
|
38
|
+
if isinstance(attr, Enum):
|
39
|
+
return f'{attr.value}'
|
40
|
+
return f'{attr}'
|
41
|
+
|
42
|
+
return None
|
43
|
+
|
44
|
+
|
45
|
+
if isinstance(model, list):
|
46
|
+
for field in model:
|
47
|
+
discriminator = get_field_discriminator(field)
|
48
|
+
if discriminator is not None:
|
49
|
+
return discriminator
|
50
|
+
|
51
|
+
discriminator = get_field_discriminator(model)
|
52
|
+
if discriminator is not None:
|
53
|
+
return discriminator
|
54
|
+
|
55
|
+
raise ValueError(f'Could not find discriminator field {fieldname} in {model}')
|
mixpeek/utils/enums.py
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
import enum
|
4
|
+
|
5
|
+
|
6
|
+
class OpenEnumMeta(enum.EnumMeta):
|
7
|
+
def __call__(
|
8
|
+
cls, value, names=None, *, module=None, qualname=None, type=None, start=1
|
9
|
+
):
|
10
|
+
# The `type` kwarg also happens to be a built-in that pylint flags as
|
11
|
+
# redeclared. Safe to ignore this lint rule with this scope.
|
12
|
+
# pylint: disable=redefined-builtin
|
13
|
+
|
14
|
+
if names is not None:
|
15
|
+
return super().__call__(
|
16
|
+
value,
|
17
|
+
names=names,
|
18
|
+
module=module,
|
19
|
+
qualname=qualname,
|
20
|
+
type=type,
|
21
|
+
start=start,
|
22
|
+
)
|
23
|
+
|
24
|
+
try:
|
25
|
+
return super().__call__(
|
26
|
+
value,
|
27
|
+
names=names, # pyright: ignore[reportArgumentType]
|
28
|
+
module=module,
|
29
|
+
qualname=qualname,
|
30
|
+
type=type,
|
31
|
+
start=start,
|
32
|
+
)
|
33
|
+
except ValueError:
|
34
|
+
return value
|