label-studio-sdk 2.0.0__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 (175) hide show
  1. label_studio_sdk/__init__.py +24 -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/billing/__init__.py +2 -0
  8. label_studio_sdk/billing/client.py +112 -0
  9. label_studio_sdk/comments/client.py +176 -176
  10. label_studio_sdk/export_storage/azure/client.py +274 -274
  11. label_studio_sdk/export_storage/gcs/client.py +263 -263
  12. label_studio_sdk/export_storage/local/client.py +206 -206
  13. label_studio_sdk/export_storage/redis/client.py +287 -287
  14. label_studio_sdk/export_storage/s3/client.py +347 -347
  15. label_studio_sdk/export_storage/s3s/client.py +678 -678
  16. label_studio_sdk/import_storage/azure/client.py +357 -357
  17. label_studio_sdk/import_storage/gcs/client.py +357 -357
  18. label_studio_sdk/import_storage/local/client.py +206 -206
  19. label_studio_sdk/import_storage/redis/client.py +309 -309
  20. label_studio_sdk/import_storage/s3/client.py +452 -452
  21. label_studio_sdk/import_storage/s3s/client.py +735 -735
  22. label_studio_sdk/jwt_settings/client.py +10 -10
  23. label_studio_sdk/ml/client.py +118 -118
  24. label_studio_sdk/ml/types/ml_list_model_versions_response.py +1 -1
  25. label_studio_sdk/model_providers/client.py +181 -181
  26. label_studio_sdk/organizations/members/client.py +348 -2
  27. label_studio_sdk/predictions/client.py +60 -60
  28. label_studio_sdk/projects/__init__.py +30 -1
  29. label_studio_sdk/projects/assignments/__init__.py +33 -0
  30. label_studio_sdk/projects/assignments/client.py +764 -0
  31. label_studio_sdk/projects/assignments/types/__init__.py +35 -0
  32. label_studio_sdk/projects/assignments/types/assignments_assign_request_type.py +5 -0
  33. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters.py +33 -0
  34. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_conjunction.py +5 -0
  35. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item.py +44 -0
  36. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_filter.py +31 -0
  37. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_operator.py +23 -0
  38. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_value.py +7 -0
  39. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items.py +9 -0
  40. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_excluded.py +29 -0
  41. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_included.py +29 -0
  42. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_type.py +5 -0
  43. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_response.py +22 -0
  44. label_studio_sdk/projects/assignments/types/assignments_update_request_type.py +5 -0
  45. label_studio_sdk/projects/client.py +441 -425
  46. label_studio_sdk/projects/exports/client.py +55 -55
  47. label_studio_sdk/projects/exports/types/exports_convert_response.py +1 -1
  48. label_studio_sdk/projects/stats/types/stats_iaa_response.py +5 -5
  49. label_studio_sdk/projects/types/projects_import_tasks_response.py +12 -12
  50. label_studio_sdk/prompts/client.py +211 -211
  51. label_studio_sdk/prompts/runs/client.py +33 -33
  52. label_studio_sdk/prompts/versions/client.py +72 -72
  53. label_studio_sdk/tasks/client.py +174 -174
  54. label_studio_sdk/types/__init__.py +22 -0
  55. label_studio_sdk/types/all_roles_project_list.py +98 -98
  56. label_studio_sdk/types/annotation.py +35 -35
  57. label_studio_sdk/types/annotation_request.py +27 -27
  58. label_studio_sdk/types/azure_blob_export_storage.py +29 -29
  59. label_studio_sdk/types/azure_blob_import_storage.py +33 -33
  60. label_studio_sdk/types/batch_failed_predictions.py +1 -1
  61. label_studio_sdk/types/billing_checks.py +39 -0
  62. label_studio_sdk/types/billing_flags.py +44 -0
  63. label_studio_sdk/types/billing_info_response.py +22 -0
  64. label_studio_sdk/types/blueprint_list.py +7 -8
  65. label_studio_sdk/types/child_filter.py +11 -10
  66. label_studio_sdk/types/comment.py +15 -15
  67. label_studio_sdk/types/comment_request.py +7 -8
  68. label_studio_sdk/types/comment_serializer_with_expanded_user.py +17 -18
  69. label_studio_sdk/types/converted_format.py +1 -1
  70. label_studio_sdk/types/converted_format_request.py +1 -1
  71. label_studio_sdk/types/count_limit.py +22 -0
  72. label_studio_sdk/types/export.py +8 -8
  73. label_studio_sdk/types/file_upload.py +3 -2
  74. label_studio_sdk/types/filter.py +10 -9
  75. label_studio_sdk/types/filter_group.py +4 -3
  76. label_studio_sdk/types/gcs_export_storage.py +23 -23
  77. label_studio_sdk/types/gcs_import_storage.py +27 -27
  78. label_studio_sdk/types/import_api_request.py +26 -26
  79. label_studio_sdk/types/inference_run_cost_estimate.py +10 -10
  80. label_studio_sdk/types/local_files_export_storage.py +23 -23
  81. label_studio_sdk/types/local_files_import_storage.py +26 -26
  82. label_studio_sdk/types/lse_annotation_filter_options.py +10 -10
  83. label_studio_sdk/types/lse_annotation_filter_options_request.py +10 -10
  84. label_studio_sdk/types/lse_export_create.py +12 -12
  85. label_studio_sdk/types/lse_fields.py +14 -14
  86. label_studio_sdk/types/lse_organization.py +17 -17
  87. label_studio_sdk/types/lse_organization_member_list.py +32 -0
  88. label_studio_sdk/types/lse_project_create.py +72 -72
  89. label_studio_sdk/types/lse_project_update.py +89 -89
  90. label_studio_sdk/types/lse_s3export_storage.py +46 -46
  91. label_studio_sdk/types/lse_s3export_storage_request.py +43 -43
  92. label_studio_sdk/types/lse_s3import_storage.py +53 -53
  93. label_studio_sdk/types/lse_s3import_storage_request.py +49 -49
  94. label_studio_sdk/types/lse_task.py +49 -49
  95. label_studio_sdk/types/lse_task_drafts_item.py +1 -1
  96. label_studio_sdk/types/lse_task_filter_options.py +14 -14
  97. label_studio_sdk/types/lse_task_filter_options_request.py +14 -14
  98. label_studio_sdk/types/lse_task_predictions_item.py +5 -5
  99. label_studio_sdk/types/lse_task_serializer_for_annotators.py +12 -12
  100. label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +1 -1
  101. label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +5 -5
  102. label_studio_sdk/types/lse_task_serializer_for_reviewers.py +49 -49
  103. label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +1 -1
  104. label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +5 -5
  105. label_studio_sdk/types/lse_user.py +13 -13
  106. label_studio_sdk/types/lse_user_api.py +11 -11
  107. label_studio_sdk/types/lse_user_organization_member_list.py +48 -0
  108. label_studio_sdk/types/lseapi_token_create.py +1 -1
  109. label_studio_sdk/types/lseapi_token_list.py +1 -1
  110. label_studio_sdk/types/lsejwt_settings.py +5 -5
  111. label_studio_sdk/types/ml_backend.py +27 -28
  112. label_studio_sdk/types/model_interface.py +12 -12
  113. label_studio_sdk/types/model_interface_request.py +7 -8
  114. label_studio_sdk/types/model_interface_serializer_get.py +13 -13
  115. label_studio_sdk/types/model_provider_connection.py +34 -34
  116. label_studio_sdk/types/model_provider_connection_request.py +15 -14
  117. label_studio_sdk/types/model_run.py +12 -12
  118. label_studio_sdk/types/organization_billing.py +1 -1
  119. label_studio_sdk/types/organization_id.py +2 -2
  120. label_studio_sdk/types/organization_invite.py +1 -1
  121. label_studio_sdk/types/organization_member.py +8 -9
  122. label_studio_sdk/types/organization_membership.py +2 -1
  123. label_studio_sdk/types/paginated_lse_organization_member_list_list.py +23 -0
  124. label_studio_sdk/types/pause.py +23 -23
  125. label_studio_sdk/types/prediction.py +21 -21
  126. label_studio_sdk/types/prediction_request.py +16 -16
  127. label_studio_sdk/types/project.py +72 -72
  128. label_studio_sdk/types/project_import.py +21 -21
  129. label_studio_sdk/types/prompts_status_enum.py +16 -0
  130. label_studio_sdk/types/redis_export_storage.py +34 -34
  131. label_studio_sdk/types/redis_import_storage.py +37 -37
  132. label_studio_sdk/types/refined_prompt_response.py +11 -11
  133. label_studio_sdk/types/review_settings.py +29 -30
  134. label_studio_sdk/types/review_settings_request.py +29 -30
  135. label_studio_sdk/types/role9e7enum.py +5 -0
  136. label_studio_sdk/types/s3export_storage.py +45 -45
  137. label_studio_sdk/types/s3import_storage.py +44 -44
  138. label_studio_sdk/types/selected_items_request.py +1 -1
  139. label_studio_sdk/types/serialization_options.py +10 -10
  140. label_studio_sdk/types/serialization_options_request.py +10 -10
  141. label_studio_sdk/types/task_assignment.py +43 -0
  142. label_studio_sdk/types/third_party_model_version.py +11 -11
  143. label_studio_sdk/types/third_party_model_version_request.py +6 -7
  144. label_studio_sdk/types/type_enum.py +5 -0
  145. label_studio_sdk/types/user_simple.py +3 -3
  146. label_studio_sdk/types/user_simple_request.py +1 -1
  147. label_studio_sdk/types/version_response.py +19 -20
  148. label_studio_sdk/types/view.py +8 -8
  149. label_studio_sdk/types/webhook.py +16 -16
  150. label_studio_sdk/types/webhook_serializer_for_update.py +16 -16
  151. label_studio_sdk/types/workspace.py +10 -11
  152. label_studio_sdk/users/client.py +160 -160
  153. label_studio_sdk/views/client.py +164 -164
  154. label_studio_sdk/webhooks/client.py +183 -183
  155. label_studio_sdk/webhooks/types/webhooks_info_response.py +32 -32
  156. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +1 -1
  157. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +1 -1
  158. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +1 -1
  159. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +1 -1
  160. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +1 -1
  161. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +1 -1
  162. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +1 -1
  163. label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +1 -1
  164. label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +1 -1
  165. label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +1 -1
  166. label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +1 -1
  167. label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +1 -1
  168. label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +1 -1
  169. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +1 -1
  170. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +1 -1
  171. label_studio_sdk/workspaces/client.py +40 -40
  172. {label_studio_sdk-2.0.0.dist-info → label_studio_sdk-2.0.2.dist-info}/METADATA +73 -25
  173. {label_studio_sdk-2.0.0.dist-info → label_studio_sdk-2.0.2.dist-info}/RECORD +175 -146
  174. {label_studio_sdk-2.0.0.dist-info → label_studio_sdk-2.0.2.dist-info}/LICENSE +0 -0
  175. {label_studio_sdk-2.0.0.dist-info → label_studio_sdk-2.0.2.dist-info}/WHEEL +0 -0
