label-studio-sdk 2.0.1__py3-none-any.whl → 2.0.3__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.

Files changed (184) hide show
  1. label_studio_sdk/__init__.py +20 -0
  2. label_studio_sdk/actions/client.py +13 -13
  3. label_studio_sdk/actions/types/actions_list_response_item.py +3 -3
  4. label_studio_sdk/actions/types/actions_list_response_item_dialog.py +2 -2
  5. label_studio_sdk/annotations/client.py +441 -441
  6. label_studio_sdk/base_client.py +4 -0
  7. label_studio_sdk/comments/client.py +176 -176
  8. label_studio_sdk/export_storage/azure/client.py +274 -274
  9. label_studio_sdk/export_storage/gcs/client.py +263 -263
  10. label_studio_sdk/export_storage/local/client.py +206 -206
  11. label_studio_sdk/export_storage/redis/client.py +287 -287
  12. label_studio_sdk/export_storage/s3/client.py +347 -347
  13. label_studio_sdk/export_storage/s3s/client.py +678 -678
  14. label_studio_sdk/import_storage/azure/client.py +357 -357
  15. label_studio_sdk/import_storage/gcs/client.py +357 -357
  16. label_studio_sdk/import_storage/local/client.py +206 -206
  17. label_studio_sdk/import_storage/redis/client.py +309 -309
  18. label_studio_sdk/import_storage/s3/client.py +452 -452
  19. label_studio_sdk/import_storage/s3s/client.py +735 -735
  20. label_studio_sdk/jwt_settings/client.py +10 -10
  21. label_studio_sdk/ml/client.py +118 -118
  22. label_studio_sdk/ml/types/ml_list_model_versions_response.py +1 -1
  23. label_studio_sdk/model_providers/client.py +181 -181
  24. label_studio_sdk/organizations/members/client.py +8 -8
  25. label_studio_sdk/predictions/client.py +60 -60
  26. label_studio_sdk/projects/__init__.py +33 -1
  27. label_studio_sdk/projects/assignments/__init__.py +35 -0
  28. label_studio_sdk/projects/assignments/client.py +801 -0
  29. label_studio_sdk/projects/assignments/types/__init__.py +37 -0
  30. label_studio_sdk/projects/assignments/types/assignments_assign_request_type.py +5 -0
  31. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters.py +33 -0
  32. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_conjunction.py +5 -0
  33. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item.py +44 -0
  34. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_filter.py +31 -0
  35. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_operator.py +23 -0
  36. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_value.py +7 -0
  37. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items.py +9 -0
  38. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_excluded.py +29 -0
  39. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_included.py +29 -0
  40. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_type.py +5 -0
  41. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_response.py +22 -0
  42. label_studio_sdk/projects/assignments/types/assignments_delete_request_type.py +5 -0
  43. label_studio_sdk/projects/assignments/types/assignments_update_request_type.py +5 -0
  44. label_studio_sdk/projects/client.py +445 -425
  45. label_studio_sdk/projects/exports/client.py +55 -55
  46. label_studio_sdk/projects/exports/types/exports_convert_response.py +1 -1
  47. label_studio_sdk/projects/members/__init__.py +2 -0
  48. label_studio_sdk/projects/members/client.py +137 -0
  49. label_studio_sdk/projects/stats/types/stats_iaa_response.py +5 -5
  50. label_studio_sdk/projects/types/projects_import_tasks_response.py +12 -12
  51. label_studio_sdk/prompts/client.py +211 -211
  52. label_studio_sdk/prompts/runs/client.py +33 -33
  53. label_studio_sdk/prompts/versions/client.py +72 -72
  54. label_studio_sdk/sso/__init__.py +5 -0
  55. label_studio_sdk/sso/client.py +22 -0
  56. label_studio_sdk/sso/saml/__init__.py +2 -0
  57. label_studio_sdk/sso/saml/client.py +278 -0
  58. label_studio_sdk/sso/scim/__init__.py +2 -0
  59. label_studio_sdk/sso/scim/client.py +278 -0
  60. label_studio_sdk/tasks/client.py +174 -174
  61. label_studio_sdk/types/__init__.py +18 -0
  62. label_studio_sdk/types/all_roles_project_list.py +94 -94
  63. label_studio_sdk/types/annotation.py +35 -35
  64. label_studio_sdk/types/annotation_request.py +27 -27
  65. label_studio_sdk/types/azure_blob_export_storage.py +29 -29
  66. label_studio_sdk/types/azure_blob_import_storage.py +33 -33
  67. label_studio_sdk/types/batch_failed_predictions.py +1 -1
  68. label_studio_sdk/types/billing_checks.py +14 -14
  69. label_studio_sdk/types/billing_flags.py +16 -16
  70. label_studio_sdk/types/blueprint_list.py +7 -8
  71. label_studio_sdk/types/child_filter.py +11 -10
  72. label_studio_sdk/types/comment.py +15 -15
  73. label_studio_sdk/types/comment_request.py +7 -8
  74. label_studio_sdk/types/comment_serializer_with_expanded_user.py +17 -18
  75. label_studio_sdk/types/converted_format.py +1 -1
  76. label_studio_sdk/types/converted_format_request.py +1 -1
  77. label_studio_sdk/types/export.py +8 -8
  78. label_studio_sdk/types/file_upload.py +3 -2
  79. label_studio_sdk/types/filter.py +10 -9
  80. label_studio_sdk/types/filter_group.py +4 -3
  81. label_studio_sdk/types/gcs_export_storage.py +23 -23
  82. label_studio_sdk/types/gcs_import_storage.py +27 -27
  83. label_studio_sdk/types/import_api_request.py +26 -26
  84. label_studio_sdk/types/inference_run_cost_estimate.py +10 -10
  85. label_studio_sdk/types/local_files_export_storage.py +23 -23
  86. label_studio_sdk/types/local_files_import_storage.py +26 -26
  87. label_studio_sdk/types/lse_annotation_filter_options.py +10 -10
  88. label_studio_sdk/types/lse_annotation_filter_options_request.py +10 -10
  89. label_studio_sdk/types/lse_export_create.py +12 -12
  90. label_studio_sdk/types/lse_fields.py +14 -14
  91. label_studio_sdk/types/lse_organization.py +17 -17
  92. label_studio_sdk/types/lse_organization_member_list.py +1 -1
  93. label_studio_sdk/types/lse_project_create.py +72 -72
  94. label_studio_sdk/types/lse_project_update.py +89 -89
  95. label_studio_sdk/types/lse_s3export_storage.py +46 -46
  96. label_studio_sdk/types/lse_s3export_storage_request.py +43 -43
  97. label_studio_sdk/types/lse_s3import_storage.py +53 -53
  98. label_studio_sdk/types/lse_s3import_storage_request.py +49 -49
  99. label_studio_sdk/types/lse_task.py +49 -49
  100. label_studio_sdk/types/lse_task_drafts_item.py +1 -1
  101. label_studio_sdk/types/lse_task_filter_options.py +14 -14
  102. label_studio_sdk/types/lse_task_filter_options_request.py +14 -14
  103. label_studio_sdk/types/lse_task_predictions_item.py +5 -5
  104. label_studio_sdk/types/lse_task_serializer_for_annotators.py +12 -12
  105. label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +1 -1
  106. label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +5 -5
  107. label_studio_sdk/types/lse_task_serializer_for_reviewers.py +49 -49
  108. label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +1 -1
  109. label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +5 -5
  110. label_studio_sdk/types/lse_user.py +13 -13
  111. label_studio_sdk/types/lse_user_api.py +11 -11
  112. label_studio_sdk/types/lse_user_organization_member_list.py +13 -13
  113. label_studio_sdk/types/lseapi_token_create.py +1 -1
  114. label_studio_sdk/types/lseapi_token_list.py +1 -1
  115. label_studio_sdk/types/lsejwt_settings.py +5 -5
  116. label_studio_sdk/types/ml_backend.py +27 -28
  117. label_studio_sdk/types/model_interface.py +12 -12
  118. label_studio_sdk/types/model_interface_request.py +7 -8
  119. label_studio_sdk/types/model_interface_serializer_get.py +13 -13
  120. label_studio_sdk/types/model_provider_connection.py +34 -34
  121. label_studio_sdk/types/model_provider_connection_request.py +15 -14
  122. label_studio_sdk/types/model_run.py +12 -12
  123. label_studio_sdk/types/organization_billing.py +1 -1
  124. label_studio_sdk/types/organization_id.py +2 -2
  125. label_studio_sdk/types/organization_invite.py +1 -1
  126. label_studio_sdk/types/organization_member.py +8 -9
  127. label_studio_sdk/types/organization_membership.py +2 -1
  128. label_studio_sdk/types/pause.py +23 -23
  129. label_studio_sdk/types/prediction.py +21 -21
  130. label_studio_sdk/types/prediction_request.py +16 -16
  131. label_studio_sdk/types/project.py +72 -72
  132. label_studio_sdk/types/project_group.py +22 -0
  133. label_studio_sdk/types/project_group_request.py +22 -0
  134. label_studio_sdk/types/project_group_role_enum.py +5 -0
  135. label_studio_sdk/types/project_import.py +21 -21
  136. label_studio_sdk/types/redis_export_storage.py +34 -34
  137. label_studio_sdk/types/redis_import_storage.py +37 -37
  138. label_studio_sdk/types/refined_prompt_response.py +11 -11
  139. label_studio_sdk/types/review_settings.py +29 -30
  140. label_studio_sdk/types/review_settings_request.py +29 -30
  141. label_studio_sdk/types/s3export_storage.py +45 -45
  142. label_studio_sdk/types/s3import_storage.py +44 -44
  143. label_studio_sdk/types/saml_settings.py +21 -0
  144. label_studio_sdk/types/saml_settings_update.py +22 -0
  145. label_studio_sdk/types/scim_settings.py +21 -0
  146. label_studio_sdk/types/scim_settings_update.py +22 -0
  147. label_studio_sdk/types/selected_items_request.py +1 -1
  148. label_studio_sdk/types/serialization_options.py +10 -10
  149. label_studio_sdk/types/serialization_options_request.py +10 -10
  150. label_studio_sdk/types/task_assignment.py +43 -0
  151. label_studio_sdk/types/third_party_model_version.py +11 -11
  152. label_studio_sdk/types/third_party_model_version_request.py +6 -7
  153. label_studio_sdk/types/type_enum.py +5 -0
  154. label_studio_sdk/types/user_simple.py +3 -3
  155. label_studio_sdk/types/user_simple_request.py +1 -1
  156. label_studio_sdk/types/version_response.py +19 -20
  157. label_studio_sdk/types/view.py +8 -8
  158. label_studio_sdk/types/webhook.py +16 -16
  159. label_studio_sdk/types/webhook_serializer_for_update.py +16 -16
  160. label_studio_sdk/types/workspace.py +10 -11
  161. label_studio_sdk/users/client.py +160 -160
  162. label_studio_sdk/views/client.py +164 -164
  163. label_studio_sdk/webhooks/client.py +183 -183
  164. label_studio_sdk/webhooks/types/webhooks_info_response.py +32 -32
  165. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +1 -1
  166. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +1 -1
  167. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +1 -1
  168. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +1 -1
  169. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +1 -1
  170. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +1 -1
  171. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +1 -1
  172. label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +1 -1
  173. label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +1 -1
  174. label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +1 -1
  175. label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +1 -1
  176. label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +1 -1
  177. label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +1 -1
  178. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +1 -1
  179. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +1 -1
  180. label_studio_sdk/workspaces/client.py +40 -40
  181. {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.3.dist-info}/METADATA +1 -1
  182. {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.3.dist-info}/RECORD +184 -150
  183. {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.3.dist-info}/LICENSE +0 -0
  184. {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.3.dist-info}/WHEEL +0 -0
