label-studio-sdk 2.0.1__py3-none-any.whl → 2.0.2__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.
Potentially problematic release.
This version of label-studio-sdk might be problematic. Click here for more details.
- label_studio_sdk/__init__.py +4 -0
- label_studio_sdk/actions/client.py +13 -13
- label_studio_sdk/actions/types/actions_list_response_item.py +3 -3
- label_studio_sdk/actions/types/actions_list_response_item_dialog.py +2 -2
- label_studio_sdk/annotations/client.py +441 -441
- label_studio_sdk/comments/client.py +176 -176
- label_studio_sdk/export_storage/azure/client.py +274 -274
- label_studio_sdk/export_storage/gcs/client.py +263 -263
- label_studio_sdk/export_storage/local/client.py +206 -206
- label_studio_sdk/export_storage/redis/client.py +287 -287
- label_studio_sdk/export_storage/s3/client.py +347 -347
- label_studio_sdk/export_storage/s3s/client.py +678 -678
- label_studio_sdk/import_storage/azure/client.py +357 -357
- label_studio_sdk/import_storage/gcs/client.py +357 -357
- label_studio_sdk/import_storage/local/client.py +206 -206
- label_studio_sdk/import_storage/redis/client.py +309 -309
- label_studio_sdk/import_storage/s3/client.py +452 -452
- label_studio_sdk/import_storage/s3s/client.py +735 -735
- label_studio_sdk/jwt_settings/client.py +10 -10
- label_studio_sdk/ml/client.py +118 -118
- label_studio_sdk/ml/types/ml_list_model_versions_response.py +1 -1
- label_studio_sdk/model_providers/client.py +181 -181
- label_studio_sdk/organizations/members/client.py +8 -8
- label_studio_sdk/predictions/client.py +60 -60
- label_studio_sdk/projects/__init__.py +30 -1
- label_studio_sdk/projects/assignments/__init__.py +33 -0
- label_studio_sdk/projects/assignments/client.py +764 -0
- label_studio_sdk/projects/assignments/types/__init__.py +35 -0
- label_studio_sdk/projects/assignments/types/assignments_assign_request_type.py +5 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters.py +33 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_conjunction.py +5 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item.py +44 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_filter.py +31 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_operator.py +23 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_value.py +7 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items.py +9 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_excluded.py +29 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_included.py +29 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_type.py +5 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_response.py +22 -0
- label_studio_sdk/projects/assignments/types/assignments_update_request_type.py +5 -0
- label_studio_sdk/projects/client.py +441 -425
- label_studio_sdk/projects/exports/client.py +55 -55
- label_studio_sdk/projects/exports/types/exports_convert_response.py +1 -1
- label_studio_sdk/projects/stats/types/stats_iaa_response.py +5 -5
- label_studio_sdk/projects/types/projects_import_tasks_response.py +12 -12
- label_studio_sdk/prompts/client.py +211 -211
- label_studio_sdk/prompts/runs/client.py +33 -33
- label_studio_sdk/prompts/versions/client.py +72 -72
- label_studio_sdk/tasks/client.py +174 -174
- label_studio_sdk/types/__init__.py +4 -0
- label_studio_sdk/types/all_roles_project_list.py +94 -94
- label_studio_sdk/types/annotation.py +35 -35
- label_studio_sdk/types/annotation_request.py +27 -27
- label_studio_sdk/types/azure_blob_export_storage.py +29 -29
- label_studio_sdk/types/azure_blob_import_storage.py +33 -33
- label_studio_sdk/types/batch_failed_predictions.py +1 -1
- label_studio_sdk/types/billing_checks.py +14 -14
- label_studio_sdk/types/billing_flags.py +16 -16
- label_studio_sdk/types/blueprint_list.py +7 -8
- label_studio_sdk/types/child_filter.py +11 -10
- label_studio_sdk/types/comment.py +15 -15
- label_studio_sdk/types/comment_request.py +7 -8
- label_studio_sdk/types/comment_serializer_with_expanded_user.py +17 -18
- label_studio_sdk/types/converted_format.py +1 -1
- label_studio_sdk/types/converted_format_request.py +1 -1
- label_studio_sdk/types/export.py +8 -8
- label_studio_sdk/types/file_upload.py +3 -2
- label_studio_sdk/types/filter.py +10 -9
- label_studio_sdk/types/filter_group.py +4 -3
- label_studio_sdk/types/gcs_export_storage.py +23 -23
- label_studio_sdk/types/gcs_import_storage.py +27 -27
- label_studio_sdk/types/import_api_request.py +26 -26
- label_studio_sdk/types/inference_run_cost_estimate.py +10 -10
- label_studio_sdk/types/local_files_export_storage.py +23 -23
- label_studio_sdk/types/local_files_import_storage.py +26 -26
- label_studio_sdk/types/lse_annotation_filter_options.py +10 -10
- label_studio_sdk/types/lse_annotation_filter_options_request.py +10 -10
- label_studio_sdk/types/lse_export_create.py +12 -12
- label_studio_sdk/types/lse_fields.py +14 -14
- label_studio_sdk/types/lse_organization.py +17 -17
- label_studio_sdk/types/lse_organization_member_list.py +1 -1
- label_studio_sdk/types/lse_project_create.py +72 -72
- label_studio_sdk/types/lse_project_update.py +89 -89
- label_studio_sdk/types/lse_s3export_storage.py +46 -46
- label_studio_sdk/types/lse_s3export_storage_request.py +43 -43
- label_studio_sdk/types/lse_s3import_storage.py +53 -53
- label_studio_sdk/types/lse_s3import_storage_request.py +49 -49
- label_studio_sdk/types/lse_task.py +49 -49
- label_studio_sdk/types/lse_task_drafts_item.py +1 -1
- label_studio_sdk/types/lse_task_filter_options.py +14 -14
- label_studio_sdk/types/lse_task_filter_options_request.py +14 -14
- label_studio_sdk/types/lse_task_predictions_item.py +5 -5
- label_studio_sdk/types/lse_task_serializer_for_annotators.py +12 -12
- label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +1 -1
- label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +5 -5
- label_studio_sdk/types/lse_task_serializer_for_reviewers.py +49 -49
- label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +1 -1
- label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +5 -5
- label_studio_sdk/types/lse_user.py +13 -13
- label_studio_sdk/types/lse_user_api.py +11 -11
- label_studio_sdk/types/lse_user_organization_member_list.py +13 -13
- label_studio_sdk/types/lseapi_token_create.py +1 -1
- label_studio_sdk/types/lseapi_token_list.py +1 -1
- label_studio_sdk/types/lsejwt_settings.py +5 -5
- label_studio_sdk/types/ml_backend.py +27 -28
- label_studio_sdk/types/model_interface.py +12 -12
- label_studio_sdk/types/model_interface_request.py +7 -8
- label_studio_sdk/types/model_interface_serializer_get.py +13 -13
- label_studio_sdk/types/model_provider_connection.py +34 -34
- label_studio_sdk/types/model_provider_connection_request.py +15 -14
- label_studio_sdk/types/model_run.py +12 -12
- label_studio_sdk/types/organization_billing.py +1 -1
- label_studio_sdk/types/organization_id.py +2 -2
- label_studio_sdk/types/organization_invite.py +1 -1
- label_studio_sdk/types/organization_member.py +8 -9
- label_studio_sdk/types/organization_membership.py +2 -1
- label_studio_sdk/types/pause.py +23 -23
- label_studio_sdk/types/prediction.py +21 -21
- label_studio_sdk/types/prediction_request.py +16 -16
- label_studio_sdk/types/project.py +72 -72
- label_studio_sdk/types/project_import.py +21 -21
- label_studio_sdk/types/redis_export_storage.py +34 -34
- label_studio_sdk/types/redis_import_storage.py +37 -37
- label_studio_sdk/types/refined_prompt_response.py +11 -11
- label_studio_sdk/types/review_settings.py +29 -30
- label_studio_sdk/types/review_settings_request.py +29 -30
- label_studio_sdk/types/s3export_storage.py +45 -45
- label_studio_sdk/types/s3import_storage.py +44 -44
- label_studio_sdk/types/selected_items_request.py +1 -1
- label_studio_sdk/types/serialization_options.py +10 -10
- label_studio_sdk/types/serialization_options_request.py +10 -10
- label_studio_sdk/types/task_assignment.py +43 -0
- label_studio_sdk/types/third_party_model_version.py +11 -11
- label_studio_sdk/types/third_party_model_version_request.py +6 -7
- label_studio_sdk/types/type_enum.py +5 -0
- label_studio_sdk/types/user_simple.py +3 -3
- label_studio_sdk/types/user_simple_request.py +1 -1
- label_studio_sdk/types/version_response.py +19 -20
- label_studio_sdk/types/view.py +8 -8
- label_studio_sdk/types/webhook.py +16 -16
- label_studio_sdk/types/webhook_serializer_for_update.py +16 -16
- label_studio_sdk/types/workspace.py +10 -11
- label_studio_sdk/users/client.py +160 -160
- label_studio_sdk/views/client.py +164 -164
- label_studio_sdk/webhooks/client.py +183 -183
- label_studio_sdk/webhooks/types/webhooks_info_response.py +32 -32
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +1 -1
- label_studio_sdk/workspaces/client.py +40 -40
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/METADATA +1 -1
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/RECORD +167 -149
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/LICENSE +0 -0
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/WHEEL +0 -0
label_studio_sdk/views/client.py
CHANGED
|
@@ -135,22 +135,25 @@ class ViewsClient:
|
|
|
135
135
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
136
136
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
137
137
|
|
|
138
|
-
def
|
|
138
|
+
def update_order(
|
|
139
|
+
self, *, ids: typing.Sequence[int], project: int, request_options: typing.Optional[RequestOptions] = None
|
|
140
|
+
) -> None:
|
|
139
141
|
"""
|
|
140
|
-
|
|
142
|
+
Update the order field of views based on the provided list of view IDs
|
|
141
143
|
|
|
142
144
|
Parameters
|
|
143
145
|
----------
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
ids : typing.Sequence[int]
|
|
147
|
+
A list of view IDs in the desired order.
|
|
148
|
+
|
|
149
|
+
project : int
|
|
146
150
|
|
|
147
151
|
request_options : typing.Optional[RequestOptions]
|
|
148
152
|
Request-specific configuration.
|
|
149
153
|
|
|
150
154
|
Returns
|
|
151
155
|
-------
|
|
152
|
-
|
|
153
|
-
|
|
156
|
+
None
|
|
154
157
|
|
|
155
158
|
Examples
|
|
156
159
|
--------
|
|
@@ -159,37 +162,40 @@ class ViewsClient:
|
|
|
159
162
|
client = LabelStudio(
|
|
160
163
|
api_key="YOUR_API_KEY",
|
|
161
164
|
)
|
|
162
|
-
client.views.
|
|
163
|
-
|
|
165
|
+
client.views.update_order(
|
|
166
|
+
ids=[1],
|
|
167
|
+
project=1,
|
|
164
168
|
)
|
|
165
169
|
"""
|
|
166
170
|
_response = self._client_wrapper.httpx_client.request(
|
|
167
|
-
|
|
168
|
-
method="
|
|
171
|
+
"api/dm/views/order/",
|
|
172
|
+
method="POST",
|
|
173
|
+
json={
|
|
174
|
+
"ids": ids,
|
|
175
|
+
"project": project,
|
|
176
|
+
},
|
|
177
|
+
headers={
|
|
178
|
+
"content-type": "application/json",
|
|
179
|
+
},
|
|
169
180
|
request_options=request_options,
|
|
181
|
+
omit=OMIT,
|
|
170
182
|
)
|
|
171
183
|
try:
|
|
172
184
|
if 200 <= _response.status_code < 300:
|
|
173
|
-
return
|
|
174
|
-
View,
|
|
175
|
-
construct_type(
|
|
176
|
-
type_=View, # type: ignore
|
|
177
|
-
object_=_response.json(),
|
|
178
|
-
),
|
|
179
|
-
)
|
|
185
|
+
return
|
|
180
186
|
_response_json = _response.json()
|
|
181
187
|
except JSONDecodeError:
|
|
182
188
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
183
189
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
184
190
|
|
|
185
|
-
def
|
|
191
|
+
def delete_all(self, *, project: int, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
186
192
|
"""
|
|
187
|
-
Delete a specific
|
|
193
|
+
Delete all views for a specific project.
|
|
188
194
|
|
|
189
195
|
Parameters
|
|
190
196
|
----------
|
|
191
|
-
|
|
192
|
-
|
|
197
|
+
project : int
|
|
198
|
+
Project ID
|
|
193
199
|
|
|
194
200
|
request_options : typing.Optional[RequestOptions]
|
|
195
201
|
Request-specific configuration.
|
|
@@ -205,13 +211,16 @@ class ViewsClient:
|
|
|
205
211
|
client = LabelStudio(
|
|
206
212
|
api_key="YOUR_API_KEY",
|
|
207
213
|
)
|
|
208
|
-
client.views.
|
|
209
|
-
|
|
214
|
+
client.views.delete_all(
|
|
215
|
+
project=1,
|
|
210
216
|
)
|
|
211
217
|
"""
|
|
212
218
|
_response = self._client_wrapper.httpx_client.request(
|
|
213
|
-
|
|
219
|
+
"api/dm/views/reset/",
|
|
214
220
|
method="DELETE",
|
|
221
|
+
params={
|
|
222
|
+
"project": project,
|
|
223
|
+
},
|
|
215
224
|
request_options=request_options,
|
|
216
225
|
)
|
|
217
226
|
try:
|
|
@@ -222,28 +231,15 @@ class ViewsClient:
|
|
|
222
231
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
223
232
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
224
233
|
|
|
225
|
-
def
|
|
226
|
-
self,
|
|
227
|
-
id: str,
|
|
228
|
-
*,
|
|
229
|
-
data: typing.Optional[ViewsUpdateRequestData] = OMIT,
|
|
230
|
-
project: typing.Optional[int] = OMIT,
|
|
231
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
232
|
-
) -> View:
|
|
234
|
+
def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> View:
|
|
233
235
|
"""
|
|
234
|
-
|
|
236
|
+
Get the details about a specific view in the data manager
|
|
235
237
|
|
|
236
238
|
Parameters
|
|
237
239
|
----------
|
|
238
240
|
id : str
|
|
239
241
|
View ID
|
|
240
242
|
|
|
241
|
-
data : typing.Optional[ViewsUpdateRequestData]
|
|
242
|
-
Custom view data
|
|
243
|
-
|
|
244
|
-
project : typing.Optional[int]
|
|
245
|
-
Project ID
|
|
246
|
-
|
|
247
243
|
request_options : typing.Optional[RequestOptions]
|
|
248
244
|
Request-specific configuration.
|
|
249
245
|
|
|
@@ -259,24 +255,14 @@ class ViewsClient:
|
|
|
259
255
|
client = LabelStudio(
|
|
260
256
|
api_key="YOUR_API_KEY",
|
|
261
257
|
)
|
|
262
|
-
client.views.
|
|
258
|
+
client.views.get(
|
|
263
259
|
id="id",
|
|
264
260
|
)
|
|
265
261
|
"""
|
|
266
262
|
_response = self._client_wrapper.httpx_client.request(
|
|
267
263
|
f"api/dm/views/{jsonable_encoder(id)}/",
|
|
268
|
-
method="
|
|
269
|
-
json={
|
|
270
|
-
"data": convert_and_respect_annotation_metadata(
|
|
271
|
-
object_=data, annotation=ViewsUpdateRequestData, direction="write"
|
|
272
|
-
),
|
|
273
|
-
"project": project,
|
|
274
|
-
},
|
|
275
|
-
headers={
|
|
276
|
-
"content-type": "application/json",
|
|
277
|
-
},
|
|
264
|
+
method="GET",
|
|
278
265
|
request_options=request_options,
|
|
279
|
-
omit=OMIT,
|
|
280
266
|
)
|
|
281
267
|
try:
|
|
282
268
|
if 200 <= _response.status_code < 300:
|
|
@@ -292,18 +278,14 @@ class ViewsClient:
|
|
|
292
278
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
293
279
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
294
280
|
|
|
295
|
-
def
|
|
296
|
-
self, *, project: int, ids: typing.Sequence[int], request_options: typing.Optional[RequestOptions] = None
|
|
297
|
-
) -> None:
|
|
281
|
+
def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
298
282
|
"""
|
|
299
|
-
|
|
283
|
+
Delete a specific view by ID.
|
|
300
284
|
|
|
301
285
|
Parameters
|
|
302
286
|
----------
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
ids : typing.Sequence[int]
|
|
306
|
-
A list of view IDs in the desired order.
|
|
287
|
+
id : str
|
|
288
|
+
View ID
|
|
307
289
|
|
|
308
290
|
request_options : typing.Optional[RequestOptions]
|
|
309
291
|
Request-specific configuration.
|
|
@@ -319,23 +301,14 @@ class ViewsClient:
|
|
|
319
301
|
client = LabelStudio(
|
|
320
302
|
api_key="YOUR_API_KEY",
|
|
321
303
|
)
|
|
322
|
-
client.views.
|
|
323
|
-
|
|
324
|
-
ids=[1],
|
|
304
|
+
client.views.delete(
|
|
305
|
+
id="id",
|
|
325
306
|
)
|
|
326
307
|
"""
|
|
327
308
|
_response = self._client_wrapper.httpx_client.request(
|
|
328
|
-
"api/dm/views/
|
|
329
|
-
method="
|
|
330
|
-
json={
|
|
331
|
-
"project": project,
|
|
332
|
-
"ids": ids,
|
|
333
|
-
},
|
|
334
|
-
headers={
|
|
335
|
-
"content-type": "application/json",
|
|
336
|
-
},
|
|
309
|
+
f"api/dm/views/{jsonable_encoder(id)}/",
|
|
310
|
+
method="DELETE",
|
|
337
311
|
request_options=request_options,
|
|
338
|
-
omit=OMIT,
|
|
339
312
|
)
|
|
340
313
|
try:
|
|
341
314
|
if 200 <= _response.status_code < 300:
|
|
@@ -345,13 +318,26 @@ class ViewsClient:
|
|
|
345
318
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
346
319
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
347
320
|
|
|
348
|
-
def
|
|
321
|
+
def update(
|
|
322
|
+
self,
|
|
323
|
+
id: str,
|
|
324
|
+
*,
|
|
325
|
+
data: typing.Optional[ViewsUpdateRequestData] = OMIT,
|
|
326
|
+
project: typing.Optional[int] = OMIT,
|
|
327
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
328
|
+
) -> View:
|
|
349
329
|
"""
|
|
350
|
-
|
|
330
|
+
Update view data with additional filters and other information for a specific project.
|
|
351
331
|
|
|
352
332
|
Parameters
|
|
353
333
|
----------
|
|
354
|
-
|
|
334
|
+
id : str
|
|
335
|
+
View ID
|
|
336
|
+
|
|
337
|
+
data : typing.Optional[ViewsUpdateRequestData]
|
|
338
|
+
Custom view data
|
|
339
|
+
|
|
340
|
+
project : typing.Optional[int]
|
|
355
341
|
Project ID
|
|
356
342
|
|
|
357
343
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -359,7 +345,8 @@ class ViewsClient:
|
|
|
359
345
|
|
|
360
346
|
Returns
|
|
361
347
|
-------
|
|
362
|
-
|
|
348
|
+
View
|
|
349
|
+
|
|
363
350
|
|
|
364
351
|
Examples
|
|
365
352
|
--------
|
|
@@ -368,21 +355,34 @@ class ViewsClient:
|
|
|
368
355
|
client = LabelStudio(
|
|
369
356
|
api_key="YOUR_API_KEY",
|
|
370
357
|
)
|
|
371
|
-
client.views.
|
|
372
|
-
|
|
358
|
+
client.views.update(
|
|
359
|
+
id="id",
|
|
373
360
|
)
|
|
374
361
|
"""
|
|
375
362
|
_response = self._client_wrapper.httpx_client.request(
|
|
376
|
-
"api/dm/views/
|
|
377
|
-
method="
|
|
378
|
-
|
|
363
|
+
f"api/dm/views/{jsonable_encoder(id)}/",
|
|
364
|
+
method="PATCH",
|
|
365
|
+
json={
|
|
366
|
+
"data": convert_and_respect_annotation_metadata(
|
|
367
|
+
object_=data, annotation=ViewsUpdateRequestData, direction="write"
|
|
368
|
+
),
|
|
379
369
|
"project": project,
|
|
380
370
|
},
|
|
371
|
+
headers={
|
|
372
|
+
"content-type": "application/json",
|
|
373
|
+
},
|
|
381
374
|
request_options=request_options,
|
|
375
|
+
omit=OMIT,
|
|
382
376
|
)
|
|
383
377
|
try:
|
|
384
378
|
if 200 <= _response.status_code < 300:
|
|
385
|
-
return
|
|
379
|
+
return typing.cast(
|
|
380
|
+
View,
|
|
381
|
+
construct_type(
|
|
382
|
+
type_=View, # type: ignore
|
|
383
|
+
object_=_response.json(),
|
|
384
|
+
),
|
|
385
|
+
)
|
|
386
386
|
_response_json = _response.json()
|
|
387
387
|
except JSONDecodeError:
|
|
388
388
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -523,22 +523,25 @@ class AsyncViewsClient:
|
|
|
523
523
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
524
524
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
525
525
|
|
|
526
|
-
async def
|
|
526
|
+
async def update_order(
|
|
527
|
+
self, *, ids: typing.Sequence[int], project: int, request_options: typing.Optional[RequestOptions] = None
|
|
528
|
+
) -> None:
|
|
527
529
|
"""
|
|
528
|
-
|
|
530
|
+
Update the order field of views based on the provided list of view IDs
|
|
529
531
|
|
|
530
532
|
Parameters
|
|
531
533
|
----------
|
|
532
|
-
|
|
533
|
-
|
|
534
|
+
ids : typing.Sequence[int]
|
|
535
|
+
A list of view IDs in the desired order.
|
|
536
|
+
|
|
537
|
+
project : int
|
|
534
538
|
|
|
535
539
|
request_options : typing.Optional[RequestOptions]
|
|
536
540
|
Request-specific configuration.
|
|
537
541
|
|
|
538
542
|
Returns
|
|
539
543
|
-------
|
|
540
|
-
|
|
541
|
-
|
|
544
|
+
None
|
|
542
545
|
|
|
543
546
|
Examples
|
|
544
547
|
--------
|
|
@@ -552,40 +555,43 @@ class AsyncViewsClient:
|
|
|
552
555
|
|
|
553
556
|
|
|
554
557
|
async def main() -> None:
|
|
555
|
-
await client.views.
|
|
556
|
-
|
|
558
|
+
await client.views.update_order(
|
|
559
|
+
ids=[1],
|
|
560
|
+
project=1,
|
|
557
561
|
)
|
|
558
562
|
|
|
559
563
|
|
|
560
564
|
asyncio.run(main())
|
|
561
565
|
"""
|
|
562
566
|
_response = await self._client_wrapper.httpx_client.request(
|
|
563
|
-
|
|
564
|
-
method="
|
|
567
|
+
"api/dm/views/order/",
|
|
568
|
+
method="POST",
|
|
569
|
+
json={
|
|
570
|
+
"ids": ids,
|
|
571
|
+
"project": project,
|
|
572
|
+
},
|
|
573
|
+
headers={
|
|
574
|
+
"content-type": "application/json",
|
|
575
|
+
},
|
|
565
576
|
request_options=request_options,
|
|
577
|
+
omit=OMIT,
|
|
566
578
|
)
|
|
567
579
|
try:
|
|
568
580
|
if 200 <= _response.status_code < 300:
|
|
569
|
-
return
|
|
570
|
-
View,
|
|
571
|
-
construct_type(
|
|
572
|
-
type_=View, # type: ignore
|
|
573
|
-
object_=_response.json(),
|
|
574
|
-
),
|
|
575
|
-
)
|
|
581
|
+
return
|
|
576
582
|
_response_json = _response.json()
|
|
577
583
|
except JSONDecodeError:
|
|
578
584
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
579
585
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
580
586
|
|
|
581
|
-
async def
|
|
587
|
+
async def delete_all(self, *, project: int, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
582
588
|
"""
|
|
583
|
-
Delete a specific
|
|
589
|
+
Delete all views for a specific project.
|
|
584
590
|
|
|
585
591
|
Parameters
|
|
586
592
|
----------
|
|
587
|
-
|
|
588
|
-
|
|
593
|
+
project : int
|
|
594
|
+
Project ID
|
|
589
595
|
|
|
590
596
|
request_options : typing.Optional[RequestOptions]
|
|
591
597
|
Request-specific configuration.
|
|
@@ -606,16 +612,19 @@ class AsyncViewsClient:
|
|
|
606
612
|
|
|
607
613
|
|
|
608
614
|
async def main() -> None:
|
|
609
|
-
await client.views.
|
|
610
|
-
|
|
615
|
+
await client.views.delete_all(
|
|
616
|
+
project=1,
|
|
611
617
|
)
|
|
612
618
|
|
|
613
619
|
|
|
614
620
|
asyncio.run(main())
|
|
615
621
|
"""
|
|
616
622
|
_response = await self._client_wrapper.httpx_client.request(
|
|
617
|
-
|
|
623
|
+
"api/dm/views/reset/",
|
|
618
624
|
method="DELETE",
|
|
625
|
+
params={
|
|
626
|
+
"project": project,
|
|
627
|
+
},
|
|
619
628
|
request_options=request_options,
|
|
620
629
|
)
|
|
621
630
|
try:
|
|
@@ -626,28 +635,15 @@ class AsyncViewsClient:
|
|
|
626
635
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
627
636
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
628
637
|
|
|
629
|
-
async def
|
|
630
|
-
self,
|
|
631
|
-
id: str,
|
|
632
|
-
*,
|
|
633
|
-
data: typing.Optional[ViewsUpdateRequestData] = OMIT,
|
|
634
|
-
project: typing.Optional[int] = OMIT,
|
|
635
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
636
|
-
) -> View:
|
|
638
|
+
async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> View:
|
|
637
639
|
"""
|
|
638
|
-
|
|
640
|
+
Get the details about a specific view in the data manager
|
|
639
641
|
|
|
640
642
|
Parameters
|
|
641
643
|
----------
|
|
642
644
|
id : str
|
|
643
645
|
View ID
|
|
644
646
|
|
|
645
|
-
data : typing.Optional[ViewsUpdateRequestData]
|
|
646
|
-
Custom view data
|
|
647
|
-
|
|
648
|
-
project : typing.Optional[int]
|
|
649
|
-
Project ID
|
|
650
|
-
|
|
651
647
|
request_options : typing.Optional[RequestOptions]
|
|
652
648
|
Request-specific configuration.
|
|
653
649
|
|
|
@@ -668,7 +664,7 @@ class AsyncViewsClient:
|
|
|
668
664
|
|
|
669
665
|
|
|
670
666
|
async def main() -> None:
|
|
671
|
-
await client.views.
|
|
667
|
+
await client.views.get(
|
|
672
668
|
id="id",
|
|
673
669
|
)
|
|
674
670
|
|
|
@@ -677,18 +673,8 @@ class AsyncViewsClient:
|
|
|
677
673
|
"""
|
|
678
674
|
_response = await self._client_wrapper.httpx_client.request(
|
|
679
675
|
f"api/dm/views/{jsonable_encoder(id)}/",
|
|
680
|
-
method="
|
|
681
|
-
json={
|
|
682
|
-
"data": convert_and_respect_annotation_metadata(
|
|
683
|
-
object_=data, annotation=ViewsUpdateRequestData, direction="write"
|
|
684
|
-
),
|
|
685
|
-
"project": project,
|
|
686
|
-
},
|
|
687
|
-
headers={
|
|
688
|
-
"content-type": "application/json",
|
|
689
|
-
},
|
|
676
|
+
method="GET",
|
|
690
677
|
request_options=request_options,
|
|
691
|
-
omit=OMIT,
|
|
692
678
|
)
|
|
693
679
|
try:
|
|
694
680
|
if 200 <= _response.status_code < 300:
|
|
@@ -704,18 +690,14 @@ class AsyncViewsClient:
|
|
|
704
690
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
705
691
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
706
692
|
|
|
707
|
-
async def
|
|
708
|
-
self, *, project: int, ids: typing.Sequence[int], request_options: typing.Optional[RequestOptions] = None
|
|
709
|
-
) -> None:
|
|
693
|
+
async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
710
694
|
"""
|
|
711
|
-
|
|
695
|
+
Delete a specific view by ID.
|
|
712
696
|
|
|
713
697
|
Parameters
|
|
714
698
|
----------
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
ids : typing.Sequence[int]
|
|
718
|
-
A list of view IDs in the desired order.
|
|
699
|
+
id : str
|
|
700
|
+
View ID
|
|
719
701
|
|
|
720
702
|
request_options : typing.Optional[RequestOptions]
|
|
721
703
|
Request-specific configuration.
|
|
@@ -736,26 +718,17 @@ class AsyncViewsClient:
|
|
|
736
718
|
|
|
737
719
|
|
|
738
720
|
async def main() -> None:
|
|
739
|
-
await client.views.
|
|
740
|
-
|
|
741
|
-
ids=[1],
|
|
721
|
+
await client.views.delete(
|
|
722
|
+
id="id",
|
|
742
723
|
)
|
|
743
724
|
|
|
744
725
|
|
|
745
726
|
asyncio.run(main())
|
|
746
727
|
"""
|
|
747
728
|
_response = await self._client_wrapper.httpx_client.request(
|
|
748
|
-
"api/dm/views/
|
|
749
|
-
method="
|
|
750
|
-
json={
|
|
751
|
-
"project": project,
|
|
752
|
-
"ids": ids,
|
|
753
|
-
},
|
|
754
|
-
headers={
|
|
755
|
-
"content-type": "application/json",
|
|
756
|
-
},
|
|
729
|
+
f"api/dm/views/{jsonable_encoder(id)}/",
|
|
730
|
+
method="DELETE",
|
|
757
731
|
request_options=request_options,
|
|
758
|
-
omit=OMIT,
|
|
759
732
|
)
|
|
760
733
|
try:
|
|
761
734
|
if 200 <= _response.status_code < 300:
|
|
@@ -765,13 +738,26 @@ class AsyncViewsClient:
|
|
|
765
738
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
766
739
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
767
740
|
|
|
768
|
-
async def
|
|
741
|
+
async def update(
|
|
742
|
+
self,
|
|
743
|
+
id: str,
|
|
744
|
+
*,
|
|
745
|
+
data: typing.Optional[ViewsUpdateRequestData] = OMIT,
|
|
746
|
+
project: typing.Optional[int] = OMIT,
|
|
747
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
748
|
+
) -> View:
|
|
769
749
|
"""
|
|
770
|
-
|
|
750
|
+
Update view data with additional filters and other information for a specific project.
|
|
771
751
|
|
|
772
752
|
Parameters
|
|
773
753
|
----------
|
|
774
|
-
|
|
754
|
+
id : str
|
|
755
|
+
View ID
|
|
756
|
+
|
|
757
|
+
data : typing.Optional[ViewsUpdateRequestData]
|
|
758
|
+
Custom view data
|
|
759
|
+
|
|
760
|
+
project : typing.Optional[int]
|
|
775
761
|
Project ID
|
|
776
762
|
|
|
777
763
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -779,7 +765,8 @@ class AsyncViewsClient:
|
|
|
779
765
|
|
|
780
766
|
Returns
|
|
781
767
|
-------
|
|
782
|
-
|
|
768
|
+
View
|
|
769
|
+
|
|
783
770
|
|
|
784
771
|
Examples
|
|
785
772
|
--------
|
|
@@ -793,24 +780,37 @@ class AsyncViewsClient:
|
|
|
793
780
|
|
|
794
781
|
|
|
795
782
|
async def main() -> None:
|
|
796
|
-
await client.views.
|
|
797
|
-
|
|
783
|
+
await client.views.update(
|
|
784
|
+
id="id",
|
|
798
785
|
)
|
|
799
786
|
|
|
800
787
|
|
|
801
788
|
asyncio.run(main())
|
|
802
789
|
"""
|
|
803
790
|
_response = await self._client_wrapper.httpx_client.request(
|
|
804
|
-
"api/dm/views/
|
|
805
|
-
method="
|
|
806
|
-
|
|
791
|
+
f"api/dm/views/{jsonable_encoder(id)}/",
|
|
792
|
+
method="PATCH",
|
|
793
|
+
json={
|
|
794
|
+
"data": convert_and_respect_annotation_metadata(
|
|
795
|
+
object_=data, annotation=ViewsUpdateRequestData, direction="write"
|
|
796
|
+
),
|
|
807
797
|
"project": project,
|
|
808
798
|
},
|
|
799
|
+
headers={
|
|
800
|
+
"content-type": "application/json",
|
|
801
|
+
},
|
|
809
802
|
request_options=request_options,
|
|
803
|
+
omit=OMIT,
|
|
810
804
|
)
|
|
811
805
|
try:
|
|
812
806
|
if 200 <= _response.status_code < 300:
|
|
813
|
-
return
|
|
807
|
+
return typing.cast(
|
|
808
|
+
View,
|
|
809
|
+
construct_type(
|
|
810
|
+
type_=View, # type: ignore
|
|
811
|
+
object_=_response.json(),
|
|
812
|
+
),
|
|
813
|
+
)
|
|
814
814
|
_response_json = _response.json()
|
|
815
815
|
except JSONDecodeError:
|
|
816
816
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|