label-studio-sdk 1.0.20__py3-none-any.whl → 2.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of label-studio-sdk might be problematic. Click here for more details.

Files changed (421) hide show
  1. label_studio_sdk/__init__.py +345 -180
  2. label_studio_sdk/actions/__init__.py +4 -0
  3. label_studio_sdk/actions/client.py +46 -10
  4. label_studio_sdk/actions/types/__init__.py +4 -0
  5. label_studio_sdk/actions/types/actions_create_request_filters.py +2 -2
  6. label_studio_sdk/actions/types/actions_create_request_filters_items_item.py +2 -2
  7. label_studio_sdk/actions/types/actions_create_request_id.py +7 -7
  8. label_studio_sdk/actions/types/actions_create_request_selected_items_excluded.py +2 -2
  9. label_studio_sdk/actions/types/actions_create_request_selected_items_included.py +2 -2
  10. label_studio_sdk/actions/types/actions_list_response_item.py +25 -0
  11. label_studio_sdk/actions/types/actions_list_response_item_dialog.py +22 -0
  12. label_studio_sdk/annotations/__init__.py +2 -2
  13. label_studio_sdk/annotations/client.py +379 -243
  14. label_studio_sdk/annotations/types/__init__.py +4 -2
  15. label_studio_sdk/annotations/types/annotation_bulk_serializer_with_selected_items_request_last_action.py +7 -0
  16. label_studio_sdk/annotations/types/annotations_create_bulk_response_item.py +8 -5
  17. label_studio_sdk/base_client.py +32 -24
  18. label_studio_sdk/billing/__init__.py +2 -0
  19. label_studio_sdk/billing/client.py +112 -0
  20. label_studio_sdk/comments/client.py +378 -140
  21. label_studio_sdk/converter/README.md +207 -0
  22. label_studio_sdk/converter/imports/coco.py +132 -23
  23. label_studio_sdk/core/__init__.py +4 -0
  24. label_studio_sdk/core/unchecked_base_model.py +305 -0
  25. label_studio_sdk/environment.py +1 -1
  26. label_studio_sdk/errors/__init__.py +10 -1
  27. label_studio_sdk/errors/forbidden_error.py +9 -0
  28. label_studio_sdk/errors/method_not_allowed_error.py +9 -0
  29. label_studio_sdk/export_storage/__init__.py +1 -24
  30. label_studio_sdk/export_storage/azure/__init__.py +0 -3
  31. label_studio_sdk/export_storage/azure/client.py +231 -273
  32. label_studio_sdk/export_storage/client.py +5 -5
  33. label_studio_sdk/export_storage/gcs/__init__.py +0 -3
  34. label_studio_sdk/export_storage/gcs/client.py +231 -273
  35. label_studio_sdk/export_storage/local/__init__.py +0 -3
  36. label_studio_sdk/export_storage/local/client.py +211 -253
  37. label_studio_sdk/export_storage/redis/__init__.py +0 -3
  38. label_studio_sdk/export_storage/redis/client.py +239 -281
  39. label_studio_sdk/export_storage/s3/__init__.py +0 -3
  40. label_studio_sdk/export_storage/s3/client.py +254 -296
  41. label_studio_sdk/export_storage/s3s/client.py +694 -210
  42. label_studio_sdk/export_storage/types/export_storage_list_types_response_item.py +2 -2
  43. label_studio_sdk/files/client.py +52 -71
  44. label_studio_sdk/import_storage/__init__.py +1 -24
  45. label_studio_sdk/import_storage/azure/__init__.py +0 -3
  46. label_studio_sdk/import_storage/azure/client.py +249 -299
  47. label_studio_sdk/import_storage/client.py +5 -5
  48. label_studio_sdk/import_storage/gcs/__init__.py +0 -3
  49. label_studio_sdk/import_storage/gcs/client.py +249 -299
  50. label_studio_sdk/import_storage/local/__init__.py +0 -3
  51. label_studio_sdk/import_storage/local/client.py +211 -257
  52. label_studio_sdk/import_storage/redis/__init__.py +0 -3
  53. label_studio_sdk/import_storage/redis/client.py +239 -285
  54. label_studio_sdk/import_storage/s3/__init__.py +0 -3
  55. label_studio_sdk/import_storage/s3/client.py +274 -324
  56. label_studio_sdk/import_storage/s3s/client.py +728 -434
  57. label_studio_sdk/import_storage/types/import_storage_list_types_response_item.py +2 -2
  58. label_studio_sdk/jwt_settings/client.py +56 -58
  59. label_studio_sdk/label_interface/control_tags.py +48 -8
  60. label_studio_sdk/label_interface/interface.py +261 -56
  61. label_studio_sdk/ml/__init__.py +2 -16
  62. label_studio_sdk/ml/client.py +196 -179
  63. label_studio_sdk/ml/types/__init__.py +2 -12
  64. label_studio_sdk/ml/types/ml_list_model_versions_response.py +20 -0
  65. label_studio_sdk/model_providers/__init__.py +3 -0
  66. label_studio_sdk/model_providers/client.py +280 -228
  67. label_studio_sdk/model_providers/types/__init__.py +5 -0
  68. label_studio_sdk/{prompts/types/prompts_batch_predictions_response.py → model_providers/types/model_providers_list_model_provider_choices_response.py} +3 -3
  69. label_studio_sdk/organizations/__init__.py +5 -0
  70. label_studio_sdk/organizations/client.py +331 -0
  71. label_studio_sdk/organizations/members/__init__.py +2 -0
  72. label_studio_sdk/organizations/members/client.py +636 -0
  73. label_studio_sdk/predictions/client.py +29 -77
  74. label_studio_sdk/projects/__init__.py +18 -9
  75. label_studio_sdk/projects/client.py +905 -414
  76. label_studio_sdk/projects/exports/__init__.py +2 -2
  77. label_studio_sdk/projects/exports/client.py +336 -396
  78. label_studio_sdk/projects/exports/client_ext.py +30 -30
  79. label_studio_sdk/projects/exports/types/__init__.py +1 -2
  80. label_studio_sdk/projects/exports/types/exports_convert_response.py +5 -9
  81. label_studio_sdk/projects/pauses/client.py +114 -105
  82. label_studio_sdk/projects/stats/__init__.py +5 -0
  83. label_studio_sdk/projects/stats/client.py +175 -0
  84. label_studio_sdk/projects/stats/types/__init__.py +8 -0
  85. label_studio_sdk/projects/stats/types/stats_iaa_response.py +44 -0
  86. label_studio_sdk/projects/stats/types/stats_iaa_response_common_tasks.py +7 -0
  87. label_studio_sdk/projects/stats/types/stats_iaa_response_iaa.py +5 -0
  88. label_studio_sdk/{types/base_task_file_upload.py → projects/stats/types/stats_iaa_response_std.py} +1 -1
  89. label_studio_sdk/projects/types/__init__.py +10 -6
  90. label_studio_sdk/projects/types/lse_project_create_request_sampling.py +7 -0
  91. label_studio_sdk/projects/types/lse_project_create_request_skip_queue.py +7 -0
  92. label_studio_sdk/projects/types/patched_lse_project_update_request_sampling.py +7 -0
  93. label_studio_sdk/projects/types/patched_lse_project_update_request_skip_queue.py +7 -0
  94. label_studio_sdk/{prompts/types/prompts_batch_failed_predictions_response.py → projects/types/projects_duplicate_response.py} +8 -5
  95. label_studio_sdk/projects/types/projects_import_tasks_response.py +2 -2
  96. label_studio_sdk/projects/types/projects_list_request_filter.py +1 -1
  97. label_studio_sdk/prompts/__init__.py +4 -10
  98. label_studio_sdk/prompts/client.py +511 -442
  99. label_studio_sdk/prompts/indicators/__init__.py +3 -0
  100. label_studio_sdk/prompts/indicators/client.py +47 -49
  101. label_studio_sdk/prompts/indicators/types/__init__.py +5 -0
  102. label_studio_sdk/{types/key_indicator_value.py → prompts/indicators/types/indicators_list_response_item.py} +3 -3
  103. label_studio_sdk/prompts/runs/client.py +113 -135
  104. label_studio_sdk/prompts/types/__init__.py +2 -12
  105. label_studio_sdk/prompts/types/prompts_compatible_projects_request_project_type.py +7 -0
  106. label_studio_sdk/prompts/versions/client.py +372 -312
  107. label_studio_sdk/tasks/__init__.py +2 -2
  108. label_studio_sdk/tasks/client.py +514 -213
  109. label_studio_sdk/tasks/types/__init__.py +1 -2
  110. label_studio_sdk/tokens/client.py +160 -152
  111. label_studio_sdk/tokens/client_ext.py +3 -3
  112. label_studio_sdk/types/__init__.py +276 -142
  113. label_studio_sdk/{webhooks/types/webhooks_update_request_actions_item.py → types/actions_enum.py} +4 -1
  114. label_studio_sdk/types/all_roles_project_list.py +197 -0
  115. label_studio_sdk/types/all_roles_project_list_sampling.py +7 -0
  116. label_studio_sdk/types/all_roles_project_list_skip_queue.py +7 -0
  117. label_studio_sdk/types/annotated_enum.py +5 -0
  118. label_studio_sdk/types/annotation.py +24 -10
  119. label_studio_sdk/types/annotation_last_action.py +3 -15
  120. label_studio_sdk/types/{annotations_dm_field.py → annotation_request.py} +21 -30
  121. label_studio_sdk/types/annotation_request_last_action.py +7 -0
  122. label_studio_sdk/types/assignment_settings.py +31 -0
  123. label_studio_sdk/types/assignment_settings_label_stream_task_distribution.py +7 -0
  124. label_studio_sdk/types/assignment_settings_request.py +32 -0
  125. label_studio_sdk/types/assignment_settings_request_label_stream_task_distribution.py +7 -0
  126. label_studio_sdk/types/associated_project.py +30 -0
  127. label_studio_sdk/types/auth_method_enum.py +5 -0
  128. label_studio_sdk/types/azure_blob_export_storage.py +8 -12
  129. label_studio_sdk/types/azure_blob_import_storage.py +8 -12
  130. label_studio_sdk/types/{prompt_associated_projects_item_id.py → batch_failed_predictions.py} +4 -4
  131. label_studio_sdk/types/{access_token_response.py → batch_predictions.py} +6 -8
  132. label_studio_sdk/types/billing_checks.py +39 -0
  133. label_studio_sdk/types/billing_flags.py +44 -0
  134. label_studio_sdk/types/billing_info_response.py +22 -0
  135. label_studio_sdk/types/blank_enum.py +5 -0
  136. label_studio_sdk/types/{key_indicators_item_extra_kpis_item.py → blueprint_list.py} +12 -6
  137. label_studio_sdk/types/budget_reset_period_enum.py +5 -0
  138. label_studio_sdk/types/child_filter.py +44 -0
  139. label_studio_sdk/types/comment.py +39 -14
  140. label_studio_sdk/types/comment_request.py +32 -0
  141. label_studio_sdk/types/comment_serializer_with_expanded_user.py +53 -0
  142. label_studio_sdk/types/converted_format.py +5 -5
  143. label_studio_sdk/types/{api_token_response.py → converted_format_request.py} +8 -15
  144. label_studio_sdk/types/count_limit.py +22 -0
  145. label_studio_sdk/types/custom_scripts_editable_by_enum.py +5 -0
  146. label_studio_sdk/types/default_role_enum.py +5 -0
  147. label_studio_sdk/types/edition_enum.py +5 -0
  148. label_studio_sdk/types/export.py +7 -7
  149. label_studio_sdk/types/file_upload.py +5 -5
  150. label_studio_sdk/types/filter.py +9 -6
  151. label_studio_sdk/types/filter_group.py +3 -3
  152. label_studio_sdk/types/finished_enum.py +5 -0
  153. label_studio_sdk/types/gcs_export_storage.py +8 -12
  154. label_studio_sdk/types/gcs_import_storage.py +8 -12
  155. label_studio_sdk/types/{rotate_token_response.py → hotkeys.py} +5 -8
  156. label_studio_sdk/types/{base_task.py → import_api_request.py} +11 -34
  157. label_studio_sdk/types/inference_run_cost_estimate.py +2 -2
  158. label_studio_sdk/types/label_stream_task_distribution_enum.py +5 -0
  159. label_studio_sdk/types/{annotations_dm_field_last_action.py → last_action_enum.py} +1 -1
  160. label_studio_sdk/types/local_files_export_storage.py +8 -12
  161. label_studio_sdk/types/local_files_import_storage.py +8 -12
  162. label_studio_sdk/types/{annotation_filter_options.py → lse_annotation_filter_options.py} +12 -2
  163. label_studio_sdk/types/lse_annotation_filter_options_request.py +42 -0
  164. label_studio_sdk/types/lse_annotation_filter_options_request_reviewed.py +7 -0
  165. label_studio_sdk/types/lse_annotation_filter_options_reviewed.py +7 -0
  166. label_studio_sdk/types/{export_snapshot.py → lse_export_create.py} +11 -11
  167. label_studio_sdk/types/lse_fields.py +49 -0
  168. label_studio_sdk/types/lse_fields_onboarding_state.py +8 -0
  169. label_studio_sdk/types/lse_fields_trial_role.py +8 -0
  170. label_studio_sdk/types/lse_key_indicator_value.py +35 -0
  171. label_studio_sdk/types/lse_organization.py +57 -0
  172. label_studio_sdk/types/lse_organization_custom_scripts_editable_by.py +7 -0
  173. label_studio_sdk/types/{key_indicators_item_additional_kpis_item.py → lse_organization_member_list.py} +12 -7
  174. label_studio_sdk/types/lse_project_create.py +196 -0
  175. label_studio_sdk/types/lse_project_create_sampling.py +7 -0
  176. label_studio_sdk/types/lse_project_create_skip_queue.py +7 -0
  177. label_studio_sdk/types/lse_project_update.py +215 -0
  178. label_studio_sdk/types/lse_project_update_sampling.py +7 -0
  179. label_studio_sdk/types/lse_project_update_skip_queue.py +7 -0
  180. label_studio_sdk/types/lse_s3export_storage.py +134 -0
  181. label_studio_sdk/{import_storage/s3/types/s3create_response.py → types/lse_s3export_storage_request.py} +47 -21
  182. label_studio_sdk/{import_storage/s3/types/s3update_response.py → types/lse_s3import_storage.py} +60 -21
  183. label_studio_sdk/types/{s3s_import_storage.py → lse_s3import_storage_request.py} +32 -21
  184. label_studio_sdk/types/lse_task.py +117 -0
  185. label_studio_sdk/types/{data_manager_task_serializer_drafts_item.py → lse_task_drafts_item.py} +2 -2
  186. label_studio_sdk/types/lse_task_filter_options.py +63 -0
  187. label_studio_sdk/types/lse_task_filter_options_annotated.py +7 -0
  188. label_studio_sdk/types/lse_task_filter_options_finished.py +7 -0
  189. label_studio_sdk/types/lse_task_filter_options_request.py +63 -0
  190. label_studio_sdk/types/lse_task_filter_options_request_annotated.py +7 -0
  191. label_studio_sdk/types/lse_task_filter_options_request_finished.py +7 -0
  192. label_studio_sdk/types/lse_task_filter_options_request_reviewed.py +7 -0
  193. label_studio_sdk/types/lse_task_filter_options_request_skipped.py +7 -0
  194. label_studio_sdk/types/lse_task_filter_options_reviewed.py +7 -0
  195. label_studio_sdk/types/lse_task_filter_options_skipped.py +7 -0
  196. label_studio_sdk/types/{data_manager_task_serializer_predictions_item.py → lse_task_predictions_item.py} +4 -5
  197. label_studio_sdk/types/lse_task_serializer_for_annotators.py +54 -0
  198. label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +22 -0
  199. label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +28 -0
  200. label_studio_sdk/types/lse_task_serializer_for_reviewers.py +117 -0
  201. label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +22 -0
  202. label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +28 -0
  203. label_studio_sdk/types/lse_user.py +49 -0
  204. label_studio_sdk/types/{base_user.py → lse_user_api.py} +17 -6
  205. label_studio_sdk/types/lse_user_organization_member_list.py +48 -0
  206. label_studio_sdk/types/lseapi_token_create.py +21 -0
  207. label_studio_sdk/types/lseapi_token_list.py +21 -0
  208. label_studio_sdk/types/lsejwt_settings.py +32 -0
  209. label_studio_sdk/types/maybe_expanded_comment.py +7 -0
  210. label_studio_sdk/types/ml_backend.py +16 -17
  211. label_studio_sdk/types/mode_enum.py +5 -0
  212. label_studio_sdk/types/model_interface.py +44 -0
  213. label_studio_sdk/types/model_interface_request.py +40 -0
  214. label_studio_sdk/types/model_interface_serializer_get.py +45 -0
  215. label_studio_sdk/types/model_provider_connection.py +48 -17
  216. label_studio_sdk/types/model_provider_connection_budget_reset_period.py +3 -1
  217. label_studio_sdk/types/model_provider_connection_request.py +71 -0
  218. label_studio_sdk/types/model_run.py +40 -0
  219. label_studio_sdk/types/{inference_run_status.py → model_run_status_enum.py} +1 -1
  220. label_studio_sdk/types/null_enum.py +3 -0
  221. label_studio_sdk/types/onboarding_state_enum.py +7 -0
  222. label_studio_sdk/types/organization_billing.py +20 -0
  223. label_studio_sdk/types/organization_id.py +28 -0
  224. label_studio_sdk/types/organization_invite.py +20 -0
  225. label_studio_sdk/types/organization_member.py +37 -0
  226. label_studio_sdk/types/organization_membership.py +24 -0
  227. label_studio_sdk/{projects/types/projects_list_response.py → types/paginated_all_roles_project_list_list.py} +5 -5
  228. label_studio_sdk/types/paginated_lse_organization_member_list_list.py +23 -0
  229. label_studio_sdk/types/{jwt_settings_response.py → paginated_role_based_task_list.py} +11 -9
  230. label_studio_sdk/types/pause.py +55 -14
  231. label_studio_sdk/types/pause_request.py +41 -0
  232. label_studio_sdk/types/prediction.py +7 -11
  233. label_studio_sdk/types/prediction_request.py +56 -0
  234. label_studio_sdk/types/project.py +32 -39
  235. label_studio_sdk/types/project_import.py +12 -13
  236. label_studio_sdk/types/project_label_config.py +2 -2
  237. label_studio_sdk/types/project_label_config_request.py +22 -0
  238. label_studio_sdk/types/project_sampling.py +3 -3
  239. label_studio_sdk/types/project_skip_queue.py +3 -1
  240. label_studio_sdk/types/project_subset_enum.py +5 -0
  241. label_studio_sdk/types/prompts_status_enum.py +16 -0
  242. label_studio_sdk/types/{prompt_version_provider.py → provider_enum.py} +1 -1
  243. label_studio_sdk/types/reason_enum.py +7 -0
  244. label_studio_sdk/types/redis_export_storage.py +8 -12
  245. label_studio_sdk/types/redis_import_storage.py +8 -12
  246. label_studio_sdk/types/refined_prompt_response.py +5 -6
  247. label_studio_sdk/types/requeue_rejected_tasks_mode_enum.py +5 -0
  248. label_studio_sdk/types/review_criteria_enum.py +5 -0
  249. label_studio_sdk/types/review_settings.py +80 -0
  250. label_studio_sdk/types/review_settings_request.py +80 -0
  251. label_studio_sdk/types/review_settings_request_requeue_rejected_tasks_mode.py +8 -0
  252. label_studio_sdk/types/review_settings_request_review_criteria.py +7 -0
  253. label_studio_sdk/types/review_settings_requeue_rejected_tasks_mode.py +8 -0
  254. label_studio_sdk/types/review_settings_review_criteria.py +7 -0
  255. label_studio_sdk/types/reviewed_enum.py +5 -0
  256. label_studio_sdk/types/role9e7enum.py +5 -0
  257. label_studio_sdk/types/role_based_task.py +8 -0
  258. label_studio_sdk/types/s3export_storage.py +8 -12
  259. label_studio_sdk/types/s3import_storage.py +8 -12
  260. label_studio_sdk/types/sampling_enum.py +7 -0
  261. label_studio_sdk/types/scope_enum.py +5 -0
  262. label_studio_sdk/types/selected_items_request.py +23 -0
  263. label_studio_sdk/types/serialization_option.py +2 -6
  264. label_studio_sdk/types/serialization_option_request.py +22 -0
  265. label_studio_sdk/types/serialization_options.py +17 -5
  266. label_studio_sdk/types/serialization_options_request.py +47 -0
  267. label_studio_sdk/types/skill_name_enum.py +5 -0
  268. label_studio_sdk/types/skip_queue_enum.py +5 -0
  269. label_studio_sdk/types/skipped_enum.py +5 -0
  270. label_studio_sdk/types/state_enum.py +5 -0
  271. label_studio_sdk/types/status7bf_enum.py +5 -0
  272. label_studio_sdk/types/{azure_blob_import_storage_status.py → status_c5a_enum.py} +2 -2
  273. label_studio_sdk/types/third_party_model_version.py +65 -0
  274. label_studio_sdk/types/third_party_model_version_request.py +54 -0
  275. label_studio_sdk/types/token_refresh_response.py +19 -0
  276. label_studio_sdk/types/token_rotate_response.py +19 -0
  277. label_studio_sdk/types/trial_role_enum.py +16 -0
  278. label_studio_sdk/types/user_simple.py +8 -5
  279. label_studio_sdk/types/user_simple_request.py +28 -0
  280. label_studio_sdk/types/version_response.py +49 -0
  281. label_studio_sdk/types/view.py +8 -15
  282. label_studio_sdk/types/webhook.py +9 -13
  283. label_studio_sdk/types/webhook_serializer_for_update.py +15 -13
  284. label_studio_sdk/types/workspace.py +14 -34
  285. label_studio_sdk/types/workspace_member_create.py +27 -0
  286. label_studio_sdk/types/workspace_member_list.py +24 -0
  287. label_studio_sdk/users/client.py +604 -87
  288. label_studio_sdk/users/types/users_get_token_response.py +4 -11
  289. label_studio_sdk/users/types/users_reset_token_response.py +4 -11
  290. label_studio_sdk/versions/__init__.py +0 -3
  291. label_studio_sdk/versions/client.py +14 -14
  292. label_studio_sdk/views/client.py +227 -141
  293. label_studio_sdk/views/types/views_create_request_data.py +2 -2
  294. label_studio_sdk/views/types/views_create_request_data_filters.py +2 -2
  295. label_studio_sdk/views/types/views_create_request_data_filters_items_item.py +2 -2
  296. label_studio_sdk/views/types/views_update_request_data.py +2 -2
  297. label_studio_sdk/views/types/views_update_request_data_filters.py +2 -2
  298. label_studio_sdk/views/types/views_update_request_data_filters_items_item.py +2 -2
  299. label_studio_sdk/webhooks/__init__.py +36 -2
  300. label_studio_sdk/webhooks/client.py +173 -367
  301. label_studio_sdk/webhooks/types/__init__.py +34 -2
  302. label_studio_sdk/webhooks/types/webhooks_info_response.py +80 -0
  303. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +24 -0
  304. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +24 -0
  305. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +24 -0
  306. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +24 -0
  307. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +24 -0
  308. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +24 -0
  309. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +24 -0
  310. label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +24 -0
  311. label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +24 -0
  312. label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +24 -0
  313. label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +24 -0
  314. label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +24 -0
  315. label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +24 -0
  316. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +24 -0
  317. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +24 -0
  318. label_studio_sdk/workspaces/__init__.py +1 -2
  319. label_studio_sdk/workspaces/client.py +97 -117
  320. label_studio_sdk/workspaces/members/__init__.py +0 -3
  321. label_studio_sdk/workspaces/members/client.py +65 -81
  322. {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.1.dist-info}/METADATA +73 -25
  323. label_studio_sdk-2.0.1.dist-info/RECORD +435 -0
  324. {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.1.dist-info}/WHEEL +1 -1
  325. label_studio_sdk/annotations/types/annotations_create_bulk_request_selected_items.py +0 -34
  326. label_studio_sdk/export_storage/azure/types/__init__.py +0 -6
  327. label_studio_sdk/export_storage/azure/types/azure_create_response.py +0 -57
  328. label_studio_sdk/export_storage/azure/types/azure_update_response.py +0 -57
  329. label_studio_sdk/export_storage/gcs/types/__init__.py +0 -6
  330. label_studio_sdk/export_storage/gcs/types/gcs_create_response.py +0 -57
  331. label_studio_sdk/export_storage/gcs/types/gcs_update_response.py +0 -57
  332. label_studio_sdk/export_storage/local/types/__init__.py +0 -6
  333. label_studio_sdk/export_storage/local/types/local_create_response.py +0 -47
  334. label_studio_sdk/export_storage/local/types/local_update_response.py +0 -47
  335. label_studio_sdk/export_storage/redis/types/__init__.py +0 -6
  336. label_studio_sdk/export_storage/redis/types/redis_create_response.py +0 -62
  337. label_studio_sdk/export_storage/redis/types/redis_update_response.py +0 -62
  338. label_studio_sdk/export_storage/s3/types/__init__.py +0 -6
  339. label_studio_sdk/export_storage/s3/types/s3create_response.py +0 -81
  340. label_studio_sdk/export_storage/s3/types/s3update_response.py +0 -81
  341. label_studio_sdk/import_storage/azure/types/__init__.py +0 -6
  342. label_studio_sdk/import_storage/azure/types/azure_create_response.py +0 -72
  343. label_studio_sdk/import_storage/azure/types/azure_update_response.py +0 -72
  344. label_studio_sdk/import_storage/gcs/types/__init__.py +0 -6
  345. label_studio_sdk/import_storage/gcs/types/gcs_create_response.py +0 -72
  346. label_studio_sdk/import_storage/gcs/types/gcs_update_response.py +0 -72
  347. label_studio_sdk/import_storage/local/types/__init__.py +0 -6
  348. label_studio_sdk/import_storage/local/types/local_create_response.py +0 -47
  349. label_studio_sdk/import_storage/local/types/local_update_response.py +0 -47
  350. label_studio_sdk/import_storage/redis/types/__init__.py +0 -6
  351. label_studio_sdk/import_storage/redis/types/redis_create_response.py +0 -62
  352. label_studio_sdk/import_storage/redis/types/redis_update_response.py +0 -62
  353. label_studio_sdk/import_storage/s3/types/__init__.py +0 -6
  354. label_studio_sdk/ml/types/ml_create_response.py +0 -68
  355. label_studio_sdk/ml/types/ml_create_response_auth_method.py +0 -5
  356. label_studio_sdk/ml/types/ml_update_response.py +0 -68
  357. label_studio_sdk/ml/types/ml_update_response_auth_method.py +0 -5
  358. label_studio_sdk/projects/exports/types/exports_list_formats_response_item.py +0 -44
  359. label_studio_sdk/projects/types/projects_create_response.py +0 -91
  360. label_studio_sdk/projects/types/projects_update_response.py +0 -96
  361. label_studio_sdk/prompts/types/prompts_batch_failed_predictions_request_failed_predictions_item.py +0 -32
  362. label_studio_sdk/prompts/types/prompts_batch_predictions_request_results_item.py +0 -59
  363. label_studio_sdk/tasks/types/tasks_list_response.py +0 -38
  364. label_studio_sdk/types/annotation_completed_by.py +0 -6
  365. label_studio_sdk/types/azure_blob_export_storage_status.py +0 -7
  366. label_studio_sdk/types/base_task_updated_by.py +0 -7
  367. label_studio_sdk/types/comment_created_by.py +0 -5
  368. label_studio_sdk/types/converted_format_status.py +0 -5
  369. label_studio_sdk/types/data_manager_task_serializer.py +0 -118
  370. label_studio_sdk/types/data_manager_task_serializer_annotators_item.py +0 -5
  371. label_studio_sdk/types/data_manager_task_serializer_comment_authors_item.py +0 -5
  372. label_studio_sdk/types/data_manager_task_serializer_predictions_item_model_run.py +0 -5
  373. label_studio_sdk/types/export_format.py +0 -25
  374. label_studio_sdk/types/export_snapshot_status.py +0 -5
  375. label_studio_sdk/types/export_status.py +0 -5
  376. label_studio_sdk/types/gcs_export_storage_status.py +0 -7
  377. label_studio_sdk/types/gcs_import_storage_status.py +0 -7
  378. label_studio_sdk/types/inference_run.py +0 -34
  379. label_studio_sdk/types/inference_run_created_by.py +0 -5
  380. label_studio_sdk/types/inference_run_organization.py +0 -5
  381. label_studio_sdk/types/inference_run_project_subset.py +0 -5
  382. label_studio_sdk/types/key_indicators.py +0 -6
  383. label_studio_sdk/types/key_indicators_item.py +0 -41
  384. label_studio_sdk/types/local_files_export_storage_status.py +0 -7
  385. label_studio_sdk/types/local_files_import_storage_status.py +0 -7
  386. label_studio_sdk/types/ml_backend_auth_method.py +0 -5
  387. label_studio_sdk/types/ml_backend_state.py +0 -5
  388. label_studio_sdk/types/model_provider_connection_created_by.py +0 -5
  389. label_studio_sdk/types/model_provider_connection_organization.py +0 -5
  390. label_studio_sdk/types/model_provider_connection_provider.py +0 -7
  391. label_studio_sdk/types/model_provider_connection_scope.py +0 -5
  392. label_studio_sdk/types/pause_paused_by.py +0 -5
  393. label_studio_sdk/types/project_import_status.py +0 -5
  394. label_studio_sdk/types/prompt.py +0 -71
  395. label_studio_sdk/types/prompt_associated_projects_item.py +0 -6
  396. label_studio_sdk/types/prompt_created_by.py +0 -5
  397. label_studio_sdk/types/prompt_organization.py +0 -5
  398. label_studio_sdk/types/prompt_version.py +0 -32
  399. label_studio_sdk/types/prompt_version_created_by.py +0 -5
  400. label_studio_sdk/types/prompt_version_organization.py +0 -5
  401. label_studio_sdk/types/redis_export_storage_status.py +0 -7
  402. label_studio_sdk/types/redis_import_storage_status.py +0 -7
  403. label_studio_sdk/types/refined_prompt_response_refinement_status.py +0 -7
  404. label_studio_sdk/types/s3export_storage_status.py +0 -7
  405. label_studio_sdk/types/s3import_storage_status.py +0 -7
  406. label_studio_sdk/types/s3s_export_storage.py +0 -73
  407. label_studio_sdk/types/s3s_import_storage_status.py +0 -7
  408. label_studio_sdk/types/task.py +0 -156
  409. label_studio_sdk/types/task_annotators_item.py +0 -5
  410. label_studio_sdk/types/task_comment_authors_item.py +0 -5
  411. label_studio_sdk/types/task_filter_options.py +0 -39
  412. label_studio_sdk/types/webhook_actions_item.py +0 -21
  413. label_studio_sdk/types/webhook_serializer_for_update_actions_item.py +0 -21
  414. label_studio_sdk/versions/types/__init__.py +0 -6
  415. label_studio_sdk/versions/types/versions_get_response.py +0 -73
  416. label_studio_sdk/versions/types/versions_get_response_edition.py +0 -5
  417. label_studio_sdk/workspaces/members/types/__init__.py +0 -6
  418. label_studio_sdk/workspaces/members/types/members_create_response.py +0 -22
  419. label_studio_sdk/workspaces/members/types/members_list_response_item.py +0 -22
  420. label_studio_sdk-1.0.20.dist-info/RECORD +0 -374
  421. {label_studio_sdk-1.0.20.dist-info → label_studio_sdk-2.0.1.dist-info}/LICENSE +0 -0