@@ -79,14 +79,14 @@ class AzureClient:
79
79
  def create(
80
80
  self,
81
81
  *,
82
+ account_key: typing.Optional[str] = OMIT,
83
+ account_name: typing.Optional[str] = OMIT,
82
84
  can_delete_objects: typing.Optional[bool] = OMIT,
83
- title: typing.Optional[str] = OMIT,
84
- description: typing.Optional[str] = OMIT,
85
- project: typing.Optional[int] = OMIT,
86
85
  container: typing.Optional[str] = OMIT,
86
+ description: typing.Optional[str] = OMIT,
87
87
  prefix: typing.Optional[str] = OMIT,
88
- account_name: typing.Optional[str] = OMIT,
89
- account_key: typing.Optional[str] = OMIT,
88
+ project: typing.Optional[int] = OMIT,
89
+ title: typing.Optional[str] = OMIT,
90
90
  request_options: typing.Optional[RequestOptions] = None,
91
91
  ) -> AzureBlobExportStorage:
92
92
  """
@@ -94,29 +94,29 @@ class AzureClient:
94
94
 
95
95
  Parameters
96
96
  ----------
97
+ account_key : typing.Optional[str]
98
+ Azure Blob account key
99
+
100
+ account_name : typing.Optional[str]
101
+ Azure Blob account name
102
+
97
103
  can_delete_objects : typing.Optional[bool]
98
104
  Deletion from storage enabled
99
105
 
100
- title : typing.Optional[str]
101
- Storage title
106
+ container : typing.Optional[str]
107
+ Azure blob container
102
108
 
103
109
  description : typing.Optional[str]
104
110
  Storage description
105
111
 
106
- project : typing.Optional[int]
107
- Project ID
108
-
109
- container : typing.Optional[str]
110
- Azure blob container
111
-
112
112
  prefix : typing.Optional[str]
113
113
  Azure blob prefix name
114
114
 
115
- account_name : typing.Optional[str]
116
- Azure Blob account name
115
+ project : typing.Optional[int]
116
+ Project ID
117
117
 
118
- account_key : typing.Optional[str]
119
- Azure Blob account key
118
+ title : typing.Optional[str]
119
+ Storage title
120
120
 
121
121
  request_options : typing.Optional[RequestOptions]
122
122
  Request-specific configuration.
@@ -139,14 +139,14 @@ class AzureClient:
139
139
  "api/storages/export/azure",
140
140
  method="POST",
141
141
  json={
142
+ "account_key": account_key,
143
+ "account_name": account_name,
142
144
  "can_delete_objects": can_delete_objects,
143
- "title": title,
144
- "description": description,
145
- "project": project,
146
145
  "container": container,
146
+ "description": description,
147
147
  "prefix": prefix,
148
- "account_name": account_name,
149
- "account_key": account_key,
148
+ "project": project,
149
+ "title": title,
150
150
  },
151
151
  headers={
152
152
  "content-type": "application/json",
@@ -168,6 +168,96 @@ class AzureClient:
168
168
  raise ApiError(status_code=_response.status_code, body=_response.text)
169
169
  raise ApiError(status_code=_response.status_code, body=_response_json)
170
170
 
171
+ def validate(
172
+ self,
173
+ *,
174
+ account_key: typing.Optional[str] = OMIT,
175
+ account_name: typing.Optional[str] = OMIT,
176
+ can_delete_objects: typing.Optional[bool] = OMIT,
177
+ container: typing.Optional[str] = OMIT,
178
+ description: typing.Optional[str] = OMIT,
179
+ id: typing.Optional[int] = OMIT,
180
+ prefix: typing.Optional[str] = OMIT,
181
+ project: typing.Optional[int] = OMIT,
182
+ title: typing.Optional[str] = OMIT,
183
+ request_options: typing.Optional[RequestOptions] = None,
184
+ ) -> None:
185
+ """
186
+ Validate a specific Azure export storage connection.
187
+
188
+ Parameters
189
+ ----------
190
+ account_key : typing.Optional[str]
191
+ Azure Blob account key
192
+
193
+ account_name : typing.Optional[str]
194
+ Azure Blob account name
195
+
196
+ can_delete_objects : typing.Optional[bool]
197
+ Deletion from storage enabled
198
+
199
+ container : typing.Optional[str]
200
+ Azure blob container
201
+
202
+ description : typing.Optional[str]
203
+ Storage description
204
+
205
+ id : typing.Optional[int]
206
+ Storage ID. If set, storage with specified ID will be updated
207
+
208
+ prefix : typing.Optional[str]
209
+ Azure blob prefix name
210
+
211
+ project : typing.Optional[int]
212
+ Project ID
213
+
214
+ title : typing.Optional[str]
215
+ Storage title
216
+
217
+ request_options : typing.Optional[RequestOptions]
218
+ Request-specific configuration.
219
+
220
+ Returns
221
+ -------
222
+ None
223
+
224
+ Examples
225
+ --------
226
+ from label_studio_sdk import LabelStudio
227
+
228
+ client = LabelStudio(
229
+ api_key="YOUR_API_KEY",
230
+ )
231
+ client.export_storage.azure.validate()
232
+ """
233
+ _response = self._client_wrapper.httpx_client.request(
234
+ "api/storages/export/azure/validate",
235
+ method="POST",
236
+ json={
237
+ "account_key": account_key,
238
+ "account_name": account_name,
239
+ "can_delete_objects": can_delete_objects,
240
+ "container": container,
241
+ "description": description,
242
+ "id": id,
243
+ "prefix": prefix,
244
+ "project": project,
245
+ "title": title,
246
+ },
247
+ headers={
248
+ "content-type": "application/json",
249
+ },
250
+ request_options=request_options,
251
+ omit=OMIT,
252
+ )
253
+ try:
254
+ if 200 <= _response.status_code < 300:
255
+ return
256
+ _response_json = _response.json()
257
+ except JSONDecodeError:
258
+ raise ApiError(status_code=_response.status_code, body=_response.text)
259
+ raise ApiError(status_code=_response.status_code, body=_response_json)
260
+
171
261
  def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> AzureBlobExportStorage:
172
262
  """
