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.

Files changed (167) hide show
  1. label_studio_sdk/__init__.py +4 -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/comments/client.py +176 -176
  7. label_studio_sdk/export_storage/azure/client.py +274 -274
  8. label_studio_sdk/export_storage/gcs/client.py +263 -263
  9. label_studio_sdk/export_storage/local/client.py +206 -206
  10. label_studio_sdk/export_storage/redis/client.py +287 -287
  11. label_studio_sdk/export_storage/s3/client.py +347 -347
  12. label_studio_sdk/export_storage/s3s/client.py +678 -678
  13. label_studio_sdk/import_storage/azure/client.py +357 -357
  14. label_studio_sdk/import_storage/gcs/client.py +357 -357
  15. label_studio_sdk/import_storage/local/client.py +206 -206
  16. label_studio_sdk/import_storage/redis/client.py +309 -309
  17. label_studio_sdk/import_storage/s3/client.py +452 -452
  18. label_studio_sdk/import_storage/s3s/client.py +735 -735
  19. label_studio_sdk/jwt_settings/client.py +10 -10
  20. label_studio_sdk/ml/client.py +118 -118
  21. label_studio_sdk/ml/types/ml_list_model_versions_response.py +1 -1
  22. label_studio_sdk/model_providers/client.py +181 -181
  23. label_studio_sdk/organizations/members/client.py +8 -8
  24. label_studio_sdk/predictions/client.py +60 -60
  25. label_studio_sdk/projects/__init__.py +30 -1
  26. label_studio_sdk/projects/assignments/__init__.py +33 -0
  27. label_studio_sdk/projects/assignments/client.py +764 -0
  28. label_studio_sdk/projects/assignments/types/__init__.py +35 -0
  29. label_studio_sdk/projects/assignments/types/assignments_assign_request_type.py +5 -0
  30. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters.py +33 -0
  31. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_conjunction.py +5 -0
  32. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item.py +44 -0
  33. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_filter.py +31 -0
  34. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_operator.py +23 -0
  35. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_value.py +7 -0
  36. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items.py +9 -0
  37. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_excluded.py +29 -0
  38. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_included.py +29 -0
  39. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_type.py +5 -0
  40. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_response.py +22 -0
  41. label_studio_sdk/projects/assignments/types/assignments_update_request_type.py +5 -0
  42. label_studio_sdk/projects/client.py +441 -425
  43. label_studio_sdk/projects/exports/client.py +55 -55
  44. label_studio_sdk/projects/exports/types/exports_convert_response.py +1 -1
  45. label_studio_sdk/projects/stats/types/stats_iaa_response.py +5 -5
  46. label_studio_sdk/projects/types/projects_import_tasks_response.py +12 -12
  47. label_studio_sdk/prompts/client.py +211 -211
  48. label_studio_sdk/prompts/runs/client.py +33 -33
  49. label_studio_sdk/prompts/versions/client.py +72 -72
  50. label_studio_sdk/tasks/client.py +174 -174
  51. label_studio_sdk/types/__init__.py +4 -0
  52. label_studio_sdk/types/all_roles_project_list.py +94 -94
  53. label_studio_sdk/types/annotation.py +35 -35
  54. label_studio_sdk/types/annotation_request.py +27 -27
  55. label_studio_sdk/types/azure_blob_export_storage.py +29 -29
  56. label_studio_sdk/types/azure_blob_import_storage.py +33 -33
  57. label_studio_sdk/types/batch_failed_predictions.py +1 -1
  58. label_studio_sdk/types/billing_checks.py +14 -14
  59. label_studio_sdk/types/billing_flags.py +16 -16
  60. label_studio_sdk/types/blueprint_list.py +7 -8
  61. label_studio_sdk/types/child_filter.py +11 -10
  62. label_studio_sdk/types/comment.py +15 -15
  63. label_studio_sdk/types/comment_request.py +7 -8
  64. label_studio_sdk/types/comment_serializer_with_expanded_user.py +17 -18
  65. label_studio_sdk/types/converted_format.py +1 -1
  66. label_studio_sdk/types/converted_format_request.py +1 -1
  67. label_studio_sdk/types/export.py +8 -8
  68. label_studio_sdk/types/file_upload.py +3 -2
  69. label_studio_sdk/types/filter.py +10 -9
  70. label_studio_sdk/types/filter_group.py +4 -3
  71. label_studio_sdk/types/gcs_export_storage.py +23 -23
  72. label_studio_sdk/types/gcs_import_storage.py +27 -27
  73. label_studio_sdk/types/import_api_request.py +26 -26
  74. label_studio_sdk/types/inference_run_cost_estimate.py +10 -10
  75. label_studio_sdk/types/local_files_export_storage.py +23 -23
  76. label_studio_sdk/types/local_files_import_storage.py +26 -26
  77. label_studio_sdk/types/lse_annotation_filter_options.py +10 -10
  78. label_studio_sdk/types/lse_annotation_filter_options_request.py +10 -10
  79. label_studio_sdk/types/lse_export_create.py +12 -12
  80. label_studio_sdk/types/lse_fields.py +14 -14
  81. label_studio_sdk/types/lse_organization.py +17 -17
  82. label_studio_sdk/types/lse_organization_member_list.py +1 -1
  83. label_studio_sdk/types/lse_project_create.py +72 -72
  84. label_studio_sdk/types/lse_project_update.py +89 -89
  85. label_studio_sdk/types/lse_s3export_storage.py +46 -46
  86. label_studio_sdk/types/lse_s3export_storage_request.py +43 -43
  87. label_studio_sdk/types/lse_s3import_storage.py +53 -53
  88. label_studio_sdk/types/lse_s3import_storage_request.py +49 -49
  89. label_studio_sdk/types/lse_task.py +49 -49
  90. label_studio_sdk/types/lse_task_drafts_item.py +1 -1
  91. label_studio_sdk/types/lse_task_filter_options.py +14 -14
  92. label_studio_sdk/types/lse_task_filter_options_request.py +14 -14
  93. label_studio_sdk/types/lse_task_predictions_item.py +5 -5
  94. label_studio_sdk/types/lse_task_serializer_for_annotators.py +12 -12
  95. label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +1 -1
  96. label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +5 -5
  97. label_studio_sdk/types/lse_task_serializer_for_reviewers.py +49 -49
  98. label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +1 -1
  99. label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +5 -5
  100. label_studio_sdk/types/lse_user.py +13 -13
  101. label_studio_sdk/types/lse_user_api.py +11 -11
  102. label_studio_sdk/types/lse_user_organization_member_list.py +13 -13
  103. label_studio_sdk/types/lseapi_token_create.py +1 -1
  104. label_studio_sdk/types/lseapi_token_list.py +1 -1
  105. label_studio_sdk/types/lsejwt_settings.py +5 -5
  106. label_studio_sdk/types/ml_backend.py +27 -28
  107. label_studio_sdk/types/model_interface.py +12 -12
  108. label_studio_sdk/types/model_interface_request.py +7 -8
  109. label_studio_sdk/types/model_interface_serializer_get.py +13 -13
  110. label_studio_sdk/types/model_provider_connection.py +34 -34
  111. label_studio_sdk/types/model_provider_connection_request.py +15 -14
  112. label_studio_sdk/types/model_run.py +12 -12
  113. label_studio_sdk/types/organization_billing.py +1 -1
  114. label_studio_sdk/types/organization_id.py +2 -2
  115. label_studio_sdk/types/organization_invite.py +1 -1
  116. label_studio_sdk/types/organization_member.py +8 -9
  117. label_studio_sdk/types/organization_membership.py +2 -1
  118. label_studio_sdk/types/pause.py +23 -23
  119. label_studio_sdk/types/prediction.py +21 -21
  120. label_studio_sdk/types/prediction_request.py +16 -16
  121. label_studio_sdk/types/project.py +72 -72
  122. label_studio_sdk/types/project_import.py +21 -21
  123. label_studio_sdk/types/redis_export_storage.py +34 -34
  124. label_studio_sdk/types/redis_import_storage.py +37 -37
  125. label_studio_sdk/types/refined_prompt_response.py +11 -11
  126. label_studio_sdk/types/review_settings.py +29 -30
  127. label_studio_sdk/types/review_settings_request.py +29 -30
  128. label_studio_sdk/types/s3export_storage.py +45 -45
  129. label_studio_sdk/types/s3import_storage.py +44 -44
  130. label_studio_sdk/types/selected_items_request.py +1 -1
  131. label_studio_sdk/types/serialization_options.py +10 -10
  132. label_studio_sdk/types/serialization_options_request.py +10 -10
  133. label_studio_sdk/types/task_assignment.py +43 -0
  134. label_studio_sdk/types/third_party_model_version.py +11 -11
  135. label_studio_sdk/types/third_party_model_version_request.py +6 -7
  136. label_studio_sdk/types/type_enum.py +5 -0
  137. label_studio_sdk/types/user_simple.py +3 -3
  138. label_studio_sdk/types/user_simple_request.py +1 -1
  139. label_studio_sdk/types/version_response.py +19 -20
  140. label_studio_sdk/types/view.py +8 -8
  141. label_studio_sdk/types/webhook.py +16 -16
  142. label_studio_sdk/types/webhook_serializer_for_update.py +16 -16
  143. label_studio_sdk/types/workspace.py +10 -11
  144. label_studio_sdk/users/client.py +160 -160
  145. label_studio_sdk/views/client.py +164 -164
  146. label_studio_sdk/webhooks/client.py +183 -183
  147. label_studio_sdk/webhooks/types/webhooks_info_response.py +32 -32
  148. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +1 -1
  149. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +1 -1
  150. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +1 -1
  151. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +1 -1
  152. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +1 -1
  153. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +1 -1
  154. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +1 -1
  155. label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +1 -1
  156. label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +1 -1
  157. label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +1 -1
  158. label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +1 -1
  159. label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +1 -1
  160. label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +1 -1
  161. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +1 -1
  162. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +1 -1
  163. label_studio_sdk/workspaces/client.py +40 -40
  164. {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/METADATA +1 -1
  165. {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/RECORD +167 -149
  166. {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/LICENSE +0 -0
  167. {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/WHEEL +0 -0
@@ -79,14 +79,14 @@ class GcsClient:
79
79
  def create(
80
80
  self,
81
81
  *,
82
+ bucket: typing.Optional[str] = OMIT,
82
83
  can_delete_objects: typing.Optional[bool] = OMIT,
83
- title: typing.Optional[str] = OMIT,
84
84
  description: typing.Optional[str] = OMIT,
85
- project: typing.Optional[int] = OMIT,
86
- bucket: typing.Optional[str] = OMIT,
87
- prefix: typing.Optional[str] = OMIT,
88
85
  google_application_credentials: typing.Optional[str] = OMIT,
89
86
  google_project_id: typing.Optional[str] = OMIT,
87
+ prefix: 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
  ) -> GcsExportStorage:
92
92
  """
@@ -94,29 +94,29 @@ class GcsClient:
94
94
 
95
95
  Parameters
96
96
  ----------
97
+ bucket : typing.Optional[str]
98
+ GCS bucket name
99
+
97
100
  can_delete_objects : typing.Optional[bool]
98
101
  Deletion from storage enabled.
99
102
 
100
- title : typing.Optional[str]
101
- Storage title
102
-
103
103
  description : typing.Optional[str]
104
104
  Storage description
105
105
 
106
- project : typing.Optional[int]
107
- Project ID
106
+ google_application_credentials : typing.Optional[str]
107
+ The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
108
108
 
109
- bucket : typing.Optional[str]
110
- GCS bucket name
109
+ google_project_id : typing.Optional[str]
110
+ Google project ID
111
111
 
112
112
  prefix : typing.Optional[str]
113
113
  GCS bucket prefix
114
114
 
115
- google_application_credentials : typing.Optional[str]
116
- The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
115
+ project : typing.Optional[int]
116
+ Project ID
117
117
 
118
- google_project_id : typing.Optional[str]
119
- Google project ID
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 GcsClient:
139
139
  "api/storages/export/gcs",
140
140
  method="POST",
141
141
  json={
142
+ "bucket": bucket,
142
143
  "can_delete_objects": can_delete_objects,
143
- "title": title,
144
144
  "description": description,
145
- "project": project,
146
- "bucket": bucket,
147
- "prefix": prefix,
148
145
  "google_application_credentials": google_application_credentials,
149
146
  "google_project_id": google_project_id,
147
+ "prefix": prefix,
148
+ "project": project,
149
+ "title": title,
150
150
  },
151
151
  headers={
152
152
  "content-type": "application/json",
@@ -168,6 +168,96 @@ class GcsClient:
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
+ bucket: typing.Optional[str] = OMIT,
175
+ can_delete_objects: typing.Optional[bool] = OMIT,
176
+ description: typing.Optional[str] = OMIT,
177
+ google_application_credentials: typing.Optional[str] = OMIT,
178
+ google_project_id: 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 GCS export storage connection.
187
+
188
+ Parameters
189
+ ----------
190
+ bucket : typing.Optional[str]
191
+ GCS bucket name
192
+
193
+ can_delete_objects : typing.Optional[bool]
194
+ Deletion from storage enabled.
195
+
196
+ description : typing.Optional[str]
197
+ Storage description
198
+
199
+ google_application_credentials : typing.Optional[str]
200
+ The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
201
+
202
+ google_project_id : typing.Optional[str]
203
+ Google project ID
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
+ GCS bucket prefix
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.gcs.validate()
232
+ """
233
+ _response = self._client_wrapper.httpx_client.request(
234
+ "api/storages/export/gcs/validate",
235
+ method="POST",
236
+ json={
237
+ "bucket": bucket,
238
+ "can_delete_objects": can_delete_objects,
239
+ "description": description,
240
+ "google_application_credentials": google_application_credentials,
241
+ "google_project_id": google_project_id,
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) -> GcsExportStorage:
172
262
  """
173
263
  Get a specific GCS export storage connection.
@@ -257,14 +347,14 @@ class GcsClient:
257
347
  self,
258
348
  id: int,
259
349
  *,
350
+ bucket: typing.Optional[str] = OMIT,
260
351
  can_delete_objects: typing.Optional[bool] = OMIT,
261
- title: typing.Optional[str] = OMIT,
262
352
  description: typing.Optional[str] = OMIT,
263
- project: typing.Optional[int] = OMIT,
264
- bucket: typing.Optional[str] = OMIT,
265
- prefix: typing.Optional[str] = OMIT,
266
353
  google_application_credentials: typing.Optional[str] = OMIT,
267
354
  google_project_id: typing.Optional[str] = OMIT,
355
+ prefix: 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
  ) -> GcsExportStorage:
270
360
  """
@@ -274,29 +364,29 @@ class GcsClient:
274
364
  ----------
275
365
  id : int
276
366
 
367
+ bucket : typing.Optional[str]
368
+ GCS bucket name
369
+
277
370
  can_delete_objects : typing.Optional[bool]
278
371
  Deletion from storage enabled.
279
372
 
280
- title : typing.Optional[str]
281
- Storage title
282
-
283
373
  description : typing.Optional[str]
284
374
  Storage description
285
375
 
286
- project : typing.Optional[int]
287
- Project ID
376
+ google_application_credentials : typing.Optional[str]
377
+ The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
288
378
 
289
- bucket : typing.Optional[str]
290
- GCS bucket name
379
+ google_project_id : typing.Optional[str]
380
+ Google project ID
291
381
 
292
382
  prefix : typing.Optional[str]
293
383
  GCS bucket prefix
294
384
 
295
- google_application_credentials : typing.Optional[str]
296
- The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
385
+ project : typing.Optional[int]
386
+ Project ID
297
387
 
298
- google_project_id : typing.Optional[str]
299
- Google project ID
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 GcsClient:
321
411
  f"api/storages/export/gcs/{jsonable_encoder(id)}",
322
412
  method="PATCH",
323
413
  json={
414
+ "bucket": bucket,
324
415
  "can_delete_objects": can_delete_objects,
325
- "title": title,
326
416
  "description": description,
327
- "project": project,
328
- "bucket": bucket,
329
- "prefix": prefix,
330
417
  "google_application_credentials": google_application_credentials,
331
418
  "google_project_id": google_project_id,
419
+ "prefix": prefix,
420
+ "project": project,
421
+ "title": title,
332
422
  },
333
423
  headers={
334
424
  "content-type": "application/json",
@@ -396,125 +486,125 @@ class GcsClient:
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 AsyncGcsClient:
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
- bucket: typing.Optional[str] = OMIT,
408
- prefix: typing.Optional[str] = OMIT,
409
- google_application_credentials: typing.Optional[str] = OMIT,
410
- google_project_id: 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[GcsExportStorage]:
413
501
  """
414
- Validate a specific GCS export storage connection.
502
+ Get a list of all GCS 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
- bucket : typing.Optional[str]
434
- GCS bucket name
435
-
436
- prefix : typing.Optional[str]
437
- GCS bucket prefix
438
-
439
- google_application_credentials : typing.Optional[str]
440
- The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
441
-
442
- google_project_id : typing.Optional[str]
443
- Google project ID
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[GcsExportStorage]
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.gcs.validate()
529
+
530
+
531
+ async def main() -> None:
532
+ await client.export_storage.gcs.list()
533
+
534
+
535
+ asyncio.run(main())
460
536
  """
461
- _response = self._client_wrapper.httpx_client.request(
462
- "api/storages/export/gcs/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/gcs",
539
+ method="GET",
540
+ params={
541
+ "ordering": ordering,
469
542
  "project": project,
470
- "bucket": bucket,
471
- "prefix": prefix,
472
- "google_application_credentials": google_application_credentials,
473
- "google_project_id": google_project_id,
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[GcsExportStorage],
550
+ construct_type(
551
+ type_=typing.List[GcsExportStorage], # 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 AsyncGcsClient:
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
+ bucket: typing.Optional[str] = OMIT,
564
+ can_delete_objects: typing.Optional[bool] = OMIT,
565
+ description: typing.Optional[str] = OMIT,
566
+ google_application_credentials: typing.Optional[str] = OMIT,
567
+ google_project_id: 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[GcsExportStorage]:
572
+ ) -> GcsExportStorage:
501
573
  """
502
- Get a list of all GCS export storage connections.
574
+ Create a new GCS 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
+ bucket : typing.Optional[str]
579
+ GCS bucket name
580
+
581
+ can_delete_objects : typing.Optional[bool]
582
+ Deletion from storage enabled.
583
+
584
+ description : typing.Optional[str]
585
+ Storage description
586
+
587
+ google_application_credentials : typing.Optional[str]
588
+ The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
589
+
590
+ google_project_id : typing.Optional[str]
591
+ Google project ID
592
+
593
+ prefix : typing.Optional[str]
594
+ GCS bucket prefix
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[GcsExportStorage]
607
+ GcsExportStorage
518
608
 
519
609
 
520
610
  Examples
@@ -529,26 +619,36 @@ class AsyncGcsClient:
529
619
 
530
620
 
531
621
  async def main() -> None:
532
- await client.export_storage.gcs.list()
622
+ await client.export_storage.gcs.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/gcs",
539
- method="GET",
540
- params={
541
- "ordering": ordering,
629
+ method="POST",
630
+ json={
631
+ "bucket": bucket,
632
+ "can_delete_objects": can_delete_objects,
633
+ "description": description,
634
+ "google_application_credentials": google_application_credentials,
635
+ "google_project_id": google_project_id,
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[GcsExportStorage],
649
+ GcsExportStorage,
550
650
  construct_type(
551
- type_=typing.List[GcsExportStorage], # type: ignore
651
+ type_=GcsExportStorage, # type: ignore
552
652
  object_=_response.json(),
553
653
  ),
554
654
  )
@@ -557,55 +657,58 @@ class AsyncGcsClient:
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
+ bucket: typing.Optional[str] = OMIT,
563
664
  can_delete_objects: typing.Optional[bool] = OMIT,
564
- title: typing.Optional[str] = OMIT,
565
665
  description: typing.Optional[str] = OMIT,
566
- project: typing.Optional[int] = OMIT,
567
- bucket: typing.Optional[str] = OMIT,
568
- prefix: typing.Optional[str] = OMIT,
569
666
  google_application_credentials: typing.Optional[str] = OMIT,
570
667
  google_project_id: typing.Optional[str] = OMIT,
668
+ id: typing.Optional[int] = OMIT,
669
+ prefix: 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
- ) -> GcsExportStorage:
673
+ ) -> None:
573
674
  """
574
- Create a new GCS export storage connection to store annotations.
675
+ Validate a specific GCS export storage connection.
575
676
 
576
677
  Parameters
577
678
  ----------
679
+ bucket : typing.Optional[str]
680
+ GCS bucket name
681
+
578
682
  can_delete_objects : typing.Optional[bool]
579
683
  Deletion from storage enabled.
580
684
 
581
- title : typing.Optional[str]
582
- Storage title
583
-
584
685
  description : typing.Optional[str]
585
686
  Storage description
586
687
 
587
- project : typing.Optional[int]
588
- Project ID
688
+ google_application_credentials : typing.Optional[str]
689
+ The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
589
690
 
590
- bucket : typing.Optional[str]
591
- GCS bucket name
691
+ google_project_id : typing.Optional[str]
692
+ Google project ID
693
+
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
  GCS bucket prefix
595
699
 
596
- google_application_credentials : typing.Optional[str]
597
- The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
700
+ project : typing.Optional[int]
701
+ Project ID
598
702
 
599
- google_project_id : typing.Optional[str]
600
- Google project ID
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
- GcsExportStorage
608
-
711
+ None
609
712
 
610
713
  Examples
611
714
  --------
@@ -619,23 +722,24 @@ class AsyncGcsClient:
619
722
 
620
723
 
621
724
  async def main() -> None:
622
- await client.export_storage.gcs.create()
725
+ await client.export_storage.gcs.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/gcs",
731
+ "api/storages/export/gcs/validate",
629
732
  method="POST",
630
733
  json={
734
+ "bucket": bucket,
631
735
  "can_delete_objects": can_delete_objects,
632
- "title": title,
633
736
  "description": description,
634
- "project": project,
635
- "bucket": bucket,
636
- "prefix": prefix,
637
737
  "google_application_credentials": google_application_credentials,
638
738
  "google_project_id": google_project_id,
739
+ "id": id,
740
+ "prefix": prefix,
741
+ "project": project,
742
+ "title": title,
639
743
  },
640
744
  headers={
641
745
  "content-type": "application/json",
@@ -645,13 +749,7 @@ class AsyncGcsClient:
645
749
  )
646
750
  try:
647
751
  if 200 <= _response.status_code < 300:
648
- return typing.cast(
649
- GcsExportStorage,
650
- construct_type(
651
- type_=GcsExportStorage, # 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 AsyncGcsClient:
762
860
  self,
763
861
  id: int,
764
862
  *,
863
+ bucket: typing.Optional[str] = OMIT,
765
864
  can_delete_objects: typing.Optional[bool] = OMIT,
766
- title: typing.Optional[str] = OMIT,
767
865
  description: typing.Optional[str] = OMIT,
768
- project: typing.Optional[int] = OMIT,
769
- bucket: typing.Optional[str] = OMIT,
770
- prefix: typing.Optional[str] = OMIT,
771
866
  google_application_credentials: typing.Optional[str] = OMIT,
772
867
  google_project_id: typing.Optional[str] = OMIT,
868
+ prefix: 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
  ) -> GcsExportStorage:
775
873
  """
@@ -779,29 +877,29 @@ class AsyncGcsClient:
779
877
  ----------
780
878
  id : int
781
879
 
880
+ bucket : typing.Optional[str]
881
+ GCS bucket name
882
+
782
883
  can_delete_objects : typing.Optional[bool]
783
884
  Deletion from storage enabled.
784
885
 
785
- title : typing.Optional[str]
786
- Storage title
787
-
788
886
  description : typing.Optional[str]
789
887
  Storage description
790
888
 
791
- project : typing.Optional[int]
792
- Project ID
889
+ google_application_credentials : typing.Optional[str]
890
+ The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
793
891
 
794
- bucket : typing.Optional[str]
795
- GCS bucket name
892
+ google_project_id : typing.Optional[str]
893
+ Google project ID
796
894
 
797
895
  prefix : typing.Optional[str]
798
896
  GCS bucket prefix
799
897
 
800
- google_application_credentials : typing.Optional[str]
801
- The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
898
+ project : typing.Optional[int]
899
+ Project ID
802
900
 
803
- google_project_id : typing.Optional[str]
804
- Google project ID
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 AsyncGcsClient:
834
932
  f"api/storages/export/gcs/{jsonable_encoder(id)}",
835
933
  method="PATCH",
836
934
  json={
935
+ "bucket": bucket,
837
936
  "can_delete_objects": can_delete_objects,
838
- "title": title,
839
937
  "description": description,
840
- "project": project,
841
- "bucket": bucket,
842
- "prefix": prefix,
843
938
  "google_application_credentials": google_application_credentials,
844
939
  "google_project_id": google_project_id,
940
+ "prefix": prefix,
941
+ "project": project,
942
+ "title": title,
845
943
  },
846
944
  headers={
847
945
  "content-type": "application/json",
@@ -916,101 +1014,3 @@ class AsyncGcsClient:
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
- bucket: typing.Optional[str] = OMIT,
929
- prefix: typing.Optional[str] = OMIT,
930
- google_application_credentials: typing.Optional[str] = OMIT,
931
- google_project_id: typing.Optional[str] = OMIT,
932
- request_options: typing.Optional[RequestOptions] = None,
933
- ) -> None:
934
- """
935
- Validate a specific GCS 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
- bucket : typing.Optional[str]
955
- GCS bucket name
956
-
957
- prefix : typing.Optional[str]
958
- GCS bucket prefix
959
-
960
- google_application_credentials : typing.Optional[str]
961
- The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
962
-
963
- google_project_id : typing.Optional[str]
964
- Google project ID
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.gcs.validate()
986
-
987
-
988
- asyncio.run(main())
989
- """
990
- _response = await self._client_wrapper.httpx_client.request(
991
- "api/storages/export/gcs/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
- "bucket": bucket,
1000
- "prefix": prefix,
1001
- "google_application_credentials": google_application_credentials,
1002
- "google_project_id": google_project_id,
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)