label-studio-sdk 1.0.0__py3-none-any.whl → 1.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.
Files changed (99) hide show
  1. label_studio_sdk/__init__.py +46 -4
  2. label_studio_sdk/_extensions/pager_ext.py +49 -0
  3. label_studio_sdk/_legacy/schema/label_config_schema.json +14 -14
  4. label_studio_sdk/actions/__init__.py +27 -0
  5. label_studio_sdk/actions/client.py +129 -8
  6. label_studio_sdk/actions/types/__init__.py +27 -0
  7. label_studio_sdk/actions/types/actions_create_request_filters.py +43 -0
  8. label_studio_sdk/actions/types/actions_create_request_filters_conjunction.py +5 -0
  9. label_studio_sdk/actions/types/actions_create_request_filters_items_item.py +50 -0
  10. label_studio_sdk/actions/types/actions_create_request_filters_items_item_filter.py +31 -0
  11. label_studio_sdk/actions/types/actions_create_request_filters_items_item_operator.py +23 -0
  12. label_studio_sdk/actions/types/actions_create_request_filters_items_item_value.py +5 -0
  13. label_studio_sdk/actions/types/actions_create_request_id.py +19 -0
  14. label_studio_sdk/actions/types/actions_create_request_ordering_item.py +31 -0
  15. label_studio_sdk/actions/types/actions_create_request_selected_items.py +10 -0
  16. label_studio_sdk/actions/types/actions_create_request_selected_items_excluded.py +39 -0
  17. label_studio_sdk/actions/types/actions_create_request_selected_items_included.py +39 -0
  18. label_studio_sdk/base_client.py +183 -0
  19. label_studio_sdk/client.py +17 -175
  20. label_studio_sdk/core/client_wrapper.py +1 -1
  21. label_studio_sdk/core/http_client.py +5 -1
  22. label_studio_sdk/errors/bad_request_error.py +3 -1
  23. label_studio_sdk/export_storage/azure/client.py +176 -10
  24. label_studio_sdk/export_storage/azure/types/azure_create_response.py +15 -0
  25. label_studio_sdk/export_storage/azure/types/azure_update_response.py +15 -0
  26. label_studio_sdk/export_storage/gcs/client.py +180 -14
  27. label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +16 -1
  28. label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +16 -1
  29. label_studio_sdk/export_storage/local/client.py +168 -22
  30. label_studio_sdk/export_storage/local/types/local_create_response.py +12 -2
  31. label_studio_sdk/export_storage/local/types/local_update_response.py +12 -2
  32. label_studio_sdk/export_storage/redis/client.py +234 -30
  33. label_studio_sdk/export_storage/redis/types/redis_create_response.py +20 -5
  34. label_studio_sdk/export_storage/redis/types/redis_update_response.py +20 -5
  35. label_studio_sdk/export_storage/s3/client.py +214 -26
  36. label_studio_sdk/export_storage/s3/types/s3create_response.py +15 -0
  37. label_studio_sdk/export_storage/s3/types/s3update_response.py +15 -0
  38. label_studio_sdk/import_storage/azure/client.py +266 -90
  39. label_studio_sdk/import_storage/azure/types/azure_create_response.py +28 -18
  40. label_studio_sdk/import_storage/azure/types/azure_update_response.py +28 -18
  41. label_studio_sdk/import_storage/gcs/client.py +270 -94
  42. label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +28 -18
  43. label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +28 -18
  44. label_studio_sdk/import_storage/local/client.py +168 -22
  45. label_studio_sdk/import_storage/local/types/local_create_response.py +12 -2
  46. label_studio_sdk/import_storage/local/types/local_update_response.py +12 -2
  47. label_studio_sdk/import_storage/redis/client.py +206 -50
  48. label_studio_sdk/import_storage/redis/types/redis_create_response.py +20 -10
  49. label_studio_sdk/import_storage/redis/types/redis_update_response.py +20 -10
  50. label_studio_sdk/import_storage/s3/client.py +336 -110
  51. label_studio_sdk/import_storage/s3/types/s3create_response.py +35 -25
  52. label_studio_sdk/import_storage/s3/types/s3update_response.py +35 -25
  53. label_studio_sdk/{_legacy/label_interface → label_interface}/base.py +10 -0
  54. label_studio_sdk/{_legacy/label_interface → label_interface}/control_tags.py +109 -71
  55. label_studio_sdk/{_legacy/label_interface → label_interface}/interface.py +97 -51
  56. label_studio_sdk/{_legacy/label_interface → label_interface}/object_tags.py +8 -13
  57. label_studio_sdk/label_interface/objects.py +60 -0
  58. label_studio_sdk/label_interface/region.py +75 -0
  59. label_studio_sdk/projects/client.py +6 -4
  60. label_studio_sdk/projects/client_ext.py +19 -0
  61. label_studio_sdk/tasks/client.py +35 -8
  62. label_studio_sdk/tasks/client_ext.py +18 -0
  63. label_studio_sdk/types/__init__.py +10 -0
  64. label_studio_sdk/types/annotation.py +5 -5
  65. label_studio_sdk/types/annotations_dm_field.py +120 -0
  66. label_studio_sdk/types/annotations_dm_field_last_action.py +19 -0
  67. label_studio_sdk/types/data_manager_task_serializer.py +123 -0
  68. label_studio_sdk/types/data_manager_task_serializer_drafts_item.py +31 -0
  69. label_studio_sdk/types/data_manager_task_serializer_predictions_item.py +37 -0
  70. label_studio_sdk/types/task.py +1 -1
  71. label_studio_sdk/views/__init__.py +12 -4
  72. label_studio_sdk/views/types/__init__.py +12 -4
  73. label_studio_sdk/views/types/views_create_request_data.py +2 -2
  74. label_studio_sdk/views/types/views_create_request_data_filters.py +5 -5
  75. label_studio_sdk/views/types/views_create_request_data_filters_conjunction.py +1 -1
  76. label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +11 -8
  77. label_studio_sdk/views/types/views_create_request_data_filters_items_item_filter.py +31 -0
  78. label_studio_sdk/views/types/views_create_request_data_filters_items_item_operator.py +23 -0
  79. label_studio_sdk/views/types/views_create_request_data_filters_items_item_value.py +5 -0
  80. label_studio_sdk/views/types/views_create_request_data_ordering_item.py +27 -34
  81. label_studio_sdk/views/types/views_update_request_data.py +2 -2
  82. label_studio_sdk/views/types/views_update_request_data_filters.py +5 -5
  83. label_studio_sdk/views/types/views_update_request_data_filters_conjunction.py +1 -1
  84. label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +11 -8
  85. label_studio_sdk/views/types/views_update_request_data_filters_items_item_filter.py +31 -0
  86. label_studio_sdk/views/types/views_update_request_data_filters_items_item_operator.py +23 -0
  87. label_studio_sdk/views/types/views_update_request_data_filters_items_item_value.py +5 -0
  88. label_studio_sdk/views/types/views_update_request_data_ordering_item.py +27 -34
  89. label_studio_sdk-1.0.2.dist-info/METADATA +195 -0
  90. {label_studio_sdk-1.0.0.dist-info → label_studio_sdk-1.0.2.dist-info}/RECORD +94 -69
  91. label_studio_sdk/_legacy/label_interface/region.py +0 -43
  92. label_studio_sdk/_legacy/objects.py +0 -35
  93. label_studio_sdk/views/types/views_create_request_data_ordering_item_direction.py +0 -5
  94. label_studio_sdk/views/types/views_update_request_data_ordering_item_direction.py +0 -5
  95. label_studio_sdk-1.0.0.dist-info/METADATA +0 -307
  96. /label_studio_sdk/{_legacy/label_interface → label_interface}/__init__.py +0 -0
  97. /label_studio_sdk/{_legacy/label_interface → label_interface}/data_examples.json +0 -0
  98. /label_studio_sdk/{_legacy/label_interface → label_interface}/label_tags.py +0 -0
  99. {label_studio_sdk-1.0.0.dist-info → label_studio_sdk-1.0.2.dist-info}/WHEEL +0 -0