173
263
  Get a specific Azure export storage connection.
@@ -257,14 +347,14 @@ class AzureClient:
257
347
  self,
258
348
  id: int,
259
349
  *,
350
+ account_key: typing.Optional[str] = OMIT,
351
+ account_name: typing.Optional[str] = OMIT,
260
352
  can_delete_objects: typing.Optional[bool] = OMIT,
261
- title: typing.Optional[str] = OMIT,
262
- description: typing.Optional[str] = OMIT,
263
- project: typing.Optional[int] = OMIT,
264
353
  container: typing.Optional[str] = OMIT,
354
+ description: typing.Optional[str] = OMIT,
265
355
  prefix: typing.Optional[str] = OMIT,
266
- account_name: typing.Optional[str] = OMIT,
267
- account_key: typing.Optional[str] = OMIT,
356
+ project: typing.Optional[int] = OMIT,
357
+ title: typing.Optional[str] = OMIT,
268
358
  request_options: typing.Optional[RequestOptions] = None,
269
359
  ) -> AzureBlobExportStorage:
270
360
  """
@@ -274,29 +364,29 @@ class AzureClient:
274
364
  ----------
275
365
  id : int
276
366
 
367
+ account_key : typing.Optional[str]
368
+ Azure Blob account key
369
+
370
+ account_name : typing.Optional[str]
371
+ Azure Blob account name
372
+
277
373
  can_delete_objects : typing.Optional[bool]
278
374
  Deletion from storage enabled
279
375
 
280
- title : typing.Optional[str]
281
- Storage title
376
+ container : typing.Optional[str]
377
+ Azure blob container
282
378
 
283
379
  description : typing.Optional[str]
284
380
  Storage description
285
381
 
286
- project : typing.Optional[int]
287
- Project ID
288
-
289
- container : typing.Optional[str]
290
- Azure blob container
291
-
292
382
  prefix : typing.Optional[str]
293
383
  Azure blob prefix name
294
384
 
295
- account_name : typing.Optional[str]
296
- Azure Blob account name
385
+ project : typing.Optional[int]
386
+ Project ID
297
387
 
298
- account_key : typing.Optional[str]
299
- Azure Blob account key
388
+ title : typing.Optional[str]
389
+ Storage title
300
390
 
301
391
  request_options : typing.Optional[RequestOptions]
302
392
  Request-specific configuration.
@@ -321,14 +411,14 @@ class AzureClient:
321
411
  f"api/storages/export/azure/{jsonable_encoder(id)}",
322
412
  method="PATCH",
323
413
  json={
414
+ "account_key": account_key,
415
+ "account_name": account_name,
324
416
  "can_delete_objects": can_delete_objects,
325
- "title": title,
326
- "description": description,
327
- "project": project,
328
417
  "container": container,
418
+ "description": description,
329
419
  "prefix": prefix,
330
- "account_name": account_name,
331
- "account_key": account_key,
420
+ "project": project,
421
+ "title": title,
332
422
  },
333
423
  headers={
334
424
  "content-type": "application/json",
@@ -396,125 +486,125 @@ class AzureClient:
396
486
  raise ApiError(status_code=_response.status_code, body=_response.text)
397
487
  raise ApiError(status_code=_response.status_code, body=_response_json)
398
488
 
399
- def validate(
489
+
490
+ class AsyncAzureClient:
491
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
492
+ self._client_wrapper = client_wrapper
493
+
494
+ async def list(
400
495
  self,
401
496
  *,
402
- id: typing.Optional[int] = OMIT,
403
- can_delete_objects: typing.Optional[bool] = OMIT,
404
- title: typing.Optional[str] = OMIT,
405
- description: typing.Optional[str] = OMIT,
406
- project: typing.Optional[int] = OMIT,
407
- container: typing.Optional[str] = OMIT,
408
- prefix: typing.Optional[str] = OMIT,
409
- account_name: typing.Optional[str] = OMIT,
410
- account_key: typing.Optional[str] = OMIT,
497
+ ordering: typing.Optional[str] = None,
498
+ project: typing.Optional[int] = None,
411
499
  request_options: typing.Optional[RequestOptions] = None,
412
- ) -> None:
500
+ ) -> typing.List[AzureBlobExportStorage]:
413
501
  """
