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,15 +66,17 @@ class AzureClient:
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
+ title: typing.Optional[str] = OMIT,
74
+ description: typing.Optional[str] = OMIT,
69
75
  project: typing.Optional[int] = OMIT,
70
76
  container: typing.Optional[str] = OMIT,
71
77
  prefix: typing.Optional[str] = OMIT,
72
- regex_filter: typing.Optional[str] = OMIT,
73
- use_blob_urls: typing.Optional[bool] = OMIT,
74
78
  account_name: typing.Optional[str] = OMIT,
75
79
  account_key: typing.Optional[str] = OMIT,
76
- presign: typing.Optional[bool] = OMIT,
77
- presign_ttl: typing.Optional[int] = OMIT,
78
80
  request_options: typing.Optional[RequestOptions] = None,
79
81
  ) -> AzureCreateResponse:
80
82
  """
@@ -88,6 +90,24 @@ class AzureClient:
88
90
 
89
91
  Parameters
90
92
  ----------
93
+ regex_filter : typing.Optional[str]
94
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
95
+
96
+ use_blob_urls : typing.Optional[bool]
97
+ 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.
98
+
99
+ presign : typing.Optional[bool]
100
+ Presign URLs for direct download
101
+
102
+ presign_ttl : typing.Optional[int]
103
+ Presign TTL in minutes
104
+
105
+ title : typing.Optional[str]
106
+ Storage title
107
+
108
+ description : typing.Optional[str]
109
+ Storage description
110
+
91
111
  project : typing.Optional[int]
92
112
  Project ID
93
113
 
@@ -97,24 +117,12 @@ class AzureClient:
97
117
  prefix : typing.Optional[str]
98
118
  Azure blob prefix name
99
119
 
100
- regex_filter : typing.Optional[str]
101
- Cloud storage regex for filtering objects
102
-
103
- use_blob_urls : typing.Optional[bool]
104
- Interpret objects as BLOBs and generate URLs
105
-
106
120
  account_name : typing.Optional[str]
107
121
  Azure Blob account name
108
122
 
109
123
  account_key : typing.Optional[str]
110
124
  Azure Blob account key
111
125
 
112
- presign : typing.Optional[bool]
113
- Presign URLs for direct download
114
-
115
- presign_ttl : typing.Optional[int]
116
- Presign TTL in minutes
117
-
118
126
  request_options : typing.Optional[RequestOptions]
119
127
  Request-specific configuration.
120
128
 
@@ -136,15 +144,17 @@ class AzureClient:
136
144
  "api/storages/azure/",
137
145
  method="POST",
138
146
  json={
147
+ "regex_filter": regex_filter,
148
+ "use_blob_urls": use_blob_urls,
149
+ "presign": presign,
150
+ "presign_ttl": presign_ttl,
151
+ "title": title,
152
+ "description": description,
139
153
  "project": project,
140
154
  "container": container,
141
155
  "prefix": prefix,
142
- "regex_filter": regex_filter,
143
- "use_blob_urls": use_blob_urls,
144
156
  "account_name": account_name,
145
157
  "account_key": account_key,
146
- "presign": presign,
147
- "presign_ttl": presign_ttl,
148
158
  },
149
159
  request_options=request_options,
150
160
  omit=OMIT,
@@ -157,19 +167,70 @@ class AzureClient:
157
167
  raise ApiError(status_code=_response.status_code, body=_response.text)
158
168
  raise ApiError(status_code=_response.status_code, body=_response_json)
159
169
 
160
- def validate(self, *, request_options: typing.Optional[RequestOptions] = None) -> AzureBlobImportStorage:
170
+ def validate(
171
+ self,
172
+ *,
173
+ id: typing.Optional[int] = OMIT,
174
+ regex_filter: typing.Optional[str] = OMIT,
175
+ use_blob_urls: typing.Optional[bool] = OMIT,
176
+ presign: typing.Optional[bool] = OMIT,
177
+ presign_ttl: typing.Optional[int] = OMIT,
178
+ title: typing.Optional[str] = OMIT,
179
+ description: typing.Optional[str] = OMIT,
180
+ project: typing.Optional[int] = OMIT,
181
+ container: typing.Optional[str] = OMIT,
182
+ prefix: typing.Optional[str] = OMIT,
183
+ account_name: typing.Optional[str] = OMIT,
184
+ account_key: typing.Optional[str] = OMIT,
185
+ request_options: typing.Optional[RequestOptions] = None,
186
+ ) -> None:
161
187
  """