@@ -66,20 +66,22 @@ class S3Client:
66
66
  def create(
67
67
  self,
68
68
  *,
69
+ regex_filter: typing.Optional[str] = OMIT,
70
+ use_blob_urls: typing.Optional[bool] = OMIT,
71
+ presign: typing.Optional[bool] = OMIT,
72
+ presign_ttl: typing.Optional[int] = OMIT,
73
+ recursive_scan: typing.Optional[bool] = OMIT,
74
+ title: typing.Optional[str] = OMIT,
75
+ description: typing.Optional[str] = OMIT,
69
76
  project: typing.Optional[int] = OMIT,
70
77
  bucket: typing.Optional[str] = OMIT,
71
78
  prefix: typing.Optional[str] = OMIT,
72
- regex_filter: typing.Optional[str] = OMIT,
73
- use_blob_urls: typing.Optional[bool] = OMIT,
74
79
  aws_access_key_id: typing.Optional[str] = OMIT,
75
80
  aws_secret_access_key: typing.Optional[str] = OMIT,
76
81
  aws_session_token: typing.Optional[str] = OMIT,
77
82
  aws_sse_kms_key_id: typing.Optional[str] = OMIT,
78
83
  region_name: typing.Optional[str] = OMIT,
79
84
  s3endpoint: typing.Optional[str] = OMIT,
80
- presign: typing.Optional[bool] = OMIT,
81
- presign_ttl: typing.Optional[int] = OMIT,
82
- recursive_scan: typing.Optional[bool] = OMIT,
83
85
  request_options: typing.Optional[RequestOptions] = None,
84
86
  ) -> S3CreateResponse:
85
87
  """
@@ -93,6 +95,27 @@ class S3Client:
93
95
 
94
96
  Parameters
95
97
  ----------
98
+ regex_filter : typing.Optional[str]
99
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
100
+
101
+ use_blob_urls : typing.Optional[bool]
102
+ Interpret objects as BLOBs and generate URLs. For example, if your bucket 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.
103
+
104
+ presign : typing.Optional[bool]
105
+ Presign URLs for download
106
+
107
+ presign_ttl : typing.Optional[int]
108
+ Presign TTL in minutes
109
+
110
+ recursive_scan : typing.Optional[bool]
111
+ Scan recursively
112
+
113
+ title : typing.Optional[str]
114
+ Storage title
115
+
116
+ description : typing.Optional[str]
117
+ Storage description
118
+
96
119
  project : typing.Optional[int]
97
120
  Project ID
98
121
 
@@ -102,12 +125,6 @@ class S3Client:
102
125
  prefix : typing.Optional[str]
103
126
  S3 bucket prefix
104
127
 
105
- regex_filter : typing.Optional[str]
106
- Cloud storage regex for filtering objects
107
-
108
- use_blob_urls : typing.Optional[bool]
109
- Interpret objects as BLOBs and generate URLs
110
-
111
128
  aws_access_key_id : typing.Optional[str]
112
129
  AWS_ACCESS_KEY_ID
113
130
 
@@ -126,15 +143,6 @@ class S3Client:
126
143
  s3endpoint : typing.Optional[str]
127
144
  S3 Endpoint
128
145
 
129
- presign : typing.Optional[bool]
130
- Presign URLs for download
131
-
132
- presign_ttl : typing.Optional[int]
133
- Presign TTL in seconds
134
-
135
- recursive_scan : typing.Optional[bool]
136
- Scan recursively
137
-
138
146
  request_options : typing.Optional[RequestOptions]
139
147
  Request-specific configuration.
140
148
 
@@ -156,20 +164,22 @@ class S3Client:
156
164
  "api/storages/s3/",
157
165
  method="POST",
158
166
  json={
167
+ "regex_filter": regex_filter,
168
+ "use_blob_urls": use_blob_urls,
169
+ "presign": presign,
170
+ "presign_ttl": presign_ttl,
171
+ "recursive_scan": recursive_scan,
172
+ "title": title,
173
+ "description": description,
159
174
  "project": project,
160
175
  "bucket": bucket,
161
176
  "prefix": prefix,
162
- "regex_filter": regex_filter,
163
- "use_blob_urls": use_blob_urls,
164
177
  "aws_access_key_id": aws_access_key_id,
165
178
  "aws_secret_access_key": aws_secret_access_key,
166
179
  "aws_session_token": aws_session_token,
167
180
  "aws_sse_kms_key_id": aws_sse_kms_key_id,
168
181
  "region_name": region_name,
169
182
  "s3_endpoint": s3endpoint,
170
- "presign": presign,
171
- "presign_ttl": presign_ttl,
172
- "recursive_scan": recursive_scan,
173
183
  },
174
184
  request_options=request_options,
175
185
  omit=OMIT,
@@ -182,19 +192,90 @@ class S3Client:
182
192
  raise ApiError(status_code=_response.status_code, body=_response.text)
183
193
  raise ApiError(status_code=_response.status_code, body=_response_json)
184
194
 
185
- def validate(self, *, request_options: typing.Optional[RequestOptions] = None) -> S3ImportStorage:
195
+ def validate(
196
+ self,
197
+ *,
198
+ id: typing.Optional[int] = OMIT,
199
+ regex_filter: typing.Optional[str] = OMIT,
200
+ use_blob_urls: typing.Optional[bool] = OMIT,
201
+ presign: typing.Optional[bool] = OMIT,
202
+ presign_ttl: typing.Optional[int] = OMIT,
203
+ recursive_scan: typing.Optional[bool] = OMIT,
204
+ title: typing.Optional[str] = OMIT,
205
+ description: typing.Optional[str] = OMIT,
206
+ project: typing.Optional[int] = OMIT,
207
+ bucket: typing.Optional[str] = OMIT,
208
+ prefix: typing.Optional[str] = OMIT,
209
+ aws_access_key_id: typing.Optional[str] = OMIT,
210
+ aws_secret_access_key: typing.Optional[str] = OMIT,
211
+ aws_session_token: typing.Optional[str] = OMIT,
212
+ aws_sse_kms_key_id: typing.Optional[str] = OMIT,
213
+ region_name: typing.Optional[str] = OMIT,
214
+ s3endpoint: typing.Optional[str] = OMIT,
215
+ request_options: typing.Optional[RequestOptions] = None,
216
+ ) -> None:
186
217
  """