@@ -4,12 +4,10 @@ import typing
4
4
  from ...core.client_wrapper import SyncClientWrapper
5
5
  from ...core.request_options import RequestOptions
6
6
  from ...types.gcs_export_storage import GcsExportStorage
7
- from ...core.pydantic_utilities import parse_obj_as
7
+ from ...core.unchecked_base_model import construct_type
8
8
  from json.decoder import JSONDecodeError
9
9
  from ...core.api_error import ApiError
10
- from .types.gcs_create_response import GcsCreateResponse
11
10
  from ...core.jsonable_encoder import jsonable_encoder
12
- from .types.gcs_update_response import GcsUpdateResponse
13
11
  from ...core.client_wrapper import AsyncClientWrapper
14
12
 
15
13
  # this is used as the default value for optional parameters
@@ -21,18 +19,20 @@ class GcsClient:
21
19
  self._client_wrapper = client_wrapper
22
20
 
23
21
  def list(
24
- self, *, project: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
22
+ self,
23
+ *,
24
+ ordering: typing.Optional[str] = None,
25
+ project: typing.Optional[int] = None,
26
+ request_options: typing.Optional[RequestOptions] = None,
25
27
  ) -> typing.List[GcsExportStorage]:
26
28
  """
27
-
28
- You can connect your Google Cloud Storage bucket to Label Studio as a source storage or target storage. Use this API request to get a list of all GCS export (target) storage connections for a specific project.
29
-
30
- The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../projects/list).
31
-
32
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
29
+ Get a list of all GCS export storage connections.
33
30
 
34
31
  Parameters
35
32
  ----------
33
+ ordering : typing.Optional[str]
34
+ Which field to use when ordering the results.
35
+
36
36
  project : typing.Optional[int]
37
37
  Project ID
38
38
 
@@ -57,6 +57,7 @@ class GcsClient:
57
57
  "api/storages/export/gcs",
58
58
  method="GET",
59
59
  params={
60
+ "ordering": ordering,
60
61
  "project": project,
61
62
  },
62
63
  request_options=request_options,
@@ -65,7 +66,7 @@ class GcsClient:
65
66
  if 200 <= _response.status_code < 300:
66
67
  return typing.cast(
67
68
  typing.List[GcsExportStorage],
68
- parse_obj_as(
69
+ construct_type(
69
70
  type_=typing.List[GcsExportStorage], # type: ignore
70
71
  object_=_response.json(),
71
72
  ),
@@ -87,14 +88,9 @@ class GcsClient:
87
88
  google_application_credentials: typing.Optional[str] = OMIT,
88
89
  google_project_id: typing.Optional[str] = OMIT,
89
90
  request_options: typing.Optional[RequestOptions] = None,
90
- ) -> GcsCreateResponse:
91
+ ) -> GcsExportStorage:
91
92
  """