162
188
  Validate a specific Azure import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.
163
189
 
164
190
  Parameters
165
191
  ----------
192
+ id : typing.Optional[int]
193
+ Storage ID. If set, storage with specified ID will be updated
194
+
195
+ regex_filter : typing.Optional[str]
196
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
197
+
198
+ use_blob_urls : typing.Optional[bool]
199
+ 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.
200
+
201
+ presign : typing.Optional[bool]
202
+ Presign URLs for direct download
203
+
204
+ presign_ttl : typing.Optional[int]
205
+ Presign TTL in minutes
206
+
207
+ title : typing.Optional[str]
208
+ Storage title
209
+
210
+ description : typing.Optional[str]
211
+ Storage description
212
+
213
+ project : typing.Optional[int]
214
+ Project ID
215
+
216
+ container : typing.Optional[str]
217
+ Azure blob container
218
+
219
+ prefix : typing.Optional[str]
220
+ Azure blob prefix name
221
+
222
+ account_name : typing.Optional[str]
223
+ Azure Blob account name
224
+
225
+ account_key : typing.Optional[str]
226
+ Azure Blob account key
227
+
166
228
  request_options : typing.Optional[RequestOptions]
167
229
  Request-specific configuration.
168
230
 
169
231
  Returns
170
232
  -------
171
- AzureBlobImportStorage
172
-
233
+ None
173
234
 
174
235
  Examples
175
236
  --------
@@ -181,10 +242,27 @@ class AzureClient:
181
242
  client.import_storage.azure.validate()
182
243
  """
183
244
  _response = self._client_wrapper.httpx_client.request(
184
- "api/storages/azure/validate", method="POST", request_options=request_options
245
+ "api/storages/azure/validate",
246
+ method="POST",
247
+ json={
248
+ "id": id,
249
+ "regex_filter": regex_filter,
250
+ "use_blob_urls": use_blob_urls,
251
+ "presign": presign,
252
+ "presign_ttl": presign_ttl,
253
+ "title": title,
254
+ "description": description,
255
+ "project": project,
256
+ "container": container,
257
+ "prefix": prefix,
258
+ "account_name": account_name,
259
+ "account_key": account_key,
260
+ },
261
+ request_options=request_options,
262
+ omit=OMIT,
185
263
  )
186
264
  if 200 <= _response.status_code < 300:
187
- return pydantic_v1.parse_obj_as(AzureBlobImportStorage, _response.json()) # type: ignore
265
+ return
188
266
  try:
189
267
  _response_json = _response.json()
190
268
  except JSONDecodeError:
@@ -278,15 +356,17 @@ class AzureClient:
278
356
  self,
279
357
  id: int,
280
358
  *,
359
+ regex_filter: typing.Optional[str] = OMIT,
360
+ use_blob_urls: typing.Optional[bool] = OMIT,
361
+ presign: typing.Optional[bool] = OMIT,
362
+ presign_ttl: typing.Optional[int] = OMIT,
363
+ title: typing.Optional[str] = OMIT,
364
+ description: typing.Optional[str] = OMIT,
281
365
  project: typing.Optional[int] = OMIT,
282
366
  container: typing.Optional[str] = OMIT,
283
367
  prefix: typing.Optional[str] = OMIT,
284
- regex_filter: typing.Optional[str] = OMIT,
285
- use_blob_urls: typing.Optional[bool] = OMIT,
286
368
  account_name: typing.Optional[str] = OMIT,
287
369
  account_key: typing.Optional[str] = OMIT,
288
- presign: typing.Optional[bool] = OMIT,
289
- presign_ttl: typing.Optional[int] = OMIT,
290
370
  request_options: typing.Optional[RequestOptions] = None,
291
371
  ) -> AzureUpdateResponse:
292
372
  """