187
218
  Validate a specific S3 import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.
188
219
 
189
220
  Parameters
190
221
  ----------
222
+ id : typing.Optional[int]
223
+ Storage ID. If set, storage with specified ID will be updated
224
+
225
+ regex_filter : typing.Optional[str]
226
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
227
+
228
+ use_blob_urls : typing.Optional[bool]
229
+ Interpret objects as BLOBs and generate URLs. For example, if your bucket 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.
230
+
231
+ presign : typing.Optional[bool]
232
+ Presign URLs for download
233
+
234
+ presign_ttl : typing.Optional[int]
235
+ Presign TTL in minutes
236
+
237
+ recursive_scan : typing.Optional[bool]
238
+ Scan recursively
239
+
240
+ title : typing.Optional[str]
241
+ Storage title
242
+
243
+ description : typing.Optional[str]
244
+ Storage description
245
+
246
+ project : typing.Optional[int]
247
+ Project ID
248
+
249
+ bucket : typing.Optional[str]
250
+ S3 bucket name
251
+
252
+ prefix : typing.Optional[str]
253
+ S3 bucket prefix
254
+
255
+ aws_access_key_id : typing.Optional[str]
256
+ AWS_ACCESS_KEY_ID
257
+
258
+ aws_secret_access_key : typing.Optional[str]
259
+ AWS_SECRET_ACCESS_KEY
260
+
261
+ aws_session_token : typing.Optional[str]
262
+ AWS_SESSION_TOKEN
263
+
264
+ aws_sse_kms_key_id : typing.Optional[str]
265
+ AWS SSE KMS Key ID
266
+
267
+ region_name : typing.Optional[str]
268
+ AWS Region
269
+
270
+ s3endpoint : typing.Optional[str]
271
+ S3 Endpoint
272
+
191
273
  request_options : typing.Optional[RequestOptions]
192
274
  Request-specific configuration.
193
275
 
194
276
  Returns
195
277
  -------
196
- S3ImportStorage
197
-
278
+ None
198
279
 
199
280
  Examples
200
281
  --------
@@ -206,10 +287,32 @@ class S3Client:
206
287
  client.import_storage.s3.validate()
207
288
  """
208
289
  _response = self._client_wrapper.httpx_client.request(
209
- "api/storages/s3/validate", method="POST", request_options=request_options
290
+ "api/storages/s3/validate",
291
+ method="POST",
292
+ json={
293
+ "id": id,
294
+ "regex_filter": regex_filter,
295
+ "use_blob_urls": use_blob_urls,
296
+ "presign": presign,
297
+ "presign_ttl": presign_ttl,
298
+ "recursive_scan": recursive_scan,
299
+ "title": title,
300
+ "description": description,
301
+ "project": project,
302
+ "bucket": bucket,
303
+ "prefix": prefix,
304
+ "aws_access_key_id": aws_access_key_id,
305
+ "aws_secret_access_key": aws_secret_access_key,
306
+ "aws_session_token": aws_session_token,
307
+ "aws_sse_kms_key_id": aws_sse_kms_key_id,
308
+ "region_name": region_name,
309
+ "s3_endpoint": s3endpoint,
310
+ },
311
+ request_options=request_options,
312
+ omit=OMIT,
210
313
  )
211
314
  if 200 <= _response.status_code < 300:
212
- return pydantic_v1.parse_obj_as(S3ImportStorage, _response.json()) # type: ignore
315
+ return
213
316
  try:
214
317
  _response_json = _response.json()
215
318
  except JSONDecodeError:
@@ -303,20 +406,22 @@ class S3Client:
303
406
  self,
304
407
  id: int,
305
408
  *,
409
+ regex_filter: typing.Optional[str] = OMIT,
410
+ use_blob_urls: typing.Optional[bool] = OMIT,
411
+ presign: typing.Optional[bool] = OMIT,
412
+ presign_ttl: typing.Optional[int] = OMIT,
413
+ recursive_scan: typing.Optional[bool] = OMIT,
414
+ title: typing.Optional[str] = OMIT,
415
+ description: typing.Optional[str] = OMIT,
306
416
  project: typing.Optional[int] = OMIT,
307
417
  bucket: typing.Optional[str] = OMIT,
308
418
  prefix: typing.Optional[str] = OMIT,
309
- regex_filter: typing.Optional[str] = OMIT,
310
- use_blob_urls: typing.Optional[bool] = OMIT,
311
419
  aws_access_key_id: typing.Optional[str] = OMIT,
312
420
  aws_secret_access_key: typing.Optional[str] = OMIT,
313
421
  aws_session_token: typing.Optional[str] = OMIT,
314
422
  aws_sse_kms_key_id: typing.Optional[str] = OMIT,
315
423
  region_name: typing.Optional[str] = OMIT,
316
424
  s3endpoint: typing.Optional[str] = OMIT,
317
- presign: typing.Optional[bool] = OMIT,
318
- presign_ttl: typing.Optional[int] = OMIT,
319
- recursive_scan: typing.Optional[bool] = OMIT,
320
425
  request_options: typing.Optional[RequestOptions] = None,
321
426
  ) -> S3UpdateResponse:
322
427
  """