92
-
93
- Create a new target storage connection to Google Cloud Storage.
94
-
95
- For information about the required fields and prerequisites, see [Google Cloud Storage](https://labelstud.io/guide/storage#Google-Cloud-Storage) in the Label Studio documentation.
96
-
97
- <Tip>After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be exported until you [sync your connection](sync).</Tip>
93
+ Create a new GCS export storage connection to store annotations.
98
94
 
99
95
  Parameters
100
96
  ----------
@@ -127,7 +123,7 @@ class GcsClient:
127
123
 
128
124
  Returns
129
125
  -------
130
- GcsCreateResponse
126
+ GcsExportStorage
131
127
 
132
128
 
133
129
  Examples
@@ -161,9 +157,9 @@ class GcsClient:
161
157
  try:
162
158
  if 200 <= _response.status_code < 300:
163
159
  return typing.cast(
164
- GcsCreateResponse,
165
- parse_obj_as(
166
- type_=GcsCreateResponse, # type: ignore
160
+ GcsExportStorage,
161
+ construct_type(
162
+ type_=GcsExportStorage, # type: ignore
167
163
  object_=_response.json(),
168
164
  ),
169
165
  )
@@ -172,108 +168,13 @@ class GcsClient:
172
168
  raise ApiError(status_code=_response.status_code, body=_response.text)
173
169
  raise ApiError(status_code=_response.status_code, body=_response_json)
174
170
 
175
- def validate(
176
- self,
177
- *,
178
- id: typing.Optional[int] = OMIT,
179
- can_delete_objects: typing.Optional[bool] = OMIT,
180
- title: typing.Optional[str] = OMIT,
181
- description: typing.Optional[str] = OMIT,
182
- project: typing.Optional[int] = OMIT,
183
- bucket: typing.Optional[str] = OMIT,
184
- prefix: typing.Optional[str] = OMIT,
185
- google_application_credentials: typing.Optional[str] = OMIT,
186
- google_project_id: typing.Optional[str] = OMIT,
187
- request_options: typing.Optional[RequestOptions] = None,
188
- ) -> None:
189
- """
190
-
191
- Validate a specific GCS export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.
192
-
193
- Parameters
194
- ----------
195
- id : typing.Optional[int]
196
- Storage ID. If set, storage with specified ID will be updated
197
-
198
- can_delete_objects : typing.Optional[bool]
199
- Deletion from storage enabled.
200
-
201
- title : typing.Optional[str]
202
- Storage title
203
-
204
- description : typing.Optional[str]
205
- Storage description
206
-
207
- project : typing.Optional[int]
208
- Project ID
209
-
210
- bucket : typing.Optional[str]
211
- GCS bucket name
212
-
213
- prefix : typing.Optional[str]
214
- GCS bucket prefix
215
-
216
- google_application_credentials : typing.Optional[str]
217
- The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
218
-
219
- google_project_id : typing.Optional[str]
220
- Google project ID
221
-
222
- request_options : typing.Optional[RequestOptions]
223
- Request-specific configuration.
224
-
225
- Returns
226
- -------
227
- None
228
-
229
- Examples
230
- --------
231
- from label_studio_sdk import LabelStudio
232
-
233
- client = LabelStudio(
234
- api_key="YOUR_API_KEY",
235
- )
236
- client.export_storage.gcs.validate()
237
- """
238
- _response = self._client_wrapper.httpx_client.request(
239
- "api/storages/export/gcs/validate",
240
- method="POST",
241
- json={
242
- "id": id,
243
- "can_delete_objects": can_delete_objects,
244
- "title": title,
245
- "description": description,
246
- "project": project,
247
- "bucket": bucket,
248
- "prefix": prefix,
249
- "google_application_credentials": google_application_credentials,
250
- "google_project_id": google_project_id,
251
- },
252
- headers={
253
- "content-type": "application/json",
254
- },
255
- request_options=request_options,
256
- omit=OMIT,
257
- )
258
- try:
259
- if 200 <= _response.status_code < 300:
260
- return
261
- _response_json = _response.json()
262
- except JSONDecodeError:
263
- raise ApiError(status_code=_response.status_code, body=_response.text)
264
- raise ApiError(status_code=_response.status_code, body=_response_json)
265
-
266
171
  def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> GcsExportStorage:
267
172
  """
268
-
269
- Get a specific GCS export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
270
-
271
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
173
+ Get a specific GCS export storage connection.
272
174
 
273
175
  Parameters
274
176
  ----------
275
177
  id : int
276
- A unique integer value identifying this gcs export storage.
277
178
 
278
179
  request_options : typing.Optional[RequestOptions]
279
180
  Request-specific configuration.
@@ -303,7 +204,7 @@ class GcsClient:
303
204
  if 200 <= _response.status_code < 300:
304
205
  return typing.cast(
305
206
  GcsExportStorage,
306
- parse_obj_as(
207
+ construct_type(
307
208
  type_=GcsExportStorage, # type: ignore
308
209
  object_=_response.json(),
309
210
  ),
@@ -315,15 +216,11 @@ class GcsClient:
315
216
 
316
217
  def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
317
218
  """
318
-
319
- Delete a specific GCS export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
320
-
321
- Deleting an export/target storage connection does not affect tasks with synced data in Label Studio. If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the [Delete tasks](../../tasks/delete-all-tasks) API.
219
+ Delete a specific GCS export storage connection.
322
220
 
323
221
  Parameters
324
222
  ----------
325
223
  id : int
326
- A unique integer value identifying this gcs export storage.
327
224
 
328
225
  request_options : typing.Optional[RequestOptions]
329
226
  Request-specific configuration.
@@ -369,17 +266,13 @@ class GcsClient:
369
266
  google_application_credentials: typing.Optional[str] = OMIT,
370
267
  google_project_id: typing.Optional[str] = OMIT,
371
268
  request_options: typing.Optional[RequestOptions] = None,
372
- ) -> GcsUpdateResponse:
269
+ ) -> GcsExportStorage:
373
270
  """
374
-
375
- Update a specific GCS export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
376
-
377
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
271
+ Update a specific GCS export storage connection.
378
272
 
379
273
  Parameters
380
274
  ----------
381
275
  id : int
382
- A unique integer value identifying this gcs export storage.
383
276
 
384
277
  can_delete_objects : typing.Optional[bool]
385
278
  Deletion from storage enabled.
@@ -410,7 +303,7 @@ class GcsClient:
410
303
 
411
304
  Returns
412
305
  -------
413
- GcsUpdateResponse
306
+ GcsExportStorage
414
307
 
415
308
 
416
309
  Examples
@@ -446,9 +339,9 @@ class GcsClient:
446
339
  try:
447
340
  if 200 <= _response.status_code < 300:
448
341
  return typing.cast(
449
- GcsUpdateResponse,
450
- parse_obj_as(
451
- type_=GcsUpdateResponse, # type: ignore
342
+ GcsExportStorage,
343
+ construct_type(
344
+ type_=GcsExportStorage, # type: ignore
452
345
  object_=_response.json(),
453
346
  ),
454
347
  )
@@ -459,12 +352,7 @@ class GcsClient:
459
352
 
460
353
  def sync(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> GcsExportStorage:
461
354
  """