@@ -299,6 +379,24 @@ class AzureClient:
299
379
  id : int
300
380
  A unique integer value identifying this azure blob import storage.
301
381
 
382
+ regex_filter : typing.Optional[str]
383
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
384
+
385
+ use_blob_urls : typing.Optional[bool]
386
+ 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.
387
+
388
+ presign : typing.Optional[bool]
389
+ Presign URLs for direct download
390
+
391
+ presign_ttl : typing.Optional[int]
392
+ Presign TTL in minutes
393
+
394
+ title : typing.Optional[str]
395
+ Storage title
396
+
397
+ description : typing.Optional[str]
398
+ Storage description
399
+
302
400
  project : typing.Optional[int]
303
401
  Project ID
304
402
 
@@ -308,24 +406,12 @@ class AzureClient:
308
406
  prefix : typing.Optional[str]
309
407
  Azure blob prefix name
310
408
 
311
- regex_filter : typing.Optional[str]
312
- Cloud storage regex for filtering objects
313
-
314
- use_blob_urls : typing.Optional[bool]
315
- Interpret objects as BLOBs and generate URLs
316
-
317
409
  account_name : typing.Optional[str]
318
410
  Azure Blob account name
319
411
 
320
412
  account_key : typing.Optional[str]
321
413
  Azure Blob account key
322
414
 
323
- presign : typing.Optional[bool]
324
- Presign URLs for direct download
325
-
326
- presign_ttl : typing.Optional[int]
327
- Presign TTL in minutes
328
-
329
415
  request_options : typing.Optional[RequestOptions]
330
416
  Request-specific configuration.
331
417
 
@@ -349,15 +435,17 @@ class AzureClient:
349
435
  f"api/storages/azure/{jsonable_encoder(id)}",
350
436
  method="PATCH",
351
437
  json={
438
+ "regex_filter": regex_filter,
439
+ "use_blob_urls": use_blob_urls,
440
+ "presign": presign,
441
+ "presign_ttl": presign_ttl,
442
+ "title": title,
443
+ "description": description,
352
444
  "project": project,
353
445
  "container": container,
354
446
  "prefix": prefix,
355
- "regex_filter": regex_filter,
356
- "use_blob_urls": use_blob_urls,
357
447
  "account_name": account_name,
358
448
  "account_key": account_key,
359
- "presign": presign,
360
- "presign_ttl": presign_ttl,
361
449
  },
362
450
  request_options=request_options,
363
451
  omit=OMIT,
@@ -464,15 +552,17 @@ class AsyncAzureClient:
464
552
  async def create(
465
553
  self,
466
554
  *,
555
+ regex_filter: typing.Optional[str] = OMIT,
556
+ use_blob_urls: typing.Optional[bool] = OMIT,
557
+ presign: typing.Optional[bool] = OMIT,
558
+ presign_ttl: typing.Optional[int] = OMIT,
559
+ title: typing.Optional[str] = OMIT,
560
+ description: typing.Optional[str] = OMIT,
467
561
  project: typing.Optional[int] = OMIT,
468
562
  container: typing.Optional[str] = OMIT,
469
563
  prefix: typing.Optional[str] = OMIT,
470
- regex_filter: typing.Optional[str] = OMIT,
471
- use_blob_urls: typing.Optional[bool] = OMIT,
472
564
  account_name: typing.Optional[str] = OMIT,
473
565
  account_key: typing.Optional[str] = OMIT,
474
- presign: typing.Optional[bool] = OMIT,
475
- presign_ttl: typing.Optional[int] = OMIT,
476
566
  request_options: typing.Optional[RequestOptions] = None,
477
567
  ) -> AzureCreateResponse:
478
568
  """
@@ -486,6 +576,24 @@ class AsyncAzureClient:
486
576
 
487
577
  Parameters
488
578
  ----------
579
+ regex_filter : typing.Optional[str]
580
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
581
+
582
+ use_blob_urls : typing.Optional[bool]
583
+ 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.
584
+
585
+ presign : typing.Optional[bool]
586
+ Presign URLs for direct download
587
+
588
+ presign_ttl : typing.Optional[int]
589
+ Presign TTL in minutes
590
+
591
+ title : typing.Optional[str]
592
+ Storage title
593
+
594
+ description : typing.Optional[str]
595
+ Storage description
596
+
489
597
  project : typing.Optional[int]
490
598
  Project ID
491
599
 
@@ -495,24 +603,12 @@ class AsyncAzureClient:
495
603
  prefix : typing.Optional[str]
496
604
  Azure blob prefix name
497
605
 
498
- regex_filter : typing.Optional[str]
499
- Cloud storage regex for filtering objects
500
-
501
- use_blob_urls : typing.Optional[bool]
502
- Interpret objects as BLOBs and generate URLs
503
-
504
606
  account_name : typing.Optional[str]
505
607
  Azure Blob account name
506
608
 
507
609
  account_key : typing.Optional[str]
508
610
  Azure Blob account key
509
611
 
510
- presign : typing.Optional[bool]
511
- Presign URLs for direct download
512
-
513
- presign_ttl : typing.Optional[int]
514
- Presign TTL in minutes
515
-
516
612
  request_options : typing.Optional[RequestOptions]
517
613
  Request-specific configuration.
518
614
 
@@ -534,15 +630,17 @@ class AsyncAzureClient:
534
630
  "api/storages/azure/",
535
631
  method="POST",
536
632
  json={
633
+ "regex_filter": regex_filter,
634
+ "use_blob_urls": use_blob_urls,
635
+ "presign": presign,
636
+ "presign_ttl": presign_ttl,
637
+ "title": title,
638
+ "description": description,
537
639
  "project": project,
538
640
  "container": container,
539
641
  "prefix": prefix,
540
- "regex_filter": regex_filter,
541
- "use_blob_urls": use_blob_urls,
542
642
  "account_name": account_name,
543
643
  "account_key": account_key,
544
- "presign": presign,
545
- "presign_ttl": presign_ttl,
546
644
  },
547
645
  request_options=request_options,
548
646
  omit=OMIT,
@@ -555,19 +653,70 @@ class AsyncAzureClient:
555
653
  raise ApiError(status_code=_response.status_code, body=_response.text)
556
654
  raise ApiError(status_code=_response.status_code, body=_response_json)
557
655
 
558
- async def validate(self, *, request_options: typing.Optional[RequestOptions] = None) -> AzureBlobImportStorage:
656
+ async def validate(
657
+ self,
658
+ *,
659
+ id: typing.Optional[int] = OMIT,
660
+ regex_filter: typing.Optional[str] = OMIT,
661
+ use_blob_urls: typing.Optional[bool] = OMIT,
662
+ presign: typing.Optional[bool] = OMIT,
663
+ presign_ttl: typing.Optional[int] = OMIT,
664
+ title: typing.Optional[str] = OMIT,
665
+ description: typing.Optional[str] = OMIT,
666
+ project: typing.Optional[int] = OMIT,
667
+ container: typing.Optional[str] = OMIT,
668
+ prefix: typing.Optional[str] = OMIT,
669
+ account_name: typing.Optional[str] = OMIT,
670
+ account_key: typing.Optional[str] = OMIT,
671
+ request_options: typing.Optional[RequestOptions] = None,
672
+ ) -> None:
559
673
  """
560
674
  Validate a specific Azure import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.
561
675
 
562
676
  Parameters
563
677
  ----------
678
+ id : typing.Optional[int]
679
+ Storage ID. If set, storage with specified ID will be updated
680
+
681
+ regex_filter : typing.Optional[str]
682
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
683
+
684
+ use_blob_urls : typing.Optional[bool]
685
+ 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.
686
+
687
+ presign : typing.Optional[bool]
688
+ Presign URLs for direct download
689
+
690
+ presign_ttl : typing.Optional[int]
691
+ Presign TTL in minutes
692
+
693
+ title : typing.Optional[str]
694
+ Storage title
695
+
696
+ description : typing.Optional[str]
697
+ Storage description
698
+
699
+ project : typing.Optional[int]
700
+ Project ID
701
+
702
+ container : typing.Optional[str]
703
+ Azure blob container
704
+
705
+ prefix : typing.Optional[str]
706
+ Azure blob prefix name
707
+
708
+ account_name : typing.Optional[str]
709
+ Azure Blob account name
710
+
711
+ account_key : typing.Optional[str]
712
+ Azure Blob account key
713
+
564
714
  request_options : typing.Optional[RequestOptions]