@@ -329,6 +434,27 @@ class S3Client:
329
434
  id : int
330
435
  A unique integer value identifying this s3 import storage.
331
436
 
437
+ regex_filter : typing.Optional[str]
438
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
439
+
440
+ use_blob_urls : typing.Optional[bool]
441
+ Interpret objects as BLOBs and generate URLs. For example, if your bucket 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.
442
+
443
+ presign : typing.Optional[bool]
444
+ Presign URLs for download
445
+
446
+ presign_ttl : typing.Optional[int]
447
+ Presign TTL in minutes
448
+
449
+ recursive_scan : typing.Optional[bool]
450
+ Scan recursively
451
+
452
+ title : typing.Optional[str]
453
+ Storage title
454
+
455
+ description : typing.Optional[str]
456
+ Storage description
457
+
332
458
  project : typing.Optional[int]
333
459
  Project ID
334
460
 
@@ -338,12 +464,6 @@ class S3Client:
338
464
  prefix : typing.Optional[str]
339
465
  S3 bucket prefix
340
466
 
341
- regex_filter : typing.Optional[str]
342
- Cloud storage regex for filtering objects
343
-
344
- use_blob_urls : typing.Optional[bool]
345
- Interpret objects as BLOBs and generate URLs
346
-
347
467
  aws_access_key_id : typing.Optional[str]
348
468
  AWS_ACCESS_KEY_ID
349
469
 
@@ -362,15 +482,6 @@ class S3Client:
362
482
  s3endpoint : typing.Optional[str]
363
483
  S3 Endpoint
364
484
 
365
- presign : typing.Optional[bool]
366
- Presign URLs for download
367
-
368
- presign_ttl : typing.Optional[int]
369
- Presign TTL in seconds
370
-
371
- recursive_scan : typing.Optional[bool]
372
- Scan recursively
373
-
374
485
  request_options : typing.Optional[RequestOptions]
375
486
  Request-specific configuration.
376
487
 
@@ -394,20 +505,22 @@ class S3Client:
394
505
  f"api/storages/s3/{jsonable_encoder(id)}",
395
506
  method="PATCH",
396
507
  json={
508
+ "regex_filter": regex_filter,
509
+ "use_blob_urls": use_blob_urls,
510
+ "presign": presign,
511
+ "presign_ttl": presign_ttl,
512
+ "recursive_scan": recursive_scan,
513
+ "title": title,
514
+ "description": description,
397
515
  "project": project,
398
516
  "bucket": bucket,
399
517
  "prefix": prefix,
400
- "regex_filter": regex_filter,
401
- "use_blob_urls": use_blob_urls,
402
518
  "aws_access_key_id": aws_access_key_id,
403
519
  "aws_secret_access_key": aws_secret_access_key,
404
520
  "aws_session_token": aws_session_token,
405
521
  "aws_sse_kms_key_id": aws_sse_kms_key_id,
406
522
  "region_name": region_name,
407
523
  "s3_endpoint": s3endpoint,
408
- "presign": presign,
409
- "presign_ttl": presign_ttl,
410
- "recursive_scan": recursive_scan,
411
524
  },
412
525
  request_options=request_options,
413
526
  omit=OMIT,