462
-
463
- Sync tasks to a GCS export/target storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
464
-
465
- Sync operations with external buckets only go one way. They either create tasks from objects in the bucket (source/import storage) or push annotations to the output bucket (export/target storage). Changing something on the bucket side doesn’t guarantee consistency in results.
466
-
467
- <Note>Before proceeding, you should review [How sync operations work - Source storage](https://labelstud.io/guide/storage#Source-storage) to ensure that your data remains secure and private.</Note>
355
+ Sync tasks from an GCS export storage connection.
468
356
 
469
357
  Parameters
470
358
  ----------
@@ -498,7 +386,7 @@ class GcsClient:
498
386
  if 200 <= _response.status_code < 300:
499
387
  return typing.cast(
500
388
  GcsExportStorage,
501
- parse_obj_as(
389
+ construct_type(
502
390
  type_=GcsExportStorage, # type: ignore
503
391
  object_=_response.json(),
504
392
  ),
@@ -508,127 +396,125 @@ class GcsClient:
508
396
  raise ApiError(status_code=_response.status_code, body=_response.text)
509
397
  raise ApiError(status_code=_response.status_code, body=_response_json)
510
398
 
511
-
512
- class AsyncGcsClient:
513
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
514
- self._client_wrapper = client_wrapper
515
-
516
- async def list(
517
- self, *, project: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
518
- ) -> typing.List[GcsExportStorage]:
399
+ def validate(
400
+ self,
401
+ *,
402
+ id: typing.Optional[int] = OMIT,
403
+ can_delete_objects: typing.Optional[bool] = OMIT,
404
+ title: typing.Optional[str] = OMIT,
405
+ description: typing.Optional[str] = OMIT,
406
+ project: typing.Optional[int] = OMIT,
407
+ bucket: typing.Optional[str] = OMIT,
408
+ prefix: typing.Optional[str] = OMIT,
409
+ google_application_credentials: typing.Optional[str] = OMIT,
410
+ google_project_id: typing.Optional[str] = OMIT,
411
+ request_options: typing.Optional[RequestOptions] = None,
412
+ ) -> None:
519
413
  """
414
+ Validate a specific GCS export storage connection.
520
415
 
521
- You can connect your Google Cloud Storage bucket to Label Studio as a source storage or target storage. Use this API request to get a list of all GCS export (target) storage connections for a specific project.
416
+ Parameters
417
+ ----------
418
+ id : typing.Optional[int]
419
+ Storage ID. If set, storage with specified ID will be updated
420
+
421
+ can_delete_objects : typing.Optional[bool]
422
+ Deletion from storage enabled.
522
423
 
523
- The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using [List all projects](../projects/list).
424
+ title : typing.Optional[str]
425
+ Storage title
524
426
 
525
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
427
+ description : typing.Optional[str]
428
+ Storage description
526
429
 
527
- Parameters
528
- ----------
529
430
  project : typing.Optional[int]
530
431
  Project ID
531
432
 
433
+ bucket : typing.Optional[str]
434
+ GCS bucket name
435
+
436
+ prefix : typing.Optional[str]
437
+ GCS bucket prefix
438
+
439
+ google_application_credentials : typing.Optional[str]
440
+ The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
441
+
442
+ google_project_id : typing.Optional[str]
443
+ Google project ID
444
+
532
445
  request_options : typing.Optional[RequestOptions]
533
446
  Request-specific configuration.
534
447
 
535
448
  Returns
536
449
  -------
537
- typing.List[GcsExportStorage]
538
-
450
+ None
539
451
 
540
452
  Examples
541
453
  --------
542
- import asyncio
543
-
544
- from label_studio_sdk import AsyncLabelStudio
454
+ from label_studio_sdk import LabelStudio
545
455
 
546
- client = AsyncLabelStudio(
456
+ client = LabelStudio(
547
457
  api_key="YOUR_API_KEY",
548
458
  )
549
-
550
-
551
- async def main() -> None:
552
- await client.export_storage.gcs.list()
553
-
554
-
555
- asyncio.run(main())
459
+ client.export_storage.gcs.validate()
556
460
  """
557
- _response = await self._client_wrapper.httpx_client.request(
558
- "api/storages/export/gcs",
559
- method="GET",
560
- params={
461
+ _response = self._client_wrapper.httpx_client.request(
462
+ "api/storages/export/gcs/validate",
463
+ method="POST",
464
+ json={
465
+ "id": id,
466
+ "can_delete_objects": can_delete_objects,
467
+ "title": title,
468
+ "description": description,
561
469
  "project": project,
470
+ "bucket": bucket,
471
+ "prefix": prefix,
472
+ "google_application_credentials": google_application_credentials,
473
+ "google_project_id": google_project_id,
474
+ },
475
+ headers={
476
+ "content-type": "application/json",
562
477
  },
563
478
  request_options=request_options,
479
+ omit=OMIT,
564
480
  )
565
481
  try:
566
482
  if 200 <= _response.status_code < 300:
567
- return typing.cast(
568
- typing.List[GcsExportStorage],
569
- parse_obj_as(
570
- type_=typing.List[GcsExportStorage], # type: ignore
571
- object_=_response.json(),
572
- ),
573
- )
483
+ return
574
484
  _response_json = _response.json()
575
485
  except JSONDecodeError:
576
486
  raise ApiError(status_code=_response.status_code, body=_response.text)
577
487
  raise ApiError(status_code=_response.status_code, body=_response_json)
578
488
 
579
- async def create(
489
+
490
+ class AsyncGcsClient:
491
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
492
+ self._client_wrapper = client_wrapper
493
+
494
+ async def list(
580
495
  self,
581
496
  *,
582
- can_delete_objects: typing.Optional[bool] = OMIT,
583
- title: typing.Optional[str] = OMIT,
584
- description: typing.Optional[str] = OMIT,
585
- project: typing.Optional[int] = OMIT,
586
- bucket: typing.Optional[str] = OMIT,
587
- prefix: typing.Optional[str] = OMIT,
588
- google_application_credentials: typing.Optional[str] = OMIT,
589
- google_project_id: typing.Optional[str] = OMIT,
497
+ ordering: typing.Optional[str] = None,
498
+ project: typing.Optional[int] = None,
590
499
  request_options: typing.Optional[RequestOptions] = None,
591
- ) -> GcsCreateResponse:
500
+ ) -> typing.List[GcsExportStorage]:
592
501
  """
593
-
594
- Create a new target storage connection to Google Cloud Storage.
595
-
596
- For information about the required fields and prerequisites, see [Google Cloud Storage](https://labelstud.io/guide/storage#Google-Cloud-Storage) in the Label Studio documentation.
597
-
598
- <Tip>After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be exported until you [sync your connection](sync).</Tip>
502
+ Get a list of all GCS export storage connections.
599
503
 
600
504
  Parameters
601
505
  ----------
602
- can_delete_objects : typing.Optional[bool]
603
- Deletion from storage enabled.
604
-
605
- title : typing.Optional[str]
606
- Storage title
607
-
608
- description : typing.Optional[str]
609
- Storage description
506
+ ordering : typing.Optional[str]
507
+ Which field to use when ordering the results.
610
508
 
611
509
  project : typing.Optional[int]
612
510
  Project ID
613
511
 
614
- bucket : typing.Optional[str]
615
- GCS bucket name
616
-
617
- prefix : typing.Optional[str]
618
- GCS bucket prefix
619
-
620
- google_application_credentials : typing.Optional[str]
621
- The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
622
-
623
- google_project_id : typing.Optional[str]
624
- Google project ID
625
-
626
512
  request_options : typing.Optional[RequestOptions]
627
513
  Request-specific configuration.
628
514
 
629
515
  Returns
630
516
  -------
631
- GcsCreateResponse
517
+ typing.List[GcsExportStorage]
632
518
 
633
519
 
634
520
  Examples
@@ -643,36 +529,26 @@ class AsyncGcsClient:
643
529
 
644
530
 
645
531
  async def main() -> None:
646
- await client.export_storage.gcs.create()
532
+ await client.export_storage.gcs.list()
647
533
 
648
534
 
649
535
  asyncio.run(main())
650
536
  """
651
537
  _response = await self._client_wrapper.httpx_client.request(
652
538
  "api/storages/export/gcs",
653
- method="POST",
654
- json={
655
- "can_delete_objects": can_delete_objects,
656
- "title": title,
657
- "description": description,
539
+ method="GET",
540
+ params={
541
+ "ordering": ordering,
658
542
  "project": project,
659
- "bucket": bucket,
660
- "prefix": prefix,
661
- "google_application_credentials": google_application_credentials,
662
- "google_project_id": google_project_id,
663
- },
664
- headers={
665
- "content-type": "application/json",
666
543
  },
667
544
  request_options=request_options,
668
- omit=OMIT,
669
545
  )
670
546
  try:
671
547
  if 200 <= _response.status_code < 300:
672
548
  return typing.cast(
673
- GcsCreateResponse,
674
- parse_obj_as(
675
- type_=GcsCreateResponse, # type: ignore
549
+ typing.List[GcsExportStorage],
550
+ construct_type(
551
+ type_=typing.List[GcsExportStorage], # type: ignore
676
552
  object_=_response.json(),
677
553
  ),
678
554
  )
@@ -681,10 +557,9 @@ class AsyncGcsClient:
681
557
  raise ApiError(status_code=_response.status_code, body=_response.text)
682
558
  raise ApiError(status_code=_response.status_code, body=_response_json)
683
559
 
684
- async def validate(
560
+ async def create(
685
561
  self,
686
562
  *,
687
- id: typing.Optional[int] = OMIT,
688
563
  can_delete_objects: typing.Optional[bool] = OMIT,
689
564
  title: typing.Optional[str] = OMIT,
690
565
  description: typing.Optional[str] = OMIT,
@@ -694,16 +569,12 @@ class AsyncGcsClient:
694
569
  google_application_credentials: typing.Optional[str] = OMIT,
695
570
  google_project_id: typing.Optional[str] = OMIT,
696
571
  request_options: typing.Optional[RequestOptions] = None,
697
- ) -> None:
572
+ ) -> GcsExportStorage:
698
573
  """
699
-
700
- Validate a specific GCS export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.
574
+ Create a new GCS export storage connection to store annotations.
701
575
 
702
576
  Parameters
703
577
  ----------
704
- id : typing.Optional[int]
705
- Storage ID. If set, storage with specified ID will be updated
706
-
707
578
  can_delete_objects : typing.Optional[bool]
708
579
  Deletion from storage enabled.
709
580
 
@@ -733,7 +604,8 @@ class AsyncGcsClient:
733
604
 
734
605
  Returns
735
606
  -------
736
- None
607
+ GcsExportStorage
608
+
737
609
 
738
610
  Examples
739
611
  --------
@@ -747,16 +619,15 @@ class AsyncGcsClient:
747
619
 
748
620
 
749
621
  async def main() -> None:
750
- await client.export_storage.gcs.validate()
622
+ await client.export_storage.gcs.create()
751
623
 
752
624
 
753
625
  asyncio.run(main())
754
626
  """
755
627
  _response = await self._client_wrapper.httpx_client.request(
756
- "api/storages/export/gcs/validate",
628
+ "api/storages/export/gcs",
757
629
  method="POST",
758
630
  json={
759
- "id": id,
760
631
  "can_delete_objects": can_delete_objects,
761
632
  "title": title,
762
633
  "description": description,
@@ -774,7 +645,13 @@ class AsyncGcsClient:
774
645
  )
775
646
  try:
776
647
  if 200 <= _response.status_code < 300:
777
- return
648
+ return typing.cast(
649
+ GcsExportStorage,
650
+ construct_type(
651
+ type_=GcsExportStorage, # type: ignore
652
+ object_=_response.json(),
653
+ ),
654
+ )
778
655
  _response_json = _response.json()
779
656
  except JSONDecodeError:
780
657
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -782,15 +659,11 @@ class AsyncGcsClient:
782
659
 
783
660
  async def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> GcsExportStorage:
784
661
  """
785
-
786
- Get a specific GCS export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
787
-
788
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
662
+ Get a specific GCS export storage connection.
789
663
 
790
664
  Parameters
791
665
  ----------
792
666
  id : int
793
- A unique integer value identifying this gcs export storage.
794
667
 
795
668
  request_options : typing.Optional[RequestOptions]
796
669
  Request-specific configuration.
@@ -828,7 +701,7 @@ class AsyncGcsClient:
828
701
  if 200 <= _response.status_code < 300:
829
702
  return typing.cast(
830
703
  GcsExportStorage,
831
- parse_obj_as(
704
+ construct_type(
832
705
  type_=GcsExportStorage, # type: ignore
833
706
  object_=_response.json(),
834
707
  ),
@@ -840,15 +713,11 @@ class AsyncGcsClient:
840
713
 
841
714
  async def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
842
715
  """
843
-
844
- Delete a specific GCS export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
845
-
846
- Deleting an export/target storage connection does not affect tasks with synced data in Label Studio. If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the [Delete tasks](../../tasks/delete-all-tasks) API.
716
+ Delete a specific GCS export storage connection.
847
717
 
848
718
  Parameters
849
719
  ----------
850
720
  id : int
851
- A unique integer value identifying this gcs export storage.
852
721
 
853
722
  request_options : typing.Optional[RequestOptions]
854
723
  Request-specific configuration.
@@ -902,17 +771,13 @@ class AsyncGcsClient:
902
771
  google_application_credentials: typing.Optional[str] = OMIT,
903
772
  google_project_id: typing.Optional[str] = OMIT,
904
773
  request_options: typing.Optional[RequestOptions] = None,
905
- ) -> GcsUpdateResponse:
774
+ ) -> GcsExportStorage:
906
775
  """
907
-
908
- Update a specific GCS export storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
909
-
910
- For more information about working with external storage, see [Sync data from external storage](https://labelstud.io/guide/storage).
776
+ Update a specific GCS export storage connection.
911
777
 
912
778
  Parameters
913
779
  ----------
914
780
  id : int
915
- A unique integer value identifying this gcs export storage.
916
781
 
917
782
  can_delete_objects : typing.Optional[bool]
918
783
  Deletion from storage enabled.
@@ -943,7 +808,7 @@ class AsyncGcsClient:
943
808
 
944
809
  Returns
945
810
  -------
946
- GcsUpdateResponse
811
+ GcsExportStorage
947
812
 
948
813
 
949
814
  Examples
@@ -987,9 +852,9 @@ class AsyncGcsClient:
987
852
  try:
988
853
  if 200 <= _response.status_code < 300:
989
854
  return typing.cast(
990
- GcsUpdateResponse,
991
- parse_obj_as(
992
- type_=GcsUpdateResponse, # type: ignore
855
+ GcsExportStorage,
856
+ construct_type(
857
+ type_=GcsExportStorage, # type: ignore
993
858
  object_=_response.json(),
994
859
  ),
995
860
  )
@@ -1000,12 +865,7 @@ class AsyncGcsClient:
1000
865
 
1001
866
  async def sync(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> GcsExportStorage:
1002
867
  """
1003
-
1004
- Sync tasks to a GCS export/target storage connection. You will need to provide the export storage ID. You can find this using [List export storages](list).
1005
-
1006
- Sync operations with external buckets only go one way. They either create tasks from objects in the bucket (source/import storage) or push annotations to the output bucket (export/target storage). Changing something on the bucket side doesn’t guarantee consistency in results.
1007
-
1008
- <Note>Before proceeding, you should review [How sync operations work - Source storage](https://labelstud.io/guide/storage#Source-storage) to ensure that your data remains secure and private.</Note>
868
+ Sync tasks from an GCS export storage connection.
1009
869
 
1010
870
  Parameters
1011
871
  ----------
@@ -1047,7 +907,7 @@ class AsyncGcsClient:
1047
907
  if 200 <= _response.status_code < 300:
1048
908
  return typing.cast(
1049
909
  GcsExportStorage,
1050
- parse_obj_as(
910
+ construct_type(
1051
911
  type_=GcsExportStorage, # type: ignore
1052
912
  object_=_response.json(),
1053
913
  ),
@@ -1056,3 +916,101 @@ class AsyncGcsClient:
1056
916
  except JSONDecodeError:
1057
917
  raise ApiError(status_code=_response.status_code, body=_response.text)
1058
918
  raise ApiError(status_code=_response.status_code, body=_response_json)
919
+
920
+ async def validate(
921
+ self,
922
+ *,
923
+ id: typing.Optional[int] = OMIT,
924
+ can_delete_objects: typing.Optional[bool] = OMIT,
925
+ title: typing.Optional[str] = OMIT,
926
+ description: typing.Optional[str] = OMIT,
927
+ project: typing.Optional[int] = OMIT,
928
+ bucket: typing.Optional[str] = OMIT,
929
+ prefix: typing.Optional[str] = OMIT,
930
+ google_application_credentials: typing.Optional[str] = OMIT,
931
+ google_project_id: typing.Optional[str] = OMIT,
932
+ request_options: typing.Optional[RequestOptions] = None,
933
+ ) -> None:
934
+ """
935
+ Validate a specific GCS export storage connection.
936
+
937
+ Parameters
938
+ ----------
939
+ id : typing.Optional[int]
940
+ Storage ID. If set, storage with specified ID will be updated
941
+
942
+ can_delete_objects : typing.Optional[bool]
943
+ Deletion from storage enabled.
944
+
945
+ title : typing.Optional[str]
946
+ Storage title
947
+
948
+ description : typing.Optional[str]
949
+ Storage description
950
+
951
+ project : typing.Optional[int]
952
+ Project ID
953
+
954
+ bucket : typing.Optional[str]
955
+ GCS bucket name
956
+
957
+ prefix : typing.Optional[str]
958
+ GCS bucket prefix
959
+
960
+ google_application_credentials : typing.Optional[str]
961
+ The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.
962
+
963
+ google_project_id : typing.Optional[str]
964
+ Google project ID
965
+
966
+ request_options : typing.Optional[RequestOptions]
967
+ Request-specific configuration.
968
+
969
+ Returns
970
+ -------
971
+ None
972
+
973
+ Examples
974
+ --------
975
+ import asyncio
976
+
977
+ from label_studio_sdk import AsyncLabelStudio
978
+
979
+ client = AsyncLabelStudio(
980
+ api_key="YOUR_API_KEY",
981
+ )
982
+
983
+
984
+ async def main() -> None:
985
+ await client.export_storage.gcs.validate()
986
+
987
+
988
+ asyncio.run(main())
989
+ """
990
+ _response = await self._client_wrapper.httpx_client.request(
991
+ "api/storages/export/gcs/validate",
992
+ method="POST",
993
+ json={
994
+ "id": id,
995
+ "can_delete_objects": can_delete_objects,
996
+ "title": title,
997
+ "description": description,
998
+ "project": project,
999
+ "bucket": bucket,
1000
+ "prefix": prefix,
1001
+ "google_application_credentials": google_application_credentials,
1002
+ "google_project_id": google_project_id,
1003
+ },
1004
+ headers={
1005
+ "content-type": "application/json",
1006
+ },
1007
+ request_options=request_options,
1008
+ omit=OMIT,
1009
+ )
1010
+ try:
1011
+ if 200 <= _response.status_code < 300:
1012
+ return
1013
+ _response_json = _response.json()
1014
+ except JSONDecodeError:
1015
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1016
+ raise ApiError(status_code=_response.status_code, body=_response_json)