@@ -79,11 +79,11 @@ class LocalClient:
79
79
  def create(
80
80
  self,
81
81
  *,
82
- title: typing.Optional[str] = OMIT,
83
82
  description: typing.Optional[str] = OMIT,
84
- project: typing.Optional[int] = OMIT,
85
83
  path: typing.Optional[str] = OMIT,
84
+ project: typing.Optional[int] = OMIT,
86
85
  regex_filter: typing.Optional[str] = OMIT,
86
+ title: typing.Optional[str] = OMIT,
87
87
  use_blob_urls: typing.Optional[bool] = OMIT,
88
88
  request_options: typing.Optional[RequestOptions] = None,
89
89
  ) -> LocalFilesExportStorage:
@@ -92,21 +92,21 @@ class LocalClient:
92
92
 
93
93
  Parameters
94
94
  ----------
95
- title : typing.Optional[str]
96
- Storage title
97
-
98
95
  description : typing.Optional[str]
99
96
  Storage description
100
97
 
101
- project : typing.Optional[int]
102
- Project ID
103
-
104
98
  path : typing.Optional[str]
105
99
  Path to local directory
106
100
 
101
+ project : typing.Optional[int]
102
+ Project ID
103
+
107
104
  regex_filter : typing.Optional[str]
108
105
  Regex for filtering objects
