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
@@ -8,49 +8,59 @@ from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
8
 
9
9
 
10
10
  class GcsCreateResponse(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
- bucket: typing.Optional[str] = pydantic_v1.Field(default=None)
16
+ use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
17
17
  """
18
- GCS bucket name
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
- GCS bucket prefix
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
- google_application_credentials: typing.Optional[str] = pydantic_v1.Field(default=None)
36
+ description: typing.Optional[str] = pydantic_v1.Field(default=None)
37
37
  """
38
- The content of GOOGLE_APPLICATION_CREDENTIALS json file
38
+ Storage description
39
39
  """
40
40
 
41
- google_project_id: typing.Optional[str] = pydantic_v1.Field(default=None)
41
+ project: typing.Optional[int] = pydantic_v1.Field(default=None)
42
42
  """
43
- Google project ID
43
+ Project ID
44
44
  """
45
45
 
46
- presign: typing.Optional[bool] = pydantic_v1.Field(default=None)
46
+ bucket: typing.Optional[str] = pydantic_v1.Field(default=None)
47
47
  """
48
- Presign URLs for direct download
48
+ GCS bucket name
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
+ GCS bucket prefix
54
+ """
55
+
56
+ google_application_credentials: typing.Optional[str] = pydantic_v1.Field(default=None)
57
+ """
58
+ The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
59
+ """
60
+
61
+ google_project_id: typing.Optional[str] = pydantic_v1.Field(default=None)
62
+ """
63
+ Google project ID
54
64
  """
55
65
 
56
66
  def json(self, **kwargs: typing.Any) -> str:
@@ -8,49 +8,59 @@ from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
8
 
9
9
 
10
10
  class GcsUpdateResponse(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
- bucket: typing.Optional[str] = pydantic_v1.Field(default=None)
16
+ use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
17
17
  """
18
- GCS bucket name
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
- GCS bucket prefix
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
- google_application_credentials: typing.Optional[str] = pydantic_v1.Field(default=None)
36
+ description: typing.Optional[str] = pydantic_v1.Field(default=None)
37
37
  """
38
- The content of GOOGLE_APPLICATION_CREDENTIALS json file
38
+ Storage description
39
39
  """
40
40
 
41
- google_project_id: typing.Optional[str] = pydantic_v1.Field(default=None)
41
+ project: typing.Optional[int] = pydantic_v1.Field(default=None)
42
42
  """
43
- Google project ID
43
+ Project ID
44
44
  """
45
45
 
46
- presign: typing.Optional[bool] = pydantic_v1.Field(default=None)
46
+ bucket: typing.Optional[str] = pydantic_v1.Field(default=None)
47
47
  """
48
- Presign URLs for direct download
48
+ GCS bucket name
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
+ GCS bucket prefix
54
+ """
55
+
56
+ google_application_credentials: typing.Optional[str] = pydantic_v1.Field(default=None)
57
+ """
58
+ The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
59
+ """
60
+
61
+ google_project_id: typing.Optional[str] = pydantic_v1.Field(default=None)
62
+ """
63
+ Google project ID
54
64
  """
55
65
 
56
66
  def json(self, **kwargs: typing.Any) -> str:
@@ -66,6 +66,8 @@ class LocalClient:
66
66
  def create(
67
67
  self,
68
68
  *,
69
+ title: typing.Optional[str] = OMIT,
70
+ description: typing.Optional[str] = OMIT,
69
71
  project: typing.Optional[int] = OMIT,
70
72
  path: typing.Optional[str] = OMIT,
71
73
  regex_filter: typing.Optional[str] = OMIT,
@@ -81,17 +83,23 @@ class LocalClient:
81
83
 
82
84
  Parameters
83
85
  ----------
86
+ title : typing.Optional[str]
87
+ Storage title
88
+
89
+ description : typing.Optional[str]
90
+ Storage description
91
+
84
92
  project : typing.Optional[int]
85
93
  Project ID
86
94
 
87
95
  path : typing.Optional[str]
88
- Local path
96
+ Path to local directory
89
97
 
90
98
  regex_filter : typing.Optional[str]
91
99
  Regex for filtering objects
92
100
 
93
101
  use_blob_urls : typing.Optional[bool]
94
- Interpret objects as BLOBs and generate URLs
102
+ 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.
95
103
 
96
104
  request_options : typing.Optional[RequestOptions]
97
105
  Request-specific configuration.
@@ -113,7 +121,14 @@ class LocalClient:
113
121
  _response = self._client_wrapper.httpx_client.request(
114
122
  "api/storages/localfiles/",
115
123
  method="POST",
116
- json={"project": project, "path": path, "regex_filter": regex_filter, "use_blob_urls": use_blob_urls},
124
+ json={
125
+ "title": title,
126
+ "description": description,
127
+ "project": project,
128
+ "path": path,
129
+ "regex_filter": regex_filter,
130
+ "use_blob_urls": use_blob_urls,
131
+ },
117
132
  request_options=request_options,
118
133
  omit=OMIT,
119
134
  )
@@ -125,19 +140,50 @@ class LocalClient:
125
140
  raise ApiError(status_code=_response.status_code, body=_response.text)
126
141
  raise ApiError(status_code=_response.status_code, body=_response_json)
127
142
 
128
- def validate(self, *, request_options: typing.Optional[RequestOptions] = None) -> LocalFilesImportStorage:
143
+ def validate(
144
+ self,
145
+ *,
146
+ id: typing.Optional[int] = OMIT,
147
+ title: typing.Optional[str] = OMIT,
148
+ description: typing.Optional[str] = OMIT,
149
+ project: typing.Optional[int] = OMIT,
150
+ path: typing.Optional[str] = OMIT,
151
+ regex_filter: typing.Optional[str] = OMIT,
152
+ use_blob_urls: typing.Optional[bool] = OMIT,
153
+ request_options: typing.Optional[RequestOptions] = None,
154
+ ) -> None:
129
155
  """
130
156
  Validate a specific local file import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.
131
157
 
132
158
  Parameters
133
159
  ----------
160
+ id : typing.Optional[int]
161
+ Storage ID. If set, storage with specified ID will be updated
162
+
163
+ title : typing.Optional[str]
164
+ Storage title
165
+
166
+ description : typing.Optional[str]
167
+ Storage description
168
+
169
+ project : typing.Optional[int]
170
+ Project ID
171
+
172
+ path : typing.Optional[str]
173
+ Path to local directory
174
+
175
+ regex_filter : typing.Optional[str]
176
+ Regex for filtering objects
177
+
178
+ use_blob_urls : typing.Optional[bool]
179
+ 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.
180
+
134
181
  request_options : typing.Optional[RequestOptions]
135
182
  Request-specific configuration.
136
183
 
137
184
  Returns
138
185
  -------
139
- LocalFilesImportStorage
140
-
186
+ None
141
187
 
142
188
  Examples
143
189
  --------
@@ -149,10 +195,22 @@ class LocalClient:
149
195
  client.import_storage.local.validate()
150
196
  """
151
197
  _response = self._client_wrapper.httpx_client.request(
152
- "api/storages/localfiles/validate", method="POST", request_options=request_options
198
+ "api/storages/localfiles/validate",
199
+ method="POST",
200
+ json={
201
+ "id": id,
202
+ "title": title,
203
+ "description": description,
204
+ "project": project,
205
+ "path": path,
206
+ "regex_filter": regex_filter,
207
+ "use_blob_urls": use_blob_urls,
208
+ },
209
+ request_options=request_options,
210
+ omit=OMIT,
153
211
  )
154
212
  if 200 <= _response.status_code < 300:
155
- return pydantic_v1.parse_obj_as(LocalFilesImportStorage, _response.json()) # type: ignore
213
+ return
156
214
  try:
157
215
  _response_json = _response.json()
158
216
  except JSONDecodeError:
@@ -246,6 +304,8 @@ class LocalClient:
246
304
  self,
247
305
  id: int,
248
306
  *,
307
+ title: typing.Optional[str] = OMIT,
308
+ description: typing.Optional[str] = OMIT,
249
309
  project: typing.Optional[int] = OMIT,
250
310
  path: typing.Optional[str] = OMIT,
251
311
  regex_filter: typing.Optional[str] = OMIT,
@@ -262,17 +322,23 @@ class LocalClient:
262
322
  id : int
263
323
  A unique integer value identifying this local files import storage.
264
324
 
325
+ title : typing.Optional[str]
326
+ Storage title
327
+
328
+ description : typing.Optional[str]
329
+ Storage description
330
+
265
331
  project : typing.Optional[int]
266
332
  Project ID
267
333
 
268
334
  path : typing.Optional[str]
269
- Local path
335
+ Path to local directory
270
336
 
271
337
  regex_filter : typing.Optional[str]
272
338
  Regex for filtering objects
273
339
 
274
340
  use_blob_urls : typing.Optional[bool]
275
- Interpret objects as BLOBs and generate URLs
341
+ 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.
276
342
 
277
343
  request_options : typing.Optional[RequestOptions]
278
344
  Request-specific configuration.
@@ -296,7 +362,14 @@ class LocalClient:
296
362
  _response = self._client_wrapper.httpx_client.request(
297
363
  f"api/storages/localfiles/{jsonable_encoder(id)}",
298
364
  method="PATCH",
299
- json={"project": project, "path": path, "regex_filter": regex_filter, "use_blob_urls": use_blob_urls},
365
+ json={
366
+ "title": title,
367
+ "description": description,
368
+ "project": project,
369
+ "path": path,
370
+ "regex_filter": regex_filter,
371
+ "use_blob_urls": use_blob_urls,
372
+ },
300
373
  request_options=request_options,
301
374
  omit=OMIT,
302
375
  )
@@ -402,6 +475,8 @@ class AsyncLocalClient:
402
475
  async def create(
403
476
  self,
404
477
  *,
478
+ title: typing.Optional[str] = OMIT,
479
+ description: typing.Optional[str] = OMIT,
405
480
  project: typing.Optional[int] = OMIT,
406
481
  path: typing.Optional[str] = OMIT,
407
482
  regex_filter: typing.Optional[str] = OMIT,
@@ -417,17 +492,23 @@ class AsyncLocalClient:
417
492
 
418
493
  Parameters
419
494
  ----------
495
+ title : typing.Optional[str]
496
+ Storage title
497
+
498
+ description : typing.Optional[str]
499
+ Storage description
500
+
420
501
  project : typing.Optional[int]
421
502
  Project ID
422
503
 
423
504
  path : typing.Optional[str]
424
- Local path
505
+ Path to local directory
425
506
 
426
507
  regex_filter : typing.Optional[str]
427
508
  Regex for filtering objects
428
509
 
429
510
  use_blob_urls : typing.Optional[bool]
430
- Interpret objects as BLOBs and generate URLs
511
+ 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.
431
512
 
432
513
  request_options : typing.Optional[RequestOptions]
433
514
  Request-specific configuration.
@@ -449,7 +530,14 @@ class AsyncLocalClient:
449
530
  _response = await self._client_wrapper.httpx_client.request(
450
531
  "api/storages/localfiles/",
451
532
  method="POST",
452
- json={"project": project, "path": path, "regex_filter": regex_filter, "use_blob_urls": use_blob_urls},
533
+ json={
534
+ "title": title,
535
+ "description": description,
536
+ "project": project,
537
+ "path": path,
538
+ "regex_filter": regex_filter,
539
+ "use_blob_urls": use_blob_urls,
540
+ },
453
541
  request_options=request_options,
454
542
  omit=OMIT,
455
543
  )
@@ -461,19 +549,50 @@ class AsyncLocalClient:
461
549
  raise ApiError(status_code=_response.status_code, body=_response.text)
462
550
  raise ApiError(status_code=_response.status_code, body=_response_json)
463
551
 
464
- async def validate(self, *, request_options: typing.Optional[RequestOptions] = None) -> LocalFilesImportStorage:
552
+ async def validate(
553
+ self,
554
+ *,
555
+ id: typing.Optional[int] = OMIT,
556
+ title: typing.Optional[str] = OMIT,
557
+ description: typing.Optional[str] = OMIT,
558
+ project: typing.Optional[int] = OMIT,
559
+ path: typing.Optional[str] = OMIT,
560
+ regex_filter: typing.Optional[str] = OMIT,
561
+ use_blob_urls: typing.Optional[bool] = OMIT,
562
+ request_options: typing.Optional[RequestOptions] = None,
563
+ ) -> None:
465
564
  """
466
565
  Validate a specific local file import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.
467
566
 
468
567
  Parameters
469
568
  ----------
569
+ id : typing.Optional[int]
570
+ Storage ID. If set, storage with specified ID will be updated
571
+
572
+ title : typing.Optional[str]
573
+ Storage title
574
+
575
+ description : typing.Optional[str]
576
+ Storage description
577
+
578
+ project : typing.Optional[int]
579
+ Project ID
580
+
581
+ path : typing.Optional[str]
582
+ Path to local directory
583
+
584
+ regex_filter : typing.Optional[str]
585
+ Regex for filtering objects
586
+
587
+ use_blob_urls : typing.Optional[bool]
588
+ 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.
589
+
470
590
  request_options : typing.Optional[RequestOptions]
471
591
  Request-specific configuration.
472
592
 
473
593
  Returns
474
594
  -------
475
- LocalFilesImportStorage
476
-
595
+ None
477
596
 
478
597
  Examples
479
598
  --------
@@ -485,10 +604,22 @@ class AsyncLocalClient:
485
604
  await client.import_storage.local.validate()
486
605
  """
487
606
  _response = await self._client_wrapper.httpx_client.request(
488
- "api/storages/localfiles/validate", method="POST", request_options=request_options
607
+ "api/storages/localfiles/validate",
608
+ method="POST",
609
+ json={
610
+ "id": id,
611
+ "title": title,
612
+ "description": description,
613
+ "project": project,
614
+ "path": path,
615
+ "regex_filter": regex_filter,
616
+ "use_blob_urls": use_blob_urls,
617
+ },
618
+ request_options=request_options,
619
+ omit=OMIT,
489
620
  )
490
621
  if 200 <= _response.status_code < 300:
491
- return pydantic_v1.parse_obj_as(LocalFilesImportStorage, _response.json()) # type: ignore
622
+ return
492
623
  try:
493
624
  _response_json = _response.json()
494
625
  except JSONDecodeError:
@@ -582,6 +713,8 @@ class AsyncLocalClient:
582
713
  self,
583
714
  id: int,
584
715
  *,
716
+ title: typing.Optional[str] = OMIT,
717
+ description: typing.Optional[str] = OMIT,
585
718
  project: typing.Optional[int] = OMIT,
586
719
  path: typing.Optional[str] = OMIT,
587
720
  regex_filter: typing.Optional[str] = OMIT,
@@ -598,17 +731,23 @@ class AsyncLocalClient:
598
731
  id : int
599
732
  A unique integer value identifying this local files import storage.
600
733
 
734
+ title : typing.Optional[str]
735
+ Storage title
736
+
737
+ description : typing.Optional[str]
738
+ Storage description
739
+
601
740
  project : typing.Optional[int]
602
741
  Project ID
603
742
 
604
743
  path : typing.Optional[str]
605
- Local path
744
+ Path to local directory
606
745
 
607
746
  regex_filter : typing.Optional[str]
608
747
  Regex for filtering objects
609
748
 
610
749
  use_blob_urls : typing.Optional[bool]
611
- Interpret objects as BLOBs and generate URLs
750
+ 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.
612
751
 
613
752
  request_options : typing.Optional[RequestOptions]
614
753
  Request-specific configuration.
@@ -632,7 +771,14 @@ class AsyncLocalClient:
632
771
  _response = await self._client_wrapper.httpx_client.request(
633
772
  f"api/storages/localfiles/{jsonable_encoder(id)}",
634
773
  method="PATCH",
635
- json={"project": project, "path": path, "regex_filter": regex_filter, "use_blob_urls": use_blob_urls},
774
+ json={
775
+ "title": title,
776
+ "description": description,
777
+ "project": project,
778
+ "path": path,
779
+ "regex_filter": regex_filter,
780
+ "use_blob_urls": use_blob_urls,
781
+ },
636
782
  request_options=request_options,
637
783
  omit=OMIT,
638
784
  )
@@ -8,6 +8,16 @@ from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
8
 
9
9
 
10
10
  class LocalCreateResponse(pydantic_v1.BaseModel):
11
+ title: typing.Optional[str] = pydantic_v1.Field(default=None)
12
+ """
13
+ Storage title
14
+ """
15
+
16
+ description: typing.Optional[str] = pydantic_v1.Field(default=None)
17
+ """
18
+ Storage description
19
+ """
20
+
11
21
  project: typing.Optional[int] = pydantic_v1.Field(default=None)
12
22
  """
13
23
  Project ID
@@ -15,7 +25,7 @@ class LocalCreateResponse(pydantic_v1.BaseModel):
15
25
 
16
26
  path: typing.Optional[str] = pydantic_v1.Field(default=None)
17
27
  """
18
- Local path
28
+ Path to local directory
19
29
  """
20
30
 
21
31
  regex_filter: typing.Optional[str] = pydantic_v1.Field(default=None)
@@ -25,7 +35,7 @@ class LocalCreateResponse(pydantic_v1.BaseModel):
25
35
 
26
36
  use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
27
37
  """
28
- Interpret objects as BLOBs and generate URLs
38
+ 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.
29
39
  """
30
40
 
31
41
  def json(self, **kwargs: typing.Any) -> str:
@@ -8,6 +8,16 @@ from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
8
 
9
9
 
10
10
  class LocalUpdateResponse(pydantic_v1.BaseModel):
11
+ title: typing.Optional[str] = pydantic_v1.Field(default=None)
12
+ """
13
+ Storage title
14
+ """
15
+
16
+ description: typing.Optional[str] = pydantic_v1.Field(default=None)
17
+ """
18
+ Storage description
19
+ """
20
+
11
21
  project: typing.Optional[int] = pydantic_v1.Field(default=None)
12
22
  """
13
23
  Project ID
@@ -15,7 +25,7 @@ class LocalUpdateResponse(pydantic_v1.BaseModel):
15
25
 
16
26
  path: typing.Optional[str] = pydantic_v1.Field(default=None)
17
27
  """
18
- Local path
28
+ Path to local directory
19
29
  """
20
30
 
21
31
  regex_filter: typing.Optional[str] = pydantic_v1.Field(default=None)
@@ -25,7 +35,7 @@ class LocalUpdateResponse(pydantic_v1.BaseModel):
25
35
 
26
36
  use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
27
37
  """
28
- Interpret objects as BLOBs and generate URLs
38
+ 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.
29
39
  """
30
40
 
31
41
  def json(self, **kwargs: typing.Any) -> str: