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,15 +4,13 @@ import typing
4
4
  from ..core.client_wrapper import SyncClientWrapper
5
5
  from ..core.request_options import RequestOptions
6
6
  from ..types.webhook import Webhook
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.webhook_actions_item import WebhookActionsItem
11
- import datetime as dt
10
+ from ..types.actions_enum import ActionsEnum
12
11
  from ..core.jsonable_encoder import jsonable_encoder
13
- from .types.webhooks_update_request_actions_item import WebhooksUpdateRequestActionsItem
14
- from ..types.webhook_serializer_for_update_actions_item import WebhookSerializerForUpdateActionsItem
15
12
  from ..types.webhook_serializer_for_update import WebhookSerializerForUpdate
13
+ from .types.webhooks_info_response import WebhooksInfoResponse
16
14
  from ..core.client_wrapper import AsyncClientWrapper
17
15
 
18
16
  # this is used as the default value for optional parameters
@@ -27,13 +25,8 @@ class WebhooksClient:
27
25
  self, *, project: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
28
26
  ) -> typing.List[Webhook]:
29
27
  """
30
-
31
28
  List all webhooks set up for your organization.
32
29
 
33
- Webhooks in Label Studio let you set up integrations that subscribe to certain events that occur inside Label Studio. When an event is triggered, Label Studio sends an HTTP POST request to the configured webhook URL.
34
-
35
- For more information, see [Set up webhooks in Label Studio](https://labelstud.io/guide/webhooks).
36
-
37
30
  Parameters
38
31
  ----------
39
32
  project : typing.Optional[str]
@@ -68,7 +61,7 @@ class WebhooksClient:
68
61
  if 200 <= _response.status_code < 300:
69
62
  return typing.cast(
70
63
  typing.List[Webhook],
71
- parse_obj_as(
64
+ construct_type(
72
65
  type_=typing.List[Webhook], # type: ignore
73
66
  object_=_response.json(),
74
67
  ),
@@ -82,36 +75,22 @@ class WebhooksClient:
82
75
  self,
83
76
  *,
84
77
  url: str,
85
- id: typing.Optional[int] = OMIT,
86
- organization: typing.Optional[int] = OMIT,
87
78
  project: typing.Optional[int] = OMIT,
88
79
  send_payload: typing.Optional[bool] = OMIT,
89
80
  send_for_all_actions: typing.Optional[bool] = OMIT,
90
- headers: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
81
+ headers: typing.Optional[typing.Optional[typing.Any]] = OMIT,
91
82
  is_active: typing.Optional[bool] = OMIT,
92
- actions: typing.Optional[typing.Sequence[WebhookActionsItem]] = OMIT,
93
- created_at: typing.Optional[dt.datetime] = OMIT,
94
- updated_at: typing.Optional[dt.datetime] = OMIT,
83
+ actions: typing.Optional[typing.Sequence[ActionsEnum]] = OMIT,
95
84
  request_options: typing.Optional[RequestOptions] = None,
96
85
  ) -> Webhook:
97
86
  """