414
- Validate a specific Azure export storage connection.
502
+ Get a list of all Azure export storage connections.
415
503
 
416
504
  Parameters
417
505
  ----------
418
- id : typing.Optional[int]
419
- Storage ID. If set, storage with specified ID will be updated
420
-
421
- can_delete_objects : typing.Optional[bool]
422
- Deletion from storage enabled
423
-
424
- title : typing.Optional[str]
425
- Storage title
426
-
427
- description : typing.Optional[str]
428
- Storage description
506
+ ordering : typing.Optional[str]
507
+ Which field to use when ordering the results.
429
508
 
430
509
  project : typing.Optional[int]
431
510
  Project ID
432
511
 
433
- container : typing.Optional[str]
434
- Azure blob container
435
-
436
- prefix : typing.Optional[str]
437
- Azure blob prefix name
438
-
439
- account_name : typing.Optional[str]
440
- Azure Blob account name
441
-
442
- account_key : typing.Optional[str]
443
- Azure Blob account key
444
-
445
512
  request_options : typing.Optional[RequestOptions]
446
513
  Request-specific configuration.
447
514
 
448
515
  Returns
449
516
  -------
450
- None
517
+ typing.List[AzureBlobExportStorage]
518
+
451
519
 
452
520
  Examples
453
521
  --------