@@ -514,20 +627,22 @@ class AsyncS3Client:
514
627
  async def create(
515
628
  self,
516
629
  *,
630
+ regex_filter: typing.Optional[str] = OMIT,
631
+ use_blob_urls: typing.Optional[bool] = OMIT,
632
+ presign: typing.Optional[bool] = OMIT,
633
+ presign_ttl: typing.Optional[int] = OMIT,
634
+ recursive_scan: typing.Optional[bool] = OMIT,
635
+ title: typing.Optional[str] = OMIT,
636
+ description: typing.Optional[str] = OMIT,
517
637
  project: typing.Optional[int] = OMIT,
518
638
  bucket: typing.Optional[str] = OMIT,
519
639
  prefix: typing.Optional[str] = OMIT,
520
- regex_filter: typing.Optional[str] = OMIT,
521
- use_blob_urls: typing.Optional[bool] = OMIT,
522
640
  aws_access_key_id: typing.Optional[str] = OMIT,
523
641
  aws_secret_access_key: typing.Optional[str] = OMIT,
524
642
  aws_session_token: typing.Optional[str] = OMIT,
525
643
  aws_sse_kms_key_id: typing.Optional[str] = OMIT,
526
644
  region_name: typing.Optional[str] = OMIT,
527
645
  s3endpoint: typing.Optional[str] = OMIT,
528
- presign: typing.Optional[bool] = OMIT,
529
- presign_ttl: typing.Optional[int] = OMIT,
530
- recursive_scan: typing.Optional[bool] = OMIT,
531
646
  request_options: typing.Optional[RequestOptions] = None,
532
647
  ) -> S3CreateResponse:
533
648
  """
@@ -541,6 +656,27 @@ class AsyncS3Client:
541
656
 
542
657
  Parameters
543
658
  ----------
659
+ regex_filter : typing.Optional[str]
660
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
661
+
662
+ use_blob_urls : typing.Optional[bool]
663
+ Interpret objects as BLOBs and generate URLs. For example, if your bucket 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.
664
+
665
+ presign : typing.Optional[bool]
666
+ Presign URLs for download
667
+
668
+ presign_ttl : typing.Optional[int]
669
+ Presign TTL in minutes
670
+
671
+ recursive_scan : typing.Optional[bool]
672
+ Scan recursively
673
+
674
+ title : typing.Optional[str]
675
+ Storage title
676
+
677
+ description : typing.Optional[str]
678
+ Storage description
679
+
544
680
  project : typing.Optional[int]
545
681
  Project ID
546
682
 
@@ -550,12 +686,6 @@ class AsyncS3Client:
550
686
  prefix : typing.Optional[str]
551
687
  S3 bucket prefix
552
688
 
553
- regex_filter : typing.Optional[str]
554
- Cloud storage regex for filtering objects
555
-
556
- use_blob_urls : typing.Optional[bool]
557
- Interpret objects as BLOBs and generate URLs
558
-
559
689
  aws_access_key_id : typing.Optional[str]
560
690
  AWS_ACCESS_KEY_ID
561
691
 
@@ -574,15 +704,6 @@ class AsyncS3Client:
574
704
  s3endpoint : typing.Optional[str]
575
705
  S3 Endpoint
576
706
 
577
- presign : typing.Optional[bool]
578
- Presign URLs for download
579
-
580
- presign_ttl : typing.Optional[int]
581
- Presign TTL in seconds
582
-
583
- recursive_scan : typing.Optional[bool]
584
- Scan recursively
585
-
586
707
  request_options : typing.Optional[RequestOptions]
587
708
  Request-specific configuration.
588
709
 
@@ -604,20 +725,22 @@ class AsyncS3Client:
604
725
  "api/storages/s3/",
605
726
  method="POST",
606
727
  json={
728
+ "regex_filter": regex_filter,
729
+ "use_blob_urls": use_blob_urls,
730
+ "presign": presign,
731
+ "presign_ttl": presign_ttl,
732
+ "recursive_scan": recursive_scan,
733
+ "title": title,
734
+ "description": description,
607
735
  "project": project,
608
736
  "bucket": bucket,
609
737
  "prefix": prefix,
610
- "regex_filter": regex_filter,
611
- "use_blob_urls": use_blob_urls,
612
738
  "aws_access_key_id": aws_access_key_id,
613
739
  "aws_secret_access_key": aws_secret_access_key,
614
740
  "aws_session_token": aws_session_token,
615
741
  "aws_sse_kms_key_id": aws_sse_kms_key_id,
616
742
  "region_name": region_name,
617
743
  "s3_endpoint": s3endpoint,
618
- "presign": presign,
619
- "presign_ttl": presign_ttl,
620
- "recursive_scan": recursive_scan,
621
744
  },
622
745
  request_options=request_options,
623
746
  omit=OMIT,
@@ -630,19 +753,90 @@ class AsyncS3Client:
630
753
  raise ApiError(status_code=_response.status_code, body=_response.text)
631
754
  raise ApiError(status_code=_response.status_code, body=_response_json)
632
755
 
633
- async def validate(self, *, request_options: typing.Optional[RequestOptions] = None) -> S3ImportStorage:
756
+ async def validate(
757
+ self,
758
+ *,
759
+ id: typing.Optional[int] = OMIT,
760
+ regex_filter: typing.Optional[str] = OMIT,
761
+ use_blob_urls: typing.Optional[bool] = OMIT,
762
+ presign: typing.Optional[bool] = OMIT,
763
+ presign_ttl: typing.Optional[int] = OMIT,
764
+ recursive_scan: typing.Optional[bool] = OMIT,
765
+ title: typing.Optional[str] = OMIT,
766
+ description: typing.Optional[str] = OMIT,
767
+ project: typing.Optional[int] = OMIT,
768
+ bucket: typing.Optional[str] = OMIT,
769
+ prefix: typing.Optional[str] = OMIT,
770
+ aws_access_key_id: typing.Optional[str] = OMIT,
771
+ aws_secret_access_key: typing.Optional[str] = OMIT,
772
+ aws_session_token: typing.Optional[str] = OMIT,
773
+ aws_sse_kms_key_id: typing.Optional[str] = OMIT,
774
+ region_name: typing.Optional[str] = OMIT,
775
+ s3endpoint: typing.Optional[str] = OMIT,
776
+ request_options: typing.Optional[RequestOptions] = None,
777
+ ) -> None:
634
778
  """