98
-
99
- Create a webhook.
100
- Label Studio provides several out-of-the box webhook events, which you can find listed here: [Available Label Studio webhooks](https://labelstud.io/guide/webhooks#Available-Label-Studio-webhooks).
101
-
102
- If you want to create your own custom webhook, refer to [Create custom events for webhooks in Label Studio](https://labelstud.io/guide/webhook_create).
103
-
104
- <Note>Label Studio makes two main types of events available to integrate with webhooks: project-level task events and organization events. If you want to use organization-level webhook events, you will need to set `LABEL_STUDIO_ALLOW_ORGANIZATION_WEBHOOKS=true`. </Note>
87
+ Create a webhook for your organization.
105
88
 
106
89
  Parameters
107
90
  ----------
108
91
  url : str
109
92
  URL of webhook
110
93
 
111
- id : typing.Optional[int]
112
-
113
- organization : typing.Optional[int]
114
-
115
94
  project : typing.Optional[int]
116
95
 
117
96
  send_payload : typing.Optional[bool]
@@ -120,19 +99,12 @@ class WebhooksClient:
120
99
  send_for_all_actions : typing.Optional[bool]
121
100
  If value is False - used only for actions from WebhookAction
122
101
 
123
- headers : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
124
- Key Value Json of headers
102
+ headers : typing.Optional[typing.Optional[typing.Any]]
125
103
 
126
104
  is_active : typing.Optional[bool]
127
105
  If value is False the webhook is disabled
128
106
 
129
- actions : typing.Optional[typing.Sequence[WebhookActionsItem]]
130
-
131
- created_at : typing.Optional[dt.datetime]
132
- Creation time
133
-
134
- updated_at : typing.Optional[dt.datetime]
135
- Last update time
107
+ actions : typing.Optional[typing.Sequence[ActionsEnum]]
136
108
 
137
109
  request_options : typing.Optional[RequestOptions]
138
110
  Request-specific configuration.
@@ -157,8 +129,6 @@ class WebhooksClient:
157
129
  "api/webhooks/",
158
130
  method="POST",
159
131
  json={
160
- "id": id,
161
- "organization": organization,
162
132
  "project": project,
163
133
  "url": url,
164
134
  "send_payload": send_payload,
@@ -166,8 +136,9 @@ class WebhooksClient:
166
136
  "headers": headers,
167
137
  "is_active": is_active,
168
138
  "actions": actions,
169
- "created_at": created_at,
170
- "updated_at": updated_at,
139
+ },
140
+ headers={
141
+ "content-type": "application/json",
171
142
  },
172
143
  request_options=request_options,
173
144
  omit=OMIT,
@@ -176,7 +147,7 @@ class WebhooksClient:
176
147
  if 200 <= _response.status_code < 300:
177
148
  return typing.cast(
178
149
  Webhook,
179
- parse_obj_as(
150
+ construct_type(
180
151
  type_=Webhook, # type: ignore
181
152
  object_=_response.json(),
182
153
  ),
@@ -186,64 +157,11 @@ class WebhooksClient:
186
157
  raise ApiError(status_code=_response.status_code, body=_response.text)
187
158
  raise ApiError(status_code=_response.status_code, body=_response_json)
188
159
 
189
- def info(
190
- self,
191
- *,
192
- organization_only: typing.Optional[bool] = None,
193
- request_options: typing.Optional[RequestOptions] = None,
194
- ) -> None:
195
- """
196
-
197
- Get descriptions of all available webhook actions to set up webhooks. For more information, see the [Webhook event reference](https://labelstud.io/guide/webhook_reference).
198
-
199
- Parameters
200
- ----------
201
- organization_only : typing.Optional[bool]
202
- organization-only or not
203
-
204
- request_options : typing.Optional[RequestOptions]
205
- Request-specific configuration.
206
-
207
- Returns
208
- -------
209
- None
210
-
211
- Examples
212
- --------
213
- from label_studio_sdk import LabelStudio
214
-
215
- client = LabelStudio(
216
- api_key="YOUR_API_KEY",
217
- )
218
- client.webhooks.info()
219
- """
220
- _response = self._client_wrapper.httpx_client.request(
221
- "api/webhooks/info/",
222
- method="GET",
223
- params={
224
- "organization-only": organization_only,
225
- },
226
- request_options=request_options,
227
- )
228
- try:
229
- if 200 <= _response.status_code < 300:
230
- return
231
- _response_json = _response.json()
232
- except JSONDecodeError:
233
- raise ApiError(status_code=_response.status_code, body=_response.text)
234
- raise ApiError(status_code=_response.status_code, body=_response_json)
235
-
236
160
  def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> Webhook:
237
161
  """
238
-
239
- Get information about a specific webhook. You will need to provide the webhook ID. You can get this from [List all webhooks](list).
240
-
241
- For more information about webhooks, see [Set up webhooks in Label Studio](https://labelstud.io/guide/webhooks) and the [Webhook event reference](https://labelstud.io/guide/webhook_reference).
242
-
243
162
  Parameters
244
163
  ----------
245
164
  id : int
246
- A unique integer value identifying this webhook.
247
165
 
248
166
  request_options : typing.Optional[RequestOptions]
249
167
  Request-specific configuration.
@@ -273,7 +191,7 @@ class WebhooksClient:
273
191
  if 200 <= _response.status_code < 300:
274
192
  return typing.cast(
275
193
  Webhook,
276
- parse_obj_as(
194
+ construct_type(
277
195
  type_=Webhook, # type: ignore
278
196
  object_=_response.json(),
279
197
  ),
@@ -285,15 +203,9 @@ class WebhooksClient:
285
203
 
286
204
  def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
287
205
  """
288
-
289
- Delete a webhook. You will need to provide the webhook ID. You can get this from [List all webhooks](list).
290
-
291
- For more information about webhooks, see [Set up webhooks in Label Studio](https://labelstud.io/guide/webhooks) and the [Webhook event reference](https://labelstud.io/guide/webhook_reference).
292
-
293
206
  Parameters
294
207
  ----------
295
208
  id : int
296
- A unique integer value identifying this webhook.
297
209
 
298
210
  request_options : typing.Optional[RequestOptions]
299
211
  Request-specific configuration.
@@ -328,46 +240,22 @@ class WebhooksClient:
328
240
 
329
241
  def update(
330
242
  self,
331
- id_: int,
243
+ id: int,
332
244
  *,
333
- url: str,
334
- webhook_serializer_for_update_url: str,
335
- send_payload: typing.Optional[bool] = None,
336
- send_for_all_actions: typing.Optional[bool] = None,
337
- headers: typing.Optional[str] = None,
338
- is_active: typing.Optional[bool] = None,
339
- actions: typing.Optional[
340
- typing.Union[WebhooksUpdateRequestActionsItem, typing.Sequence[WebhooksUpdateRequestActionsItem]]
341
- ] = None,
342
- id: typing.Optional[int] = OMIT,
343
- organization: typing.Optional[int] = OMIT,
344
- project: typing.Optional[int] = OMIT,
345
- webhook_serializer_for_update_send_payload: typing.Optional[bool] = OMIT,
346
- webhook_serializer_for_update_send_for_all_actions: typing.Optional[bool] = OMIT,
347
- webhook_serializer_for_update_headers: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
348
- webhook_serializer_for_update_is_active: typing.Optional[bool] = OMIT,
349
- webhook_serializer_for_update_actions: typing.Optional[
350
- typing.Sequence[WebhookSerializerForUpdateActionsItem]
351
- ] = OMIT,
352
- created_at: typing.Optional[dt.datetime] = OMIT,
353
- updated_at: typing.Optional[dt.datetime] = OMIT,
245
+ url: typing.Optional[str] = OMIT,
246
+ send_payload: typing.Optional[bool] = OMIT,
247
+ send_for_all_actions: typing.Optional[bool] = OMIT,
248
+ headers: typing.Optional[typing.Optional[typing.Any]] = OMIT,
249
+ is_active: typing.Optional[bool] = OMIT,
250
+ actions: typing.Optional[typing.Sequence[ActionsEnum]] = OMIT,
354
251
  request_options: typing.Optional[RequestOptions] = None,
355
252
  ) -> WebhookSerializerForUpdate:
356
253
  """
357
-
358
- Update a webhook. You will need to provide the webhook ID. You can get this from [List all webhooks](list).
359
-
360
- For more information about webhooks, see [Set up webhooks in Label Studio](https://labelstud.io/guide/webhooks) and the [Webhook event reference](https://labelstud.io/guide/webhook_reference).
361
-
362
254
  Parameters
363
255
  ----------
364
- id_ : int
365
- A unique integer value identifying this webhook.
366
-
367
- url : str
368
- URL of webhook
256
+ id : int
369
257
 
370
- webhook_serializer_for_update_url : str
258
+ url : typing.Optional[str]
371
259
  URL of webhook
372
260
 
373
261
  send_payload : typing.Optional[bool]
@@ -376,39 +264,12 @@ class WebhooksClient:
376
264
  send_for_all_actions : typing.Optional[bool]
377
265
  If value is False - used only for actions from WebhookAction
378
266
 
379
- headers : typing.Optional[str]
380
- Key Value Json of headers
267
+ headers : typing.Optional[typing.Optional[typing.Any]]
381
268
 
382
269
  is_active : typing.Optional[bool]
383
270
  If value is False the webhook is disabled
384
271
 
385
- actions : typing.Optional[typing.Union[WebhooksUpdateRequestActionsItem, typing.Sequence[WebhooksUpdateRequestActionsItem]]]
386
-
387
- id : typing.Optional[int]
388
-
389
- organization : typing.Optional[int]
390
-
391
- project : typing.Optional[int]
392
-
393
- webhook_serializer_for_update_send_payload : typing.Optional[bool]
394
- If value is False send only action
395
-
396
- webhook_serializer_for_update_send_for_all_actions : typing.Optional[bool]
397
- If value is False - used only for actions from WebhookAction
398
-
399
- webhook_serializer_for_update_headers : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
400
- Key Value Json of headers
401
-
402
- webhook_serializer_for_update_is_active : typing.Optional[bool]
403
- If value is False the webhook is disabled
404
-
405
- webhook_serializer_for_update_actions : typing.Optional[typing.Sequence[WebhookSerializerForUpdateActionsItem]]
406
-
407
- created_at : typing.Optional[dt.datetime]
408
- Creation time
409
-
410
- updated_at : typing.Optional[dt.datetime]
411
- Last update time
272
+ actions : typing.Optional[typing.Sequence[ActionsEnum]]
412
273
 
413
274
  request_options : typing.Optional[RequestOptions]
414
275
  Request-specific configuration.
@@ -426,34 +287,22 @@ class WebhooksClient:
426
287
  api_key="YOUR_API_KEY",
427
288
  )
428
289
  client.webhooks.update(
429
- id_=1,
430
- url="url",
431
- webhook_serializer_for_update_url="url",
290
+ id=1,
432
291
  )
433
292
  """
434
293
  _response = self._client_wrapper.httpx_client.request(
435
- f"api/webhooks/{jsonable_encoder(id_)}/",
294
+ f"api/webhooks/{jsonable_encoder(id)}/",
436
295
  method="PATCH",
437
- params={
438
- "url": url,
439
- "send_payload": send_payload,
440
- "send_for_all_actions": send_for_all_actions,
441
- "headers": headers,
442
- "is_active": is_active,
443
- "actions": actions,
444
- },
445
296
  json={
446
- "id": id,
447
- "organization": organization,
448
- "project": project,
449
297
  "url": url,
450
298
  "send_payload": send_payload,
451
299
  "send_for_all_actions": send_for_all_actions,
452
300
  "headers": headers,
453
301
  "is_active": is_active,
454
302
  "actions": actions,
455
- "created_at": created_at,
456
- "updated_at": updated_at,
303
+ },
304
+ headers={
305
+ "content-type": "application/json",
457
306
  },
458
307
  request_options=request_options,
459
308
  omit=OMIT,
@@ -462,7 +311,7 @@ class WebhooksClient:
462
311
  if 200 <= _response.status_code < 300:
463
312
  return typing.cast(
464
313
  WebhookSerializerForUpdate,
465
- parse_obj_as(
314
+ construct_type(
466
315
  type_=WebhookSerializerForUpdate, # type: ignore
467
316
  object_=_response.json(),
468
317
  ),
@@ -472,6 +321,59 @@ class WebhooksClient:
472
321
  raise ApiError(status_code=_response.status_code, body=_response.text)
473
322
  raise ApiError(status_code=_response.status_code, body=_response_json)
474
323
 
324
+ def info(
325
+ self,
326
+ *,
327
+ organization_only: typing.Optional[bool] = None,
328
+ request_options: typing.Optional[RequestOptions] = None,
329
+ ) -> WebhooksInfoResponse:
330
+ """
331
+ Get descriptions of all available webhook actions to set up webhooks.
332
+
333
+ Parameters
334
+ ----------
335
+ organization_only : typing.Optional[bool]
336
+ organization-only or not
337
+
338
+ request_options : typing.Optional[RequestOptions]
339
+ Request-specific configuration.
340
+
341
+ Returns
342
+ -------
343
+ WebhooksInfoResponse
344
+ Object with webhook action descriptions.
345
+
346
+ Examples
347
+ --------
348
+ from label_studio_sdk import LabelStudio
349
+
350
+ client = LabelStudio(
351
+ api_key="YOUR_API_KEY",
352
+ )
353
+ client.webhooks.info()
354
+ """
355
+ _response = self._client_wrapper.httpx_client.request(
356
+ "api/webhooks/info/",
357
+ method="GET",
358
+ params={
359
+ "organization-only": organization_only,
360
+ },
361
+ request_options=request_options,
362
+ )
363
+ try:
364
+ if 200 <= _response.status_code < 300:
365
+ return typing.cast(
366
+ WebhooksInfoResponse,
367
+ construct_type(
368
+ type_=WebhooksInfoResponse, # type: ignore
369
+ object_=_response.json(),
370
+ ),
371
+ )
372
+ _response_json = _response.json()
373
+ except JSONDecodeError:
374
+ raise ApiError(status_code=_response.status_code, body=_response.text)
375
+ raise ApiError(status_code=_response.status_code, body=_response_json)
376
+
475
377
 
476
378
  class AsyncWebhooksClient:
477
379
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -481,13 +383,8 @@ class AsyncWebhooksClient:
481
383
  self, *, project: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
482
384
  ) -> typing.List[Webhook]:
483
385
  """
484
-
485
386
  List all webhooks set up for your organization.
486
387
 
487
- Webhooks in Label Studio let you set up integrations that subscribe to certain events that occur inside Label Studio. When an event is triggered, Label Studio sends an HTTP POST request to the configured webhook URL.
488
-
489
- For more information, see [Set up webhooks in Label Studio](https://labelstud.io/guide/webhooks).
490
-
491
388
  Parameters
492
389
  ----------
493
390
  project : typing.Optional[str]
@@ -530,7 +427,7 @@ class AsyncWebhooksClient:
530
427
  if 200 <= _response.status_code < 300:
531
428
  return typing.cast(
532
429
  typing.List[Webhook],
533
- parse_obj_as(
430
+ construct_type(
534
431
  type_=typing.List[Webhook], # type: ignore
535
432
  object_=_response.json(),
536
433
  ),
@@ -544,36 +441,22 @@ class AsyncWebhooksClient:
544
441
  self,
545
442
  *,
546
443
  url: str,
547
- id: typing.Optional[int] = OMIT,
548
- organization: typing.Optional[int] = OMIT,
549
444
  project: typing.Optional[int] = OMIT,
550
445
  send_payload: typing.Optional[bool] = OMIT,
551
446
  send_for_all_actions: typing.Optional[bool] = OMIT,
552
- headers: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
447
+ headers: typing.Optional[typing.Optional[typing.Any]] = OMIT,
553
448
  is_active: typing.Optional[bool] = OMIT,
554
- actions: typing.Optional[typing.Sequence[WebhookActionsItem]] = OMIT,
555
- created_at: typing.Optional[dt.datetime] = OMIT,
556
- updated_at: typing.Optional[dt.datetime] = OMIT,
449
+ actions: typing.Optional[typing.Sequence[ActionsEnum]] = OMIT,
557
450
  request_options: typing.Optional[RequestOptions] = None,
558
451
  ) -> Webhook:
559
452
  """
560
-
561
- Create a webhook.
562
- Label Studio provides several out-of-the box webhook events, which you can find listed here: [Available Label Studio webhooks](https://labelstud.io/guide/webhooks#Available-Label-Studio-webhooks).
563
-
564
- If you want to create your own custom webhook, refer to [Create custom events for webhooks in Label Studio](https://labelstud.io/guide/webhook_create).
565
-
566
- <Note>Label Studio makes two main types of events available to integrate with webhooks: project-level task events and organization events. If you want to use organization-level webhook events, you will need to set `LABEL_STUDIO_ALLOW_ORGANIZATION_WEBHOOKS=true`. </Note>
453
+ Create a webhook for your organization.
567
454
 
568
455
  Parameters
569
456
  ----------
570
457
  url : str
571
458
  URL of webhook
572
459
 
573
- id : typing.Optional[int]
574
-
575
- organization : typing.Optional[int]
576
-
577
460
  project : typing.Optional[int]
578
461
 
579
462
  send_payload : typing.Optional[bool]
@@ -582,19 +465,12 @@ class AsyncWebhooksClient:
582
465
  send_for_all_actions : typing.Optional[bool]
583
466
  If value is False - used only for actions from WebhookAction
584
467
 
585
- headers : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
586
- Key Value Json of headers
468
+ headers : typing.Optional[typing.Optional[typing.Any]]
587
469
 
588
470
  is_active : typing.Optional[bool]
589
471
  If value is False the webhook is disabled
590
472
 
591
- actions : typing.Optional[typing.Sequence[WebhookActionsItem]]
592
-
593
- created_at : typing.Optional[dt.datetime]
594
- Creation time
595
-
596
- updated_at : typing.Optional[dt.datetime]
597
- Last update time
473
+ actions : typing.Optional[typing.Sequence[ActionsEnum]]
598
474
 
599
475
  request_options : typing.Optional[RequestOptions]
600
476
  Request-specific configuration.
@@ -627,8 +503,6 @@ class AsyncWebhooksClient:
627
503
  "api/webhooks/",
628
504
  method="POST",
629
505
  json={
630
- "id": id,
631
- "organization": organization,
632
506
  "project": project,
633
507
  "url": url,
634
508
  "send_payload": send_payload,
@@ -636,8 +510,9 @@ class AsyncWebhooksClient:
636
510
  "headers": headers,
637
511
  "is_active": is_active,
638
512
  "actions": actions,
639
- "created_at": created_at,
640
- "updated_at": updated_at,
513
+ },
514
+ headers={
515
+ "content-type": "application/json",
641
516
  },
642
517
  request_options=request_options,
643
518
  omit=OMIT,
@@ -646,7 +521,7 @@ class AsyncWebhooksClient:
646
521
  if 200 <= _response.status_code < 300:
647
522
  return typing.cast(
648
523
  Webhook,
649
- parse_obj_as(
524
+ construct_type(
650
525
  type_=Webhook, # type: ignore
651
526
  object_=_response.json(),
652
527
  ),
@@ -656,72 +531,11 @@ class AsyncWebhooksClient:
656
531
  raise ApiError(status_code=_response.status_code, body=_response.text)
657
532
  raise ApiError(status_code=_response.status_code, body=_response_json)
658
533
 
659
- async def info(
660
- self,
661
- *,
662
- organization_only: typing.Optional[bool] = None,
663
- request_options: typing.Optional[RequestOptions] = None,
664
- ) -> None:
665
- """
666
-
667
- Get descriptions of all available webhook actions to set up webhooks. For more information, see the [Webhook event reference](https://labelstud.io/guide/webhook_reference).
668
-
669
- Parameters
670
- ----------
671
- organization_only : typing.Optional[bool]
672
- organization-only or not
673
-
674
- request_options : typing.Optional[RequestOptions]
675
- Request-specific configuration.
676
-
677
- Returns
678
- -------
679
- None
680
-
681
- Examples
682
- --------
683
- import asyncio
684
-
685
- from label_studio_sdk import AsyncLabelStudio
686
-
687
- client = AsyncLabelStudio(
688
- api_key="YOUR_API_KEY",
689
- )
690
-
691
-
692
- async def main() -> None:
693
- await client.webhooks.info()
694
-
695
-
696
- asyncio.run(main())
697
- """
698
- _response = await self._client_wrapper.httpx_client.request(
699
- "api/webhooks/info/",
700
- method="GET",
701
- params={
702
- "organization-only": organization_only,
703
- },
704
- request_options=request_options,
705
- )
706
- try:
707
- if 200 <= _response.status_code < 300:
708
- return
709
- _response_json = _response.json()
710
- except JSONDecodeError:
711
- raise ApiError(status_code=_response.status_code, body=_response.text)
712
- raise ApiError(status_code=_response.status_code, body=_response_json)
713
-
714
534
  async def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> Webhook:
715
535
  """
716
-
717
- Get information about a specific webhook. You will need to provide the webhook ID. You can get this from [List all webhooks](list).
718
-
719
- For more information about webhooks, see [Set up webhooks in Label Studio](https://labelstud.io/guide/webhooks) and the [Webhook event reference](https://labelstud.io/guide/webhook_reference).
720
-
721
536
  Parameters
722
537
  ----------
723
538
  id : int
724
- A unique integer value identifying this webhook.
725
539
 
726
540
  request_options : typing.Optional[RequestOptions]
727
541
  Request-specific configuration.
@@ -759,7 +573,7 @@ class AsyncWebhooksClient:
759
573
  if 200 <= _response.status_code < 300:
760
574
  return typing.cast(
761
575
  Webhook,
762
- parse_obj_as(
576
+ construct_type(
763
577
  type_=Webhook, # type: ignore
764
578
  object_=_response.json(),
765
579
  ),
@@ -771,15 +585,9 @@ class AsyncWebhooksClient:
771
585
 
772
586
  async def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> None:
773
587
  """
774
-
775
- Delete a webhook. You will need to provide the webhook ID. You can get this from [List all webhooks](list).
776
-
777
- For more information about webhooks, see [Set up webhooks in Label Studio](https://labelstud.io/guide/webhooks) and the [Webhook event reference](https://labelstud.io/guide/webhook_reference).
778
-
779
588
  Parameters
780
589
  ----------
781
590
  id : int
782
- A unique integer value identifying this webhook.
783
591
 
784
592
  request_options : typing.Optional[RequestOptions]
785
593
  Request-specific configuration.
@@ -822,46 +630,22 @@ class AsyncWebhooksClient:
822
630
 
823
631
  async def update(
824
632
  self,
825
- id_: int,
633
+ id: int,
826
634
  *,
827
- url: str,
828
- webhook_serializer_for_update_url: str,
829
- send_payload: typing.Optional[bool] = None,
830
- send_for_all_actions: typing.Optional[bool] = None,
831
- headers: typing.Optional[str] = None,
832
- is_active: typing.Optional[bool] = None,
833
- actions: typing.Optional[
834
- typing.Union[WebhooksUpdateRequestActionsItem, typing.Sequence[WebhooksUpdateRequestActionsItem]]
835
- ] = None,
836
- id: typing.Optional[int] = OMIT,
837
- organization: typing.Optional[int] = OMIT,
838
- project: typing.Optional[int] = OMIT,
839
- webhook_serializer_for_update_send_payload: typing.Optional[bool] = OMIT,
840
- webhook_serializer_for_update_send_for_all_actions: typing.Optional[bool] = OMIT,
841
- webhook_serializer_for_update_headers: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
842
- webhook_serializer_for_update_is_active: typing.Optional[bool] = OMIT,
843
- webhook_serializer_for_update_actions: typing.Optional[
844
- typing.Sequence[WebhookSerializerForUpdateActionsItem]
845
- ] = OMIT,
846
- created_at: typing.Optional[dt.datetime] = OMIT,
847
- updated_at: typing.Optional[dt.datetime] = OMIT,
635
+ url: typing.Optional[str] = OMIT,
636
+ send_payload: typing.Optional[bool] = OMIT,
637
+ send_for_all_actions: typing.Optional[bool] = OMIT,
638
+ headers: typing.Optional[typing.Optional[typing.Any]] = OMIT,
639
+ is_active: typing.Optional[bool] = OMIT,
640
+ actions: typing.Optional[typing.Sequence[ActionsEnum]] = OMIT,
848
641
  request_options: typing.Optional[RequestOptions] = None,
849
642
  ) -> WebhookSerializerForUpdate:
850
643
  """
851
-
852
- Update a webhook. You will need to provide the webhook ID. You can get this from [List all webhooks](list).
853
-
854
- For more information about webhooks, see [Set up webhooks in Label Studio](https://labelstud.io/guide/webhooks) and the [Webhook event reference](https://labelstud.io/guide/webhook_reference).
855
-
856
644
  Parameters
857
645
  ----------
858
- id_ : int
859
- A unique integer value identifying this webhook.
860
-
861
- url : str
862
- URL of webhook
646
+ id : int
863
647
 
864
- webhook_serializer_for_update_url : str
648
+ url : typing.Optional[str]
865
649
  URL of webhook
866
650
 
867
651
  send_payload : typing.Optional[bool]
@@ -870,39 +654,12 @@ class AsyncWebhooksClient:
870
654
  send_for_all_actions : typing.Optional[bool]
871
655
  If value is False - used only for actions from WebhookAction
872
656
 
873
- headers : typing.Optional[str]
874
- Key Value Json of headers
657
+ headers : typing.Optional[typing.Optional[typing.Any]]
875
658
 
876
659
  is_active : typing.Optional[bool]
877
660
  If value is False the webhook is disabled
878
661
 
879
- actions : typing.Optional[typing.Union[WebhooksUpdateRequestActionsItem, typing.Sequence[WebhooksUpdateRequestActionsItem]]]
880
-
881
- id : typing.Optional[int]
882
-
883
- organization : typing.Optional[int]
884
-
885
- project : typing.Optional[int]
886
-
887
- webhook_serializer_for_update_send_payload : typing.Optional[bool]
888
- If value is False send only action
889
-
890
- webhook_serializer_for_update_send_for_all_actions : typing.Optional[bool]
891
- If value is False - used only for actions from WebhookAction
892
-
893
- webhook_serializer_for_update_headers : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
894
- Key Value Json of headers
895
-
896
- webhook_serializer_for_update_is_active : typing.Optional[bool]
897
- If value is False the webhook is disabled
898
-
899
- webhook_serializer_for_update_actions : typing.Optional[typing.Sequence[WebhookSerializerForUpdateActionsItem]]
900
-
901
- created_at : typing.Optional[dt.datetime]
902
- Creation time
903
-
904
- updated_at : typing.Optional[dt.datetime]
905
- Last update time
662
+ actions : typing.Optional[typing.Sequence[ActionsEnum]]
906
663
 
907
664
  request_options : typing.Optional[RequestOptions]
908
665
  Request-specific configuration.
@@ -925,37 +682,25 @@ class AsyncWebhooksClient:
925
682
 
926
683
  async def main() -> None:
927
684
  await client.webhooks.update(
928
- id_=1,
929
- url="url",
930
- webhook_serializer_for_update_url="url",
685
+ id=1,
931
686
  )
932
687
 
933
688
 
934
689
  asyncio.run(main())
935
690
  """
936
691
  _response = await self._client_wrapper.httpx_client.request(
937
- f"api/webhooks/{jsonable_encoder(id_)}/",
692
+ f"api/webhooks/{jsonable_encoder(id)}/",
938
693
  method="PATCH",
939
- params={
940
- "url": url,
941
- "send_payload": send_payload,
942
- "send_for_all_actions": send_for_all_actions,
943
- "headers": headers,
944
- "is_active": is_active,
945
- "actions": actions,
946
- },
947
694
  json={
948
- "id": id,
949
- "organization": organization,
950
- "project": project,
951
695
  "url": url,
952
696
  "send_payload": send_payload,
953
697
  "send_for_all_actions": send_for_all_actions,
954
698
  "headers": headers,
955
699
  "is_active": is_active,
956
700
  "actions": actions,
957
- "created_at": created_at,
958
- "updated_at": updated_at,
701
+ },
702
+ headers={
703
+ "content-type": "application/json",
959
704
  },
960
705
  request_options=request_options,
961
706
  omit=OMIT,
@@ -964,7 +709,7 @@ class AsyncWebhooksClient:
964
709
  if 200 <= _response.status_code < 300:
965
710
  return typing.cast(
966
711
  WebhookSerializerForUpdate,
967
- parse_obj_as(
712
+ construct_type(
968
713
  type_=WebhookSerializerForUpdate, # type: ignore
969
714
  object_=_response.json(),
970
715
  ),
@@ -973,3 +718,64 @@ class AsyncWebhooksClient:
973
718
  except JSONDecodeError:
974
719
  raise ApiError(status_code=_response.status_code, body=_response.text)
975
720
  raise ApiError(status_code=_response.status_code, body=_response_json)
721
+
722
+ async def info(
723
+ self,
724
+ *,
725
+ organization_only: typing.Optional[bool] = None,
726
+ request_options: typing.Optional[RequestOptions] = None,
727
+ ) -> WebhooksInfoResponse:
728
+ """
729
+ Get descriptions of all available webhook actions to set up webhooks.
730
+
731
+ Parameters
732
+ ----------
733
+ organization_only : typing.Optional[bool]
734
+ organization-only or not
735
+
736
+ request_options : typing.Optional[RequestOptions]
737
+ Request-specific configuration.
738
+
739
+ Returns
740
+ -------
741
+ WebhooksInfoResponse
742
+ Object with webhook action descriptions.
743
+
744
+ Examples
745
+ --------
746
+ import asyncio
747
+
748
+ from label_studio_sdk import AsyncLabelStudio
749
+
750
+ client = AsyncLabelStudio(
751
+ api_key="YOUR_API_KEY",
752
+ )
753
+
754
+
755
+ async def main() -> None:
756
+ await client.webhooks.info()
757
+
758
+
759
+ asyncio.run(main())
760
+ """
761
+ _response = await self._client_wrapper.httpx_client.request(
762
+ "api/webhooks/info/",
763
+ method="GET",
764
+ params={
765
+ "organization-only": organization_only,
766
+ },
767
+ request_options=request_options,
768
+ )
769
+ try:
770
+ if 200 <= _response.status_code < 300:
771
+ return typing.cast(
772
+ WebhooksInfoResponse,
773
+ construct_type(
774
+ type_=WebhooksInfoResponse, # type: ignore
775
+ object_=_response.json(),
776
+ ),
777
+ )
778
+ _response_json = _response.json()
779
+ except JSONDecodeError:
780
+ raise ApiError(status_code=_response.status_code, body=_response.text)
781
+ raise ApiError(status_code=_response.status_code, body=_response_json)