454
- from label_studio_sdk import LabelStudio
522
+ import asyncio
455
523
 
456
- client = LabelStudio(
524
+ from label_studio_sdk import AsyncLabelStudio
525
+
526
+ client = AsyncLabelStudio(
457
527
  api_key="YOUR_API_KEY",
458
528
  )
459
- client.export_storage.azure.validate()
529
+
530
+
531
+ async def main() -> None:
532
+ await client.export_storage.azure.list()
533
+
534
+
535
+ asyncio.run(main())
460
536
  """
461
- _response = self._client_wrapper.httpx_client.request(
462
- "api/storages/export/azure/validate",
463
- method="POST",
464
- json={
465
- "id": id,
466
- "can_delete_objects": can_delete_objects,
467
- "title": title,
468
- "description": description,
537
+ _response = await self._client_wrapper.httpx_client.request(
538
+ "api/storages/export/azure",
539
+ method="GET",
540
+ params={
541
+ "ordering": ordering,
469
542
  "project": project,
470
- "container": container,
471
- "prefix": prefix,
472
- "account_name": account_name,
473
- "account_key": account_key,
474
- },
475
- headers={
476
- "content-type": "application/json",
477
543
  },
478
544
  request_options=request_options,
479
- omit=OMIT,
480
545
  )
481
546
  try:
482
547
  if 200 <= _response.status_code < 300:
483
- return
548
+ return typing.cast(
549
+ typing.List[AzureBlobExportStorage],
550
+ construct_type(
551
+ type_=typing.List[AzureBlobExportStorage], # type: ignore
552
+ object_=_response.json(),
553
+ ),
554
+ )
484
555
  _response_json = _response.json()
485
556
  except JSONDecodeError:
486
557
  raise ApiError(status_code=_response.status_code, body=_response.text)
487
558
  raise ApiError(status_code=_response.status_code, body=_response_json)
488
559
 
489
-
490
- class AsyncAzureClient:
491
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
492
- self._client_wrapper = client_wrapper
493
-
494
- async def list(
560
+ async def create(
495
561
  self,
496
562
  *,
497
- ordering: typing.Optional[str] = None,
498
- project: typing.Optional[int] = None,
563
+ account_key: typing.Optional[str] = OMIT,
564
+ account_name: typing.Optional[str] = OMIT,
565
+ can_delete_objects: typing.Optional[bool] = OMIT,
566
+ container: typing.Optional[str] = OMIT,
567
+ description: typing.Optional[str] = OMIT,
568
+ prefix: typing.Optional[str] = OMIT,
569
+ project: typing.Optional[int] = OMIT,
570
+ title: typing.Optional[str] = OMIT,
499
571
  request_options: typing.Optional[RequestOptions] = None,
500
- ) -> typing.List[AzureBlobExportStorage]:
572
+ ) -> AzureBlobExportStorage:
501
573
  """
502
- Get a list of all Azure export storage connections.
574
+ Create a new Azure export storage connection to store annotations.
503
575
 
504
576
  Parameters
505
577
  ----------
506
- ordering : typing.Optional[str]
507
- Which field to use when ordering the results.
578
+ account_key : typing.Optional[str]
579
+ Azure Blob account key
580
+
581
+ account_name : typing.Optional[str]
582
+ Azure Blob account name
583
+
584
+ can_delete_objects : typing.Optional[bool]
585
+ Deletion from storage enabled
586
+
587
+ container : typing.Optional[str]
588
+ Azure blob container
589
+
590
+ description : typing.Optional[str]
591
+ Storage description
592
+
593
+ prefix : typing.Optional[str]
594
+ Azure blob prefix name
508
595
 
509
596
  project : typing.Optional[int]
510
597
  Project ID
511
598
 
599
+ title : typing.Optional[str]
600
+ Storage title
601
+
512
602
  request_options : typing.Optional[RequestOptions]
513
603
  Request-specific configuration.
514
604
 
515
605
  Returns
516
606
  -------
517
- typing.List[AzureBlobExportStorage]
607
+ AzureBlobExportStorage
518
608
 
519
609
 
520
610
  Examples
@@ -529,26 +619,36 @@ class AsyncAzureClient:
529
619
 
530
620
 
531
621
  async def main() -> None:
532
- await client.export_storage.azure.list()
622
+ await client.export_storage.azure.create()
533
623
 
534
624
 
535
625
  asyncio.run(main())
536
626
  """
537
627
  _response = await self._client_wrapper.httpx_client.request(
538
628
  "api/storages/export/azure",
539
- method="GET",
540
- params={
541
- "ordering": ordering,
629
+ method="POST",
630
+ json={
631
+ "account_key": account_key,
632
+ "account_name": account_name,
633
+ "can_delete_objects": can_delete_objects,
634
+ "container": container,
635
+ "description": description,
636
+ "prefix": prefix,
542
637
  "project": project,
638
+ "title": title,
639
+ },
640
+ headers={
641
+ "content-type": "application/json",
543
642
  },
544
643
  request_options=request_options,
644
+ omit=OMIT,
545
645
  )
546
646
  try:
547
647
  if 200 <= _response.status_code < 300:
548
648
  return typing.cast(
549
- typing.List[AzureBlobExportStorage],
649
+ AzureBlobExportStorage,
550
650
  construct_type(
551
- type_=typing.List[AzureBlobExportStorage], # type: ignore
651
+ type_=AzureBlobExportStorage, # type: ignore
552
652
  object_=_response.json(),
553
653
  ),
554
654
  )
@@ -557,55 +657,58 @@ class AsyncAzureClient:
557
657
  raise ApiError(status_code=_response.status_code, body=_response.text)
558
658
  raise ApiError(status_code=_response.status_code, body=_response_json)
559
659
 
560
- async def create(
660
+ async def validate(
561
661
  self,
562
662
  *,
663
+ account_key: typing.Optional[str] = OMIT,
664
+ account_name: typing.Optional[str] = OMIT,
563
665
  can_delete_objects: typing.Optional[bool] = OMIT,
564
- title: typing.Optional[str] = OMIT,
565
- description: typing.Optional[str] = OMIT,
566
- project: typing.Optional[int] = OMIT,
567
666
  container: typing.Optional[str] = OMIT,
667
+ description: typing.Optional[str] = OMIT,
668
+ id: typing.Optional[int] = OMIT,
568
669
  prefix: typing.Optional[str] = OMIT,
569
- account_name: typing.Optional[str] = OMIT,
570
- account_key: typing.Optional[str] = OMIT,
670
+ project: typing.Optional[int] = OMIT,
671
+ title: typing.Optional[str] = OMIT,
571
672
  request_options: typing.Optional[RequestOptions] = None,
572
- ) -> AzureBlobExportStorage:
673
+ ) -> None:
573
674
  """
574
- Create a new Azure export storage connection to store annotations.
675
+ Validate a specific Azure export storage connection.
575
676
 
576
677
  Parameters
577
678
  ----------
679
+ account_key : typing.Optional[str]
680
+ Azure Blob account key
681
+
682
+ account_name : typing.Optional[str]
683
+ Azure Blob account name
684
+
578
685
  can_delete_objects : typing.Optional[bool]
579
686
  Deletion from storage enabled
580
687
 
581
- title : typing.Optional[str]
582
- Storage title
688
+ container : typing.Optional[str]
689
+ Azure blob container
583
690
 
584
691
  description : typing.Optional[str]
585
692
  Storage description
586
693
 
587
- project : typing.Optional[int]
588
- Project ID
589
-
590
- container : typing.Optional[str]
591
- Azure blob container
694
+ id : typing.Optional[int]
695
+ Storage ID. If set, storage with specified ID will be updated
592
696
 
593
697
  prefix : typing.Optional[str]
594
698
  Azure blob prefix name
595
699
 
596
- account_name : typing.Optional[str]
597
- Azure Blob account name
700
+ project : typing.Optional[int]
701
+ Project ID
598
702
 
599
- account_key : typing.Optional[str]
600
- Azure Blob account key
703
+ title : typing.Optional[str]
704
+ Storage title
601
705
 
602
706
  request_options : typing.Optional[RequestOptions]
603
707
  Request-specific configuration.
604
708
 
605
709
  Returns
606
710
  -------
607
- AzureBlobExportStorage
608
-
711
+ None
609
712
 
610
713
  Examples
611
714
  --------
@@ -619,23 +722,24 @@ class AsyncAzureClient:
619
722
 
620
723
 
621
724
  async def main() -> None:
622
- await client.export_storage.azure.create()
725
+ await client.export_storage.azure.validate()
623
726
 
624
727
 
625
728
  asyncio.run(main())
626
729
  """
627
730
  _response = await self._client_wrapper.httpx_client.request(
628
- "api/storages/export/azure",
731
+ "api/storages/export/azure/validate",
629
732
  method="POST",
630
733
  json={
734
+ "account_key": account_key,
735
+ "account_name": account_name,
631
736
  "can_delete_objects": can_delete_objects,
632
- "title": title,
633
- "description": description,
634
- "project": project,
635
737
  "container": container,
738
+ "description": description,
739
+ "id": id,
636
740
  "prefix": prefix,
637
- "account_name": account_name,
638
- "account_key": account_key,
741
+ "project": project,
742
+ "title": title,
639
743
  },
640
744
  headers={
641
745
  "content-type": "application/json",
@@ -645,13 +749,7 @@ class AsyncAzureClient:
645
749
  )
646
750
  try:
647
751
  if 200 <= _response.status_code < 300:
648
- return typing.cast(
649
- AzureBlobExportStorage,
650
- construct_type(
651
- type_=AzureBlobExportStorage, # type: ignore
652
- object_=_response.json(),
653
- ),
654
- )
752
+ return
655
753
  _response_json = _response.json()
656
754
  except JSONDecodeError:
657
755
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -762,14 +860,14 @@ class AsyncAzureClient:
762
860
  self,
763
861
  id: int,
764
862
  *,
863
+ account_key: typing.Optional[str] = OMIT,
864
+ account_name: typing.Optional[str] = OMIT,
765
865
  can_delete_objects: typing.Optional[bool] = OMIT,
766
- title: typing.Optional[str] = OMIT,
767
- description: typing.Optional[str] = OMIT,
768
- project: typing.Optional[int] = OMIT,
769
866
  container: typing.Optional[str] = OMIT,
867
+ description: typing.Optional[str] = OMIT,
770
868
  prefix: typing.Optional[str] = OMIT,
771
- account_name: typing.Optional[str] = OMIT,
772
- account_key: typing.Optional[str] = OMIT,
869
+ project: typing.Optional[int] = OMIT,
870
+ title: typing.Optional[str] = OMIT,
773
871
  request_options: typing.Optional[RequestOptions] = None,
774
872
  ) -> AzureBlobExportStorage:
775
873
  """
@@ -779,29 +877,29 @@ class AsyncAzureClient:
779
877
  ----------
780
878
  id : int
781
879
 
880
+ account_key : typing.Optional[str]
881
+ Azure Blob account key
882
+
883
+ account_name : typing.Optional[str]
884
+ Azure Blob account name
885
+
782
886
  can_delete_objects : typing.Optional[bool]
783
887
  Deletion from storage enabled
784
888
 
785
- title : typing.Optional[str]
786
- Storage title
889
+ container : typing.Optional[str]
890
+ Azure blob container
787
891
 
788
892
  description : typing.Optional[str]
789
893
  Storage description
790
894
 
791
- project : typing.Optional[int]
792
- Project ID
793
-
794
- container : typing.Optional[str]
795
- Azure blob container
796
-
797
895
  prefix : typing.Optional[str]
798
896
  Azure blob prefix name
799
897
 
800
- account_name : typing.Optional[str]
801
- Azure Blob account name
898
+ project : typing.Optional[int]
899
+ Project ID
802
900
 
803
- account_key : typing.Optional[str]
804
- Azure Blob account key
901
+ title : typing.Optional[str]
902
+ Storage title
805
903
 
806
904
  request_options : typing.Optional[RequestOptions]
807
905
  Request-specific configuration.
@@ -834,14 +932,14 @@ class AsyncAzureClient:
834
932
  f"api/storages/export/azure/{jsonable_encoder(id)}",
835
933
  method="PATCH",
836
934
  json={
935
+ "account_key": account_key,
936
+ "account_name": account_name,
837
937
  "can_delete_objects": can_delete_objects,
838
- "title": title,
839
- "description": description,
840
- "project": project,
841
938
  "container": container,
939
+ "description": description,
842
940
  "prefix": prefix,
843
- "account_name": account_name,
844
- "account_key": account_key,
941
+ "project": project,
942
+ "title": title,
845
943
  },
846
944
  headers={
847
945
  "content-type": "application/json",
@@ -916,101 +1014,3 @@ class AsyncAzureClient:
916
1014
  except JSONDecodeError:
917
1015
  raise ApiError(status_code=_response.status_code, body=_response.text)
918
1016
  raise ApiError(status_code=_response.status_code, body=_response_json)
919
-
920
- async def validate(
921
- self,
922
- *,
923
- id: typing.Optional[int] = OMIT,
924
- can_delete_objects: typing.Optional[bool] = OMIT,
925
- title: typing.Optional[str] = OMIT,
926
- description: typing.Optional[str] = OMIT,
927
- project: typing.Optional[int] = OMIT,
928
- container: typing.Optional[str] = OMIT,
929
- prefix: typing.Optional[str] = OMIT,
930
- account_name: typing.Optional[str] = OMIT,
931
- account_key: typing.Optional[str] = OMIT,
932
- request_options: typing.Optional[RequestOptions] = None,
933
- ) -> None:
934
- """
935
- Validate a specific Azure export storage connection.
936
-
937
- Parameters
938
- ----------
939
- id : typing.Optional[int]
940
- Storage ID. If set, storage with specified ID will be updated
941
-
942
- can_delete_objects : typing.Optional[bool]
943
- Deletion from storage enabled
944
-
945
- title : typing.Optional[str]
946
- Storage title
947
-
948
- description : typing.Optional[str]
949
- Storage description
950
-
951
- project : typing.Optional[int]
952
- Project ID
953
-
954
- container : typing.Optional[str]
955
- Azure blob container
956
-
957
- prefix : typing.Optional[str]
958
- Azure blob prefix name
959
-
960
- account_name : typing.Optional[str]
961
- Azure Blob account name
962
-
963
- account_key : typing.Optional[str]
964
- Azure Blob account key
965
-
966
- request_options : typing.Optional[RequestOptions]
967
- Request-specific configuration.
968
-
969
- Returns
970
- -------
971
- None
972
-
973
- Examples
974
- --------
975
- import asyncio
976
-
977
- from label_studio_sdk import AsyncLabelStudio
978
-
979
- client = AsyncLabelStudio(
980
- api_key="YOUR_API_KEY",
981
- )
982
-
983
-
984
- async def main() -> None:
985
- await client.export_storage.azure.validate()
986
-
987
-
988
- asyncio.run(main())
989
- """
990
- _response = await self._client_wrapper.httpx_client.request(
991
- "api/storages/export/azure/validate",
992
- method="POST",
993
- json={
994
- "id": id,
995
- "can_delete_objects": can_delete_objects,
996
- "title": title,
997
- "description": description,
998
- "project": project,
999
- "container": container,
1000
- "prefix": prefix,
1001
- "account_name": account_name,
1002
- "account_key": account_key,
1003
- },
1004
- headers={
1005
- "content-type": "application/json",
1006
- },
1007
- request_options=request_options,
1008
- omit=OMIT,
1009
- )
1010
- try:
1011
- if 200 <= _response.status_code < 300:
1012
- return
1013
- _response_json = _response.json()
1014
- except JSONDecodeError:
1015
- raise ApiError(status_code=_response.status_code, body=_response.text)
1016
- raise ApiError(status_code=_response.status_code, body=_response_json)