635
779
  Validate a specific S3 import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.
636
780
 
637
781
  Parameters
638
782
  ----------
783
+ id : typing.Optional[int]
784
+ Storage ID. If set, storage with specified ID will be updated
785
+
786
+ regex_filter : typing.Optional[str]
787
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
788
+
789
+ use_blob_urls : typing.Optional[bool]
790
+ Interpret objects as BLOBs and generate URLs. For example, if your bucket 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.
791
+
792
+ presign : typing.Optional[bool]
793
+ Presign URLs for download
794
+
795
+ presign_ttl : typing.Optional[int]
796
+ Presign TTL in minutes
797
+
798
+ recursive_scan : typing.Optional[bool]
799
+ Scan recursively
800
+
801
+ title : typing.Optional[str]
802
+ Storage title
803
+
804
+ description : typing.Optional[str]
805
+ Storage description
806
+
807
+ project : typing.Optional[int]
808
+ Project ID
809
+
810
+ bucket : typing.Optional[str]
811
+ S3 bucket name
812
+
813
+ prefix : typing.Optional[str]
814
+ S3 bucket prefix
815
+
816
+ aws_access_key_id : typing.Optional[str]
817
+ AWS_ACCESS_KEY_ID
818
+
819
+ aws_secret_access_key : typing.Optional[str]
820
+ AWS_SECRET_ACCESS_KEY
821
+
822
+ aws_session_token : typing.Optional[str]
823
+ AWS_SESSION_TOKEN
824
+
825
+ aws_sse_kms_key_id : typing.Optional[str]
826
+ AWS SSE KMS Key ID
827
+
828
+ region_name : typing.Optional[str]
829
+ AWS Region
830
+
831
+ s3endpoint : typing.Optional[str]
832
+ S3 Endpoint
833
+
639
834
  request_options : typing.Optional[RequestOptions]
640
835
  Request-specific configuration.
641
836
 
642
837
  Returns
643
838
  -------
644
- S3ImportStorage
645
-
839
+ None
646
840
 
647
841
  Examples
648
842
  --------
@@ -654,10 +848,32 @@ class AsyncS3Client:
654
848
  await client.import_storage.s3.validate()
655
849
  """
656
850
  _response = await self._client_wrapper.httpx_client.request(
657
- "api/storages/s3/validate", method="POST", request_options=request_options
851
+ "api/storages/s3/validate",
852
+ method="POST",
853
+ json={
854
+ "id": id,
855
+ "regex_filter": regex_filter,
856
+ "use_blob_urls": use_blob_urls,
857
+ "presign": presign,
858
+ "presign_ttl": presign_ttl,
859
+ "recursive_scan": recursive_scan,
860
+ "title": title,
861
+ "description": description,
862
+ "project": project,
863
+ "bucket": bucket,
864
+ "prefix": prefix,
865
+ "aws_access_key_id": aws_access_key_id,
866
+ "aws_secret_access_key": aws_secret_access_key,
867
+ "aws_session_token": aws_session_token,
868
+ "aws_sse_kms_key_id": aws_sse_kms_key_id,
869
+ "region_name": region_name,
870
+ "s3_endpoint": s3endpoint,
871
+ },
872
+ request_options=request_options,
873
+ omit=OMIT,
658
874
  )
659
875
  if 200 <= _response.status_code < 300:
660
- return pydantic_v1.parse_obj_as(S3ImportStorage, _response.json()) # type: ignore
876
+ return
661
877
  try:
662
878
  _response_json = _response.json()
663
879
  except JSONDecodeError:
@@ -751,20 +967,22 @@ class AsyncS3Client:
751
967
  self,
752
968
  id: int,
753
969
  *,
970
+ regex_filter: typing.Optional[str] = OMIT,
971
+ use_blob_urls: typing.Optional[bool] = OMIT,
972
+ presign: typing.Optional[bool] = OMIT,
973
+ presign_ttl: typing.Optional[int] = OMIT,
974
+ recursive_scan: typing.Optional[bool] = OMIT,
975
+ title: typing.Optional[str] = OMIT,
976
+ description: typing.Optional[str] = OMIT,
754
977
  project: typing.Optional[int] = OMIT,
755
978
  bucket: typing.Optional[str] = OMIT,
756
979
  prefix: typing.Optional[str] = OMIT,
757
- regex_filter: typing.Optional[str] = OMIT,
758
- use_blob_urls: typing.Optional[bool] = OMIT,
759
980
  aws_access_key_id: typing.Optional[str] = OMIT,
760
981
  aws_secret_access_key: typing.Optional[str] = OMIT,
761
982
  aws_session_token: typing.Optional[str] = OMIT,
762
983
  aws_sse_kms_key_id: typing.Optional[str] = OMIT,
763
984
  region_name: typing.Optional[str] = OMIT,
764
985
  s3endpoint: typing.Optional[str] = OMIT,
765
- presign: typing.Optional[bool] = OMIT,
766
- presign_ttl: typing.Optional[int] = OMIT,
767
- recursive_scan: typing.Optional[bool] = OMIT,
768
986
  request_options: typing.Optional[RequestOptions] = None,
769
987
  ) -> S3UpdateResponse:
770
988
  """