565
715
  Request-specific configuration.
566
716
 
567
717
  Returns
568
718
  -------
569
- AzureBlobImportStorage
570
-
719
+ None
571
720
 
572
721
  Examples
573
722
  --------
@@ -579,10 +728,27 @@ class AsyncAzureClient:
579
728
  await client.import_storage.azure.validate()
580
729
  """
581
730
  _response = await self._client_wrapper.httpx_client.request(
582
- "api/storages/azure/validate", method="POST", request_options=request_options
731
+ "api/storages/azure/validate",
732
+ method="POST",
733
+ json={
734
+ "id": id,
735
+ "regex_filter": regex_filter,
736
+ "use_blob_urls": use_blob_urls,
737
+ "presign": presign,
738
+ "presign_ttl": presign_ttl,
739
+ "title": title,
740
+ "description": description,
741
+ "project": project,
742
+ "container": container,
743
+ "prefix": prefix,
744
+ "account_name": account_name,
745
+ "account_key": account_key,
746
+ },
747
+ request_options=request_options,
748
+ omit=OMIT,
583
749
  )
584
750
  if 200 <= _response.status_code < 300:
585
- return pydantic_v1.parse_obj_as(AzureBlobImportStorage, _response.json()) # type: ignore
751
+ return
586
752
  try:
587
753
  _response_json = _response.json()
588
754
  except JSONDecodeError:
@@ -676,15 +842,17 @@ class AsyncAzureClient:
676
842
  self,
677
843
  id: int,
678
844
  *,
845
+ regex_filter: typing.Optional[str] = OMIT,
846
+ use_blob_urls: typing.Optional[bool] = OMIT,
847
+ presign: typing.Optional[bool] = OMIT,
848
+ presign_ttl: typing.Optional[int] = OMIT,
849
+ title: typing.Optional[str] = OMIT,
850
+ description: typing.Optional[str] = OMIT,
679
851
  project: typing.Optional[int] = OMIT,
680
852
  container: typing.Optional[str] = OMIT,
681
853
  prefix: typing.Optional[str] = OMIT,
682
- regex_filter: typing.Optional[str] = OMIT,
683
- use_blob_urls: typing.Optional[bool] = OMIT,
684
854
  account_name: typing.Optional[str] = OMIT,
685
855
  account_key: typing.Optional[str] = OMIT,
686
- presign: typing.Optional[bool] = OMIT,
687
- presign_ttl: typing.Optional[int] = OMIT,
688
856
  request_options: typing.Optional[RequestOptions] = None,
689
857
  ) -> AzureUpdateResponse:
690
858
  """
@@ -697,6 +865,24 @@ class AsyncAzureClient:
697
865
  id : int
698
866
  A unique integer value identifying this azure blob import storage.
699
867
 
868
+ regex_filter : typing.Optional[str]
869
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
870
+
871
+ use_blob_urls : typing.Optional[bool]
872
+ 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.
873
+
874
+ presign : typing.Optional[bool]
875
+ Presign URLs for direct download
876
+
877
+ presign_ttl : typing.Optional[int]
878
+ Presign TTL in minutes
879
+
880
+ title : typing.Optional[str]
881
+ Storage title
882
+
883
+ description : typing.Optional[str]
884
+ Storage description
885
+
700
886
  project : typing.Optional[int]
701
887
  Project ID
702
888
 
@@ -706,24 +892,12 @@ class AsyncAzureClient:
706
892
  prefix : typing.Optional[str]
707
893
  Azure blob prefix name
708
894
 
709
- regex_filter : typing.Optional[str]
710
- Cloud storage regex for filtering objects
711
-
712
- use_blob_urls : typing.Optional[bool]
713
- Interpret objects as BLOBs and generate URLs
714
-
715
895
  account_name : typing.Optional[str]
716
896
  Azure Blob account name
717
897
 
718
898
  account_key : typing.Optional[str]