109
106
 
107
+ title : typing.Optional[str]
108
+ Storage title
109
+
110
110
  use_blob_urls : typing.Optional[bool]
111
111
  Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
112
112
 
@@ -131,11 +131,11 @@ class LocalClient:
131
131
  "api/storages/export/localfiles",
132
132
  method="POST",
133
133
  json={
134
- "title": title,
135
134
  "description": description,
136
- "project": project,
137
135
  "path": path,
136
+ "project": project,
138
137
  "regex_filter": regex_filter,
138
+ "title": title,
139
139
  "use_blob_urls": use_blob_urls,
140
140
  },
141
141
  headers={
@@ -158,6 +158,86 @@ class LocalClient:
158
158
  raise ApiError(status_code=_response.status_code, body=_response.text)
159
159
  raise ApiError(status_code=_response.status_code, body=_response_json)
160
160
 
161
+ def validate(
162
+ self,
163
+ *,
164
+ description: typing.Optional[str] = OMIT,
165
+ id: typing.Optional[int] = OMIT,
166
+ path: typing.Optional[str] = OMIT,
167
+ project: typing.Optional[int] = OMIT,
168
+ regex_filter: typing.Optional[str] = OMIT,
169
+ title: typing.Optional[str] = OMIT,
170
+ use_blob_urls: typing.Optional[bool] = OMIT,
171
+ request_options: typing.Optional[RequestOptions] = None,
172
+ ) -> None:
173
+ """
174
+ Validate a specific local file export storage connection.
175
+
176
+ Parameters
177
+ ----------
178
+ description : typing.Optional[str]
179
+ Storage description
180
+
181
+ id : typing.Optional[int]
182
+ Storage ID. If set, storage with specified ID will be updated
183
+
184
+ path : typing.Optional[str]
185
+ Path to local directory
186
+
187
+ project : typing.Optional[int]
188
+ Project ID
189
+
190
+ regex_filter : typing.Optional[str]
191
+ Regex for filtering objects
192
+
193
+ title : typing.Optional[str]
194
+ Storage title
195
+
196
+ use_blob_urls : typing.Optional[bool]
197
+ Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
198
+
199
+ request_options : typing.Optional[RequestOptions]
200
+ Request-specific configuration.
201
+
202
+ Returns
203
+ -------
204
+ None
205
+
206
+ Examples
207
+ --------
208
+ from label_studio_sdk import LabelStudio
209
+
210
+ client = LabelStudio(
211
+ api_key="YOUR_API_KEY",
212
+ )
213
+ client.export_storage.local.validate()
214
+ """
215
+ _response = self._client_wrapper.httpx_client.request(
216
+ "api/storages/export/localfiles/validate",
217
+ method="POST",
218
+ json={
219
+ "description": description,
220
+ "id": id,
221
+ "path": path,
222
+ "project": project,
223
+ "regex_filter": regex_filter,
224
+ "title": title,
225
+ "use_blob_urls": use_blob_urls,
226
+ },
227
+ headers={
228
+ "content-type": "application/json",
229
+ },
230
+ request_options=request_options,
231
+ omit=OMIT,
232
+ )
233
+ try:
234
+ if 200 <= _response.status_code < 300:
235
+ return
236
+ _response_json = _response.json()
237
+ except JSONDecodeError:
238
+ raise ApiError(status_code=_response.status_code, body=_response.text)
239
+ raise ApiError(status_code=_response.status_code, body=_response_json)
240
+
161
241
  def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> LocalFilesExportStorage:
162
242
  """
163
243
  Get a specific local file export storage connection.
@@ -247,11 +327,11 @@ class LocalClient:
247
327
  self,
248
328
  id: int,
249
329
  *,
250
- title: typing.Optional[str] = OMIT,
251
330
  description: typing.Optional[str] = OMIT,
252
- project: typing.Optional[int] = OMIT,
253
331
  path: typing.Optional[str] = OMIT,
332
+ project: typing.Optional[int] = OMIT,
254
333
  regex_filter: typing.Optional[str] = OMIT,
334
+ title: typing.Optional[str] = OMIT,
255
335
  use_blob_urls: typing.Optional[bool] = OMIT,
256
336
  request_options: typing.Optional[RequestOptions] = None,
257
337
  ) -> LocalFilesExportStorage:
@@ -262,21 +342,21 @@ class LocalClient:
262
342
  ----------
263
343
  id : int
264
344
 
265
- title : typing.Optional[str]
266
- Storage title
267
-
268
345
  description : typing.Optional[str]
269
346
  Storage description
270
347
 
271
- project : typing.Optional[int]
272
- Project ID
273
-
274
348
  path : typing.Optional[str]
275
349
  Path to local directory
276
350
 
351
+ project : typing.Optional[int]
352
+ Project ID
353
+
277
354
  regex_filter : typing.Optional[str]
278
355
  Regex for filtering objects
279
356
 
357
+ title : typing.Optional[str]
358
+ Storage title
359
+
280
360
  use_blob_urls : typing.Optional[bool]
281
361
  Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
282
362
 
@@ -303,11 +383,11 @@ class LocalClient:
303
383
  f"api/storages/export/localfiles/{jsonable_encoder(id)}",
304
384
  method="PATCH",
305
385
  json={
306
- "title": title,
307
386
  "description": description,
308
- "project": project,
309
387
  "path": path,
388
+ "project": project,
310
389
  "regex_filter": regex_filter,
390
+ "title": title,
311
391
  "use_blob_urls": use_blob_urls,
312
392
  },
313
393
  headers={
@@ -376,115 +456,117 @@ class LocalClient:
376
456
  raise ApiError(status_code=_response.status_code, body=_response.text)
377
457
  raise ApiError(status_code=_response.status_code, body=_response_json)
378
458
 
379
- def validate(
459
+
460
+ class AsyncLocalClient:
461
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
462
+ self._client_wrapper = client_wrapper
463
+
464
+ async def list(
380
465
  self,
381
466
  *,
382
- id: typing.Optional[int] = OMIT,
383
- title: typing.Optional[str] = OMIT,
384
- description: typing.Optional[str] = OMIT,
385
- project: typing.Optional[int] = OMIT,
386
- path: typing.Optional[str] = OMIT,
387
- regex_filter: typing.Optional[str] = OMIT,
388
- use_blob_urls: typing.Optional[bool] = OMIT,
467
+ ordering: typing.Optional[str] = None,
468
+ project: typing.Optional[int] = None,
389
469
  request_options: typing.Optional[RequestOptions] = None,
390
- ) -> None:
470
+ ) -> typing.List[LocalFilesExportStorage]:
391
471
  """
392
- Validate a specific local file export storage connection.
472
+ Get a list of all local file export storage connections.
393
473
 
394
474
  Parameters
395
475
  ----------
396
- id : typing.Optional[int]
397
- Storage ID. If set, storage with specified ID will be updated
398
-
399
- title : typing.Optional[str]
400
- Storage title
401
-
402
- description : typing.Optional[str]
403
- Storage description
476
+ ordering : typing.Optional[str]
477
+ Which field to use when ordering the results.
404
478
 
405
479
  project : typing.Optional[int]
406
480
  Project ID
407
481
 
408
- path : typing.Optional[str]
409
- Path to local directory
410
-
411
- regex_filter : typing.Optional[str]
412
- Regex for filtering objects
413
-
414
- use_blob_urls : typing.Optional[bool]
415
- Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
416
-
417
482
  request_options : typing.Optional[RequestOptions]
418
483
  Request-specific configuration.
419
484
 
420
485
  Returns
421
486
  -------
422
- None
487
+ typing.List[LocalFilesExportStorage]
488
+
423
489
 
424
490
  Examples
425
491
  --------
426
- from label_studio_sdk import LabelStudio
492
+ import asyncio
427
493
 
428
- client = LabelStudio(
494
+ from label_studio_sdk import AsyncLabelStudio
495
+
496
+ client = AsyncLabelStudio(
429
497
  api_key="YOUR_API_KEY",
430
498
  )
431
- client.export_storage.local.validate()
499
+
500
+
501
+ async def main() -> None:
502
+ await client.export_storage.local.list()
503
+
504
+
505
+ asyncio.run(main())
432
506
  """
433
- _response = self._client_wrapper.httpx_client.request(
434
- "api/storages/export/localfiles/validate",
435
- method="POST",
436
- json={
437
- "id": id,
438
- "title": title,
439
- "description": description,
507
+ _response = await self._client_wrapper.httpx_client.request(
508
+ "api/storages/export/localfiles",
509
+ method="GET",
510
+ params={
511
+ "ordering": ordering,
440
512
  "project": project,
441
- "path": path,
442
- "regex_filter": regex_filter,
443
- "use_blob_urls": use_blob_urls,
444
- },
445
- headers={
446
- "content-type": "application/json",
447
513
  },
448
514
  request_options=request_options,
449
- omit=OMIT,
450
515
  )
451
516
  try:
452
517
  if 200 <= _response.status_code < 300:
453
- return
518
+ return typing.cast(
519
+ typing.List[LocalFilesExportStorage],
520
+ construct_type(
521
+ type_=typing.List[LocalFilesExportStorage], # type: ignore
522
+ object_=_response.json(),
523
+ ),
524
+ )
454
525
  _response_json = _response.json()
455
526
  except JSONDecodeError:
456
527
  raise ApiError(status_code=_response.status_code, body=_response.text)
457
528
  raise ApiError(status_code=_response.status_code, body=_response_json)
458
529
 
459
-
460
- class AsyncLocalClient:
461
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
462
- self._client_wrapper = client_wrapper
463
-
464
- async def list(
530
+ async def create(
465
531
  self,
466
532
  *,
467
- ordering: typing.Optional[str] = None,
468
- project: typing.Optional[int] = None,
533
+ description: typing.Optional[str] = OMIT,
534
+ path: typing.Optional[str] = OMIT,
535
+ project: typing.Optional[int] = OMIT,
536
+ regex_filter: typing.Optional[str] = OMIT,
537
+ title: typing.Optional[str] = OMIT,
538
+ use_blob_urls: typing.Optional[bool] = OMIT,
469
539
  request_options: typing.Optional[RequestOptions] = None,
470
- ) -> typing.List[LocalFilesExportStorage]:
540
+ ) -> LocalFilesExportStorage:
471
541
  """
472
- Get a list of all local file export storage connections.
542
+ Create a new local file export storage connection to store annotations.
473
543
 
474
544
  Parameters
475
545
  ----------
476
- ordering : typing.Optional[str]
477
- Which field to use when ordering the results.
546
+ description : typing.Optional[str]
547
+ Storage description
548
+
549
+ path : typing.Optional[str]
550
+ Path to local directory
478
551
 
479
552
  project : typing.Optional[int]
480
553
  Project ID
481
554
 
555
+ regex_filter : typing.Optional[str]
556
+ Regex for filtering objects
557
+
558
+ title : typing.Optional[str]
559
+ Storage title
560
+
561
+ use_blob_urls : typing.Optional[bool]
562
+ Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
563
+
482
564
  request_options : typing.Optional[RequestOptions]
483
565
  Request-specific configuration.
484
566
 
485
567
  Returns
486
568
  -------
487
- typing.List[LocalFilesExportStorage]
569
+ LocalFilesExportStorage
488
570
 
489
571
 
490
572
  Examples
@@ -499,26 +581,34 @@ class AsyncLocalClient:
499
581
 
500
582
 
501
583
  async def main() -> None:
502
- await client.export_storage.local.list()
584
+ await client.export_storage.local.create()
503
585
 
504
586
 
505
587
  asyncio.run(main())
506
588
  """
507
589
  _response = await self._client_wrapper.httpx_client.request(
508
590
  "api/storages/export/localfiles",
509
- method="GET",
510
- params={
511
- "ordering": ordering,
591
+ method="POST",
592
+ json={
593
+ "description": description,
594
+ "path": path,
512
595
  "project": project,
596
+ "regex_filter": regex_filter,
597
+ "title": title,
598
+ "use_blob_urls": use_blob_urls,
599
+ },
600
+ headers={
601
+ "content-type": "application/json",
513
602
  },
514
603
  request_options=request_options,
604
+ omit=OMIT,
515
605
  )
516
606
  try:
517
607
  if 200 <= _response.status_code < 300:
518
608
  return typing.cast(
519
- typing.List[LocalFilesExportStorage],
609
+ LocalFilesExportStorage,
520
610
  construct_type(
521
- type_=typing.List[LocalFilesExportStorage], # type: ignore
611
+ type_=LocalFilesExportStorage, # type: ignore
522
612
  object_=_response.json(),
523
613
  ),
524
614
  )
@@ -527,37 +617,41 @@ class AsyncLocalClient:
527
617
  raise ApiError(status_code=_response.status_code, body=_response.text)
528
618
  raise ApiError(status_code=_response.status_code, body=_response_json)
529
619
 
530
- async def create(
620
+ async def validate(
531
621
  self,
532
622
  *,
533
- title: typing.Optional[str] = OMIT,
534
623
  description: typing.Optional[str] = OMIT,
535
- project: typing.Optional[int] = OMIT,
624
+ id: typing.Optional[int] = OMIT,
536
625
  path: typing.Optional[str] = OMIT,
626
+ project: typing.Optional[int] = OMIT,
537
627
  regex_filter: typing.Optional[str] = OMIT,
628
+ title: typing.Optional[str] = OMIT,
538
629
  use_blob_urls: typing.Optional[bool] = OMIT,
539
630
  request_options: typing.Optional[RequestOptions] = None,
540
- ) -> LocalFilesExportStorage:
631
+ ) -> None:
541
632
  """
542
- Create a new local file export storage connection to store annotations.
633
+ Validate a specific local file export storage connection.
543
634
 
544
635
  Parameters
545
636
  ----------
546
- title : typing.Optional[str]
547
- Storage title
548
-
549
637
  description : typing.Optional[str]
550
638
  Storage description
551
639
 
552
- project : typing.Optional[int]
553
- Project ID
640
+ id : typing.Optional[int]
641
+ Storage ID. If set, storage with specified ID will be updated
554
642
 
555
643
  path : typing.Optional[str]
556
644
  Path to local directory
557
645
 
646
+ project : typing.Optional[int]
647
+ Project ID
648
+
558
649
  regex_filter : typing.Optional[str]
559
650
  Regex for filtering objects
560
651
 
652
+ title : typing.Optional[str]
653
+ Storage title
654
+
561
655
  use_blob_urls : typing.Optional[bool]
562
656
  Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
563
657
 
@@ -566,8 +660,7 @@ class AsyncLocalClient:
566
660
 
567
661
  Returns
568
662
  -------
569
- LocalFilesExportStorage
570
-
663
+ None
571
664
 
572
665
  Examples
573
666
  --------
@@ -581,20 +674,21 @@ class AsyncLocalClient:
581
674
 
582
675
 
583
676
  async def main() -> None:
584
- await client.export_storage.local.create()
677
+ await client.export_storage.local.validate()
585
678
 
586
679
 
587
680
  asyncio.run(main())
588
681
  """
589
682
  _response = await self._client_wrapper.httpx_client.request(
590
- "api/storages/export/localfiles",
683
+ "api/storages/export/localfiles/validate",
591
684
  method="POST",
592
685
  json={
593
- "title": title,
594
686
  "description": description,
595
- "project": project,
687
+ "id": id,
596
688
  "path": path,
689
+ "project": project,
597
690
  "regex_filter": regex_filter,
691
+ "title": title,
598
692
  "use_blob_urls": use_blob_urls,
599
693
  },
600
694
  headers={
@@ -605,13 +699,7 @@ class AsyncLocalClient:
605
699
  )
606
700
  try:
607
701
  if 200 <= _response.status_code < 300:
608
- return typing.cast(
609
- LocalFilesExportStorage,
610
- construct_type(
611
- type_=LocalFilesExportStorage, # type: ignore
612
- object_=_response.json(),
613
- ),
614
- )
702
+ return
615
703
  _response_json = _response.json()
616
704
  except JSONDecodeError:
617
705
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -722,11 +810,11 @@ class AsyncLocalClient:
722
810
  self,
723
811
  id: int,
724
812
  *,
725
- title: typing.Optional[str] = OMIT,
726
813
  description: typing.Optional[str] = OMIT,
727
- project: typing.Optional[int] = OMIT,
728
814
  path: typing.Optional[str] = OMIT,
815
+ project: typing.Optional[int] = OMIT,
729
816
  regex_filter: typing.Optional[str] = OMIT,
817
+ title: typing.Optional[str] = OMIT,
730
818
  use_blob_urls: typing.Optional[bool] = OMIT,
731
819
  request_options: typing.Optional[RequestOptions] = None,
732
820
  ) -> LocalFilesExportStorage:
@@ -737,21 +825,21 @@ class AsyncLocalClient:
737
825
  ----------
738
826
  id : int
739
827
 
740
- title : typing.Optional[str]
741
- Storage title
742
-
743
828
  description : typing.Optional[str]
744
829
  Storage description
745
830
 
746
- project : typing.Optional[int]
747
- Project ID
748
-
749
831
  path : typing.Optional[str]
750
832
  Path to local directory
751
833
 
834
+ project : typing.Optional[int]
835
+ Project ID
836
+
752
837
  regex_filter : typing.Optional[str]
753
838
  Regex for filtering objects
754
839
 
840
+ title : typing.Optional[str]
841
+ Storage title
842
+
755
843
  use_blob_urls : typing.Optional[bool]
756
844
  Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
757
845
 
@@ -786,11 +874,11 @@ class AsyncLocalClient:
786
874
  f"api/storages/export/localfiles/{jsonable_encoder(id)}",
787
875
  method="PATCH",
788
876
  json={
789
- "title": title,
790
877
  "description": description,
791
- "project": project,
792
878
  "path": path,
879
+ "project": project,
793
880
  "regex_filter": regex_filter,
881
+ "title": title,
794
882
  "use_blob_urls": use_blob_urls,
795
883
  },
796
884
  headers={
@@ -868,91 +956,3 @@ class AsyncLocalClient:
868
956
  except JSONDecodeError:
869
957
  raise ApiError(status_code=_response.status_code, body=_response.text)
870
958
  raise ApiError(status_code=_response.status_code, body=_response_json)
871
-
872
- async def validate(
873
- self,
874
- *,
875
- id: typing.Optional[int] = OMIT,
876
- title: typing.Optional[str] = OMIT,
877
- description: typing.Optional[str] = OMIT,
878
- project: typing.Optional[int] = OMIT,
879
- path: typing.Optional[str] = OMIT,
880
- regex_filter: typing.Optional[str] = OMIT,
881
- use_blob_urls: typing.Optional[bool] = OMIT,
882
- request_options: typing.Optional[RequestOptions] = None,
883
- ) -> None:
884
- """
885
- Validate a specific local file export storage connection.
886
-
887
- Parameters
888
- ----------
889
- id : typing.Optional[int]
890
- Storage ID. If set, storage with specified ID will be updated
891
-
892
- title : typing.Optional[str]
893
- Storage title
894
-
895
- description : typing.Optional[str]
896
- Storage description
897
-
898
- project : typing.Optional[int]
899
- Project ID
900
-
901
- path : typing.Optional[str]
902
- Path to local directory
903
-
904
- regex_filter : typing.Optional[str]
905
- Regex for filtering objects
906
-
907
- use_blob_urls : typing.Optional[bool]
908
- Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
909
-
910
- request_options : typing.Optional[RequestOptions]
911
- Request-specific configuration.
912
-
913
- Returns
914
- -------
915
- None
916
-
917
- Examples
918
- --------
919
- import asyncio
920
-
921
- from label_studio_sdk import AsyncLabelStudio
922
-
923
- client = AsyncLabelStudio(
924
- api_key="YOUR_API_KEY",
925
- )
926
-
927
-
928
- async def main() -> None:
929
- await client.export_storage.local.validate()
930
-
931
-
932
- asyncio.run(main())
933
- """
934
- _response = await self._client_wrapper.httpx_client.request(
935
- "api/storages/export/localfiles/validate",
936
- method="POST",
937
- json={
938
- "id": id,
939
- "title": title,
940
- "description": description,
941
- "project": project,
942
- "path": path,
943
- "regex_filter": regex_filter,
944
- "use_blob_urls": use_blob_urls,
945
- },
946
- headers={
947
- "content-type": "application/json",
948
- },
949
- request_options=request_options,
950
- omit=OMIT,
951
- )
952
- try:
953
- if 200 <= _response.status_code < 300:
954
- return
955
- _response_json = _response.json()
956
- except JSONDecodeError:
957
- raise ApiError(status_code=_response.status_code, body=_response.text)
958
- raise ApiError(status_code=_response.status_code, body=_response_json)