@@ -777,6 +995,27 @@ class AsyncS3Client:
777
995
  id : int
778
996
  A unique integer value identifying this s3 import storage.
779
997
 
998
+ regex_filter : typing.Optional[str]
999
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
1000
+
1001
+ use_blob_urls : typing.Optional[bool]
1002
+ Interpret objects as BLOBs and generate URLs. For example, if your bucket 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.
1003
+
1004
+ presign : typing.Optional[bool]
1005
+ Presign URLs for download
1006
+
1007
+ presign_ttl : typing.Optional[int]
1008
+ Presign TTL in minutes
1009
+
1010
+ recursive_scan : typing.Optional[bool]
1011
+ Scan recursively
1012
+
1013
+ title : typing.Optional[str]
1014
+ Storage title
1015
+
1016
+ description : typing.Optional[str]
1017
+ Storage description
1018
+
780
1019
  project : typing.Optional[int]
781
1020
  Project ID
782
1021
 
@@ -786,12 +1025,6 @@ class AsyncS3Client:
786
1025
  prefix : typing.Optional[str]
787
1026
  S3 bucket prefix
788
1027
 
789
- regex_filter : typing.Optional[str]
790
- Cloud storage regex for filtering objects
791
-
792
- use_blob_urls : typing.Optional[bool]
793
- Interpret objects as BLOBs and generate URLs
794
-
795
1028
  aws_access_key_id : typing.Optional[str]
796
1029
  AWS_ACCESS_KEY_ID
797
1030
 
@@ -810,15 +1043,6 @@ class AsyncS3Client:
810
1043
  s3endpoint : typing.Optional[str]
811
1044
  S3 Endpoint
812
1045
 
813
- presign : typing.Optional[bool]
814
- Presign URLs for download
815
-
816
- presign_ttl : typing.Optional[int]
817
- Presign TTL in seconds
818
-
819
- recursive_scan : typing.Optional[bool]
820
- Scan recursively
821
-
822
1046
  request_options : typing.Optional[RequestOptions]
823
1047
  Request-specific configuration.
824
1048
 
@@ -842,20 +1066,22 @@ class AsyncS3Client:
842
1066
  f"api/storages/s3/{jsonable_encoder(id)}",
843
1067
  method="PATCH",
844
1068
  json={
1069
+ "regex_filter": regex_filter,
1070
+ "use_blob_urls": use_blob_urls,
1071
+ "presign": presign,
1072
+ "presign_ttl": presign_ttl,
1073
+ "recursive_scan": recursive_scan,
1074
+ "title": title,
1075
+ "description": description,
845
1076
  "project": project,
846
1077
  "bucket": bucket,
847
1078
  "prefix": prefix,
848
- "regex_filter": regex_filter,
849
- "use_blob_urls": use_blob_urls,
850
1079
  "aws_access_key_id": aws_access_key_id,
851
1080
  "aws_secret_access_key": aws_secret_access_key,
852
1081
  "aws_session_token": aws_session_token,
853
1082
  "aws_sse_kms_key_id": aws_sse_kms_key_id,
854
1083
  "region_name": region_name,
855
1084
  "s3_endpoint": s3endpoint,
856
- "presign": presign,
857
- "presign_ttl": presign_ttl,
858
- "recursive_scan": recursive_scan,
859
1085
  },
860
1086
  request_options=request_options,
861
1087
  omit=OMIT,