719
899
  Azure Blob account key
720
900
 
721
- presign : typing.Optional[bool]
722
- Presign URLs for direct download
723
-
724
- presign_ttl : typing.Optional[int]
725
- Presign TTL in minutes
726
-
727
901
  request_options : typing.Optional[RequestOptions]
728
902
  Request-specific configuration.
729
903
 
@@ -747,15 +921,17 @@ class AsyncAzureClient:
747
921
  f"api/storages/azure/{jsonable_encoder(id)}",
748
922
  method="PATCH",
749
923
  json={
924
+ "regex_filter": regex_filter,
925
+ "use_blob_urls": use_blob_urls,
926
+ "presign": presign,
927
+ "presign_ttl": presign_ttl,
928
+ "title": title,
929
+ "description": description,
750
930
  "project": project,
751
931
  "container": container,
752
932
  "prefix": prefix,
753
- "regex_filter": regex_filter,
754
- "use_blob_urls": use_blob_urls,
755
933
  "account_name": account_name,
756
934
  "account_key": account_key,
757
- "presign": presign,
758
- "presign_ttl": presign_ttl,
759
935
  },
760
936
  request_options=request_options,
761
937
  omit=OMIT,
@@ -8,49 +8,59 @@ from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
8
 
9
9
 
10
10
  class AzureCreateResponse(pydantic_v1.BaseModel):
11
- project: typing.Optional[int] = pydantic_v1.Field(default=None)
11
+ regex_filter: typing.Optional[str] = pydantic_v1.Field(default=None)
12
12
  """
13
- Project ID
13
+ Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
14
14
  """
15
15
 
16
- container: typing.Optional[str] = pydantic_v1.Field(default=None)
16
+ use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
17
17
  """
18
- Azure blob container
18
+ 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.
19
19
  """
20
20
 
21
- prefix: typing.Optional[str] = pydantic_v1.Field(default=None)
21
+ presign: typing.Optional[bool] = pydantic_v1.Field(default=None)
22
22
  """
23
- Azure blob prefix name
23
+ Presign URLs for direct download
24
24
  """
25
25
 
26
- regex_filter: typing.Optional[str] = pydantic_v1.Field(default=None)
26
+ presign_ttl: typing.Optional[int] = pydantic_v1.Field(default=None)
27
27
  """
28
- Cloud storage regex for filtering objects
28
+ Presign TTL in minutes
29
29
  """
30
30
 
31
- use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
31
+ title: typing.Optional[str] = pydantic_v1.Field(default=None)
32
32
  """
33
- Interpret objects as BLOBs and generate URLs
33
+ Storage title
34
34
  """
35
35
 
36
- account_name: typing.Optional[str] = pydantic_v1.Field(default=None)
36
+ description: typing.Optional[str] = pydantic_v1.Field(default=None)
37
37
  """
38
- Azure Blob account name
38
+ Storage description
39
39
  """
40
40
 
41
- account_key: typing.Optional[str] = pydantic_v1.Field(default=None)
41
+ project: typing.Optional[int] = pydantic_v1.Field(default=None)
42
42
  """
43
- Azure Blob account key
43
+ Project ID
44
44
  """
45
45
 
46
- presign: typing.Optional[bool] = pydantic_v1.Field(default=None)
46
+ container: typing.Optional[str] = pydantic_v1.Field(default=None)
47
47
  """
48
- Presign URLs for direct download
48
+ Azure blob container
49
49
  """
50
50
 
51
- presign_ttl: typing.Optional[int] = pydantic_v1.Field(default=None)
51
+ prefix: typing.Optional[str] = pydantic_v1.Field(default=None)
52
52
  """
53
- Presign TTL in minutes
53
+ Azure blob prefix name
54
+ """
55
+
56
+ account_name: typing.Optional[str] = pydantic_v1.Field(default=None)
57
+ """
58
+ Azure Blob account name
59
+ """
60
+
61
+ account_key: typing.Optional[str] = pydantic_v1.Field(default=None)
62
+ """
63
+ Azure Blob account key
54
64
  """
55
65
 
56
66
  def json(self, **kwargs: typing.Any) -> str: