label-studio-sdk 2.0.1__py3-none-any.whl → 2.0.3__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 (184) hide show
  1. label_studio_sdk/__init__.py +20 -0
  2. label_studio_sdk/actions/client.py +13 -13
  3. label_studio_sdk/actions/types/actions_list_response_item.py +3 -3
  4. label_studio_sdk/actions/types/actions_list_response_item_dialog.py +2 -2
  5. label_studio_sdk/annotations/client.py +441 -441
  6. label_studio_sdk/base_client.py +4 -0
  7. label_studio_sdk/comments/client.py +176 -176
  8. label_studio_sdk/export_storage/azure/client.py +274 -274
  9. label_studio_sdk/export_storage/gcs/client.py +263 -263
  10. label_studio_sdk/export_storage/local/client.py +206 -206
  11. label_studio_sdk/export_storage/redis/client.py +287 -287
  12. label_studio_sdk/export_storage/s3/client.py +347 -347
  13. label_studio_sdk/export_storage/s3s/client.py +678 -678
  14. label_studio_sdk/import_storage/azure/client.py +357 -357
  15. label_studio_sdk/import_storage/gcs/client.py +357 -357
  16. label_studio_sdk/import_storage/local/client.py +206 -206
  17. label_studio_sdk/import_storage/redis/client.py +309 -309
  18. label_studio_sdk/import_storage/s3/client.py +452 -452
  19. label_studio_sdk/import_storage/s3s/client.py +735 -735
  20. label_studio_sdk/jwt_settings/client.py +10 -10
  21. label_studio_sdk/ml/client.py +118 -118
  22. label_studio_sdk/ml/types/ml_list_model_versions_response.py +1 -1
  23. label_studio_sdk/model_providers/client.py +181 -181
  24. label_studio_sdk/organizations/members/client.py +8 -8
  25. label_studio_sdk/predictions/client.py +60 -60
  26. label_studio_sdk/projects/__init__.py +33 -1
  27. label_studio_sdk/projects/assignments/__init__.py +35 -0
  28. label_studio_sdk/projects/assignments/client.py +801 -0
  29. label_studio_sdk/projects/assignments/types/__init__.py +37 -0
  30. label_studio_sdk/projects/assignments/types/assignments_assign_request_type.py +5 -0
  31. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters.py +33 -0
  32. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_conjunction.py +5 -0
  33. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item.py +44 -0
  34. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_filter.py +31 -0
  35. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_operator.py +23 -0
  36. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_value.py +7 -0
  37. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items.py +9 -0
  38. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_excluded.py +29 -0
  39. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_included.py +29 -0
  40. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_type.py +5 -0
  41. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_response.py +22 -0
  42. label_studio_sdk/projects/assignments/types/assignments_delete_request_type.py +5 -0
  43. label_studio_sdk/projects/assignments/types/assignments_update_request_type.py +5 -0
  44. label_studio_sdk/projects/client.py +445 -425
  45. label_studio_sdk/projects/exports/client.py +55 -55
  46. label_studio_sdk/projects/exports/types/exports_convert_response.py +1 -1
  47. label_studio_sdk/projects/members/__init__.py +2 -0
  48. label_studio_sdk/projects/members/client.py +137 -0
  49. label_studio_sdk/projects/stats/types/stats_iaa_response.py +5 -5
  50. label_studio_sdk/projects/types/projects_import_tasks_response.py +12 -12
  51. label_studio_sdk/prompts/client.py +211 -211
  52. label_studio_sdk/prompts/runs/client.py +33 -33
  53. label_studio_sdk/prompts/versions/client.py +72 -72
  54. label_studio_sdk/sso/__init__.py +5 -0
  55. label_studio_sdk/sso/client.py +22 -0
  56. label_studio_sdk/sso/saml/__init__.py +2 -0
  57. label_studio_sdk/sso/saml/client.py +278 -0
  58. label_studio_sdk/sso/scim/__init__.py +2 -0
  59. label_studio_sdk/sso/scim/client.py +278 -0
  60. label_studio_sdk/tasks/client.py +174 -174
  61. label_studio_sdk/types/__init__.py +18 -0
  62. label_studio_sdk/types/all_roles_project_list.py +94 -94
  63. label_studio_sdk/types/annotation.py +35 -35
  64. label_studio_sdk/types/annotation_request.py +27 -27
  65. label_studio_sdk/types/azure_blob_export_storage.py +29 -29
  66. label_studio_sdk/types/azure_blob_import_storage.py +33 -33
  67. label_studio_sdk/types/batch_failed_predictions.py +1 -1
  68. label_studio_sdk/types/billing_checks.py +14 -14
  69. label_studio_sdk/types/billing_flags.py +16 -16
  70. label_studio_sdk/types/blueprint_list.py +7 -8
  71. label_studio_sdk/types/child_filter.py +11 -10
  72. label_studio_sdk/types/comment.py +15 -15
  73. label_studio_sdk/types/comment_request.py +7 -8
  74. label_studio_sdk/types/comment_serializer_with_expanded_user.py +17 -18
  75. label_studio_sdk/types/converted_format.py +1 -1
  76. label_studio_sdk/types/converted_format_request.py +1 -1
  77. label_studio_sdk/types/export.py +8 -8
  78. label_studio_sdk/types/file_upload.py +3 -2
  79. label_studio_sdk/types/filter.py +10 -9
  80. label_studio_sdk/types/filter_group.py +4 -3
  81. label_studio_sdk/types/gcs_export_storage.py +23 -23
  82. label_studio_sdk/types/gcs_import_storage.py +27 -27
  83. label_studio_sdk/types/import_api_request.py +26 -26
  84. label_studio_sdk/types/inference_run_cost_estimate.py +10 -10
  85. label_studio_sdk/types/local_files_export_storage.py +23 -23
  86. label_studio_sdk/types/local_files_import_storage.py +26 -26
  87. label_studio_sdk/types/lse_annotation_filter_options.py +10 -10
  88. label_studio_sdk/types/lse_annotation_filter_options_request.py +10 -10
  89. label_studio_sdk/types/lse_export_create.py +12 -12
  90. label_studio_sdk/types/lse_fields.py +14 -14
  91. label_studio_sdk/types/lse_organization.py +17 -17
  92. label_studio_sdk/types/lse_organization_member_list.py +1 -1
  93. label_studio_sdk/types/lse_project_create.py +72 -72
  94. label_studio_sdk/types/lse_project_update.py +89 -89
  95. label_studio_sdk/types/lse_s3export_storage.py +46 -46
  96. label_studio_sdk/types/lse_s3export_storage_request.py +43 -43
  97. label_studio_sdk/types/lse_s3import_storage.py +53 -53
  98. label_studio_sdk/types/lse_s3import_storage_request.py +49 -49
  99. label_studio_sdk/types/lse_task.py +49 -49
  100. label_studio_sdk/types/lse_task_drafts_item.py +1 -1
  101. label_studio_sdk/types/lse_task_filter_options.py +14 -14
  102. label_studio_sdk/types/lse_task_filter_options_request.py +14 -14
  103. label_studio_sdk/types/lse_task_predictions_item.py +5 -5
  104. label_studio_sdk/types/lse_task_serializer_for_annotators.py +12 -12
  105. label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +1 -1
  106. label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +5 -5
  107. label_studio_sdk/types/lse_task_serializer_for_reviewers.py +49 -49
  108. label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +1 -1
  109. label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +5 -5
  110. label_studio_sdk/types/lse_user.py +13 -13
  111. label_studio_sdk/types/lse_user_api.py +11 -11
  112. label_studio_sdk/types/lse_user_organization_member_list.py +13 -13
  113. label_studio_sdk/types/lseapi_token_create.py +1 -1
  114. label_studio_sdk/types/lseapi_token_list.py +1 -1
  115. label_studio_sdk/types/lsejwt_settings.py +5 -5
  116. label_studio_sdk/types/ml_backend.py +27 -28
  117. label_studio_sdk/types/model_interface.py +12 -12
  118. label_studio_sdk/types/model_interface_request.py +7 -8
  119. label_studio_sdk/types/model_interface_serializer_get.py +13 -13
  120. label_studio_sdk/types/model_provider_connection.py +34 -34
  121. label_studio_sdk/types/model_provider_connection_request.py +15 -14
  122. label_studio_sdk/types/model_run.py +12 -12
  123. label_studio_sdk/types/organization_billing.py +1 -1
  124. label_studio_sdk/types/organization_id.py +2 -2
  125. label_studio_sdk/types/organization_invite.py +1 -1
  126. label_studio_sdk/types/organization_member.py +8 -9
  127. label_studio_sdk/types/organization_membership.py +2 -1
  128. label_studio_sdk/types/pause.py +23 -23
  129. label_studio_sdk/types/prediction.py +21 -21
  130. label_studio_sdk/types/prediction_request.py +16 -16
  131. label_studio_sdk/types/project.py +72 -72
  132. label_studio_sdk/types/project_group.py +22 -0
  133. label_studio_sdk/types/project_group_request.py +22 -0
  134. label_studio_sdk/types/project_group_role_enum.py +5 -0
  135. label_studio_sdk/types/project_import.py +21 -21
  136. label_studio_sdk/types/redis_export_storage.py +34 -34
  137. label_studio_sdk/types/redis_import_storage.py +37 -37
  138. label_studio_sdk/types/refined_prompt_response.py +11 -11
  139. label_studio_sdk/types/review_settings.py +29 -30
  140. label_studio_sdk/types/review_settings_request.py +29 -30
  141. label_studio_sdk/types/s3export_storage.py +45 -45
  142. label_studio_sdk/types/s3import_storage.py +44 -44
  143. label_studio_sdk/types/saml_settings.py +21 -0
  144. label_studio_sdk/types/saml_settings_update.py +22 -0
  145. label_studio_sdk/types/scim_settings.py +21 -0
  146. label_studio_sdk/types/scim_settings_update.py +22 -0
  147. label_studio_sdk/types/selected_items_request.py +1 -1
  148. label_studio_sdk/types/serialization_options.py +10 -10
  149. label_studio_sdk/types/serialization_options_request.py +10 -10
  150. label_studio_sdk/types/task_assignment.py +43 -0
  151. label_studio_sdk/types/third_party_model_version.py +11 -11
  152. label_studio_sdk/types/third_party_model_version_request.py +6 -7
  153. label_studio_sdk/types/type_enum.py +5 -0
  154. label_studio_sdk/types/user_simple.py +3 -3
  155. label_studio_sdk/types/user_simple_request.py +1 -1
  156. label_studio_sdk/types/version_response.py +19 -20
  157. label_studio_sdk/types/view.py +8 -8
  158. label_studio_sdk/types/webhook.py +16 -16
  159. label_studio_sdk/types/webhook_serializer_for_update.py +16 -16
  160. label_studio_sdk/types/workspace.py +10 -11
  161. label_studio_sdk/users/client.py +160 -160
  162. label_studio_sdk/views/client.py +164 -164
  163. label_studio_sdk/webhooks/client.py +183 -183
  164. label_studio_sdk/webhooks/types/webhooks_info_response.py +32 -32
  165. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +1 -1
  166. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +1 -1
  167. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +1 -1
  168. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +1 -1
  169. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +1 -1
  170. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +1 -1
  171. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +1 -1
  172. label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +1 -1
  173. label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +1 -1
  174. label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +1 -1
  175. label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +1 -1
  176. label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +1 -1
  177. label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +1 -1
  178. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +1 -1
  179. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +1 -1
  180. label_studio_sdk/workspaces/client.py +40 -40
  181. {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.3.dist-info}/METADATA +1 -1
  182. {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.3.dist-info}/RECORD +184 -150
  183. {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.3.dist-info}/LICENSE +0 -0
  184. {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.3.dist-info}/WHEEL +0 -0
@@ -27,6 +27,7 @@ from .tokens.client import TokensClient
27
27
  from .versions.client import VersionsClient
28
28
  from .webhooks.client import WebhooksClient
29
29
  from .workspaces.client import WorkspacesClient
30
+ from .sso.client import SsoClient
30
31
  from .core.client_wrapper import AsyncClientWrapper
31
32
  from .annotations.client import AsyncAnnotationsClient
32
33
  from .billing.client import AsyncBillingClient
@@ -49,6 +50,7 @@ from .tokens.client import AsyncTokensClient
49
50
  from .versions.client import AsyncVersionsClient
50
51
  from .webhooks.client import AsyncWebhooksClient
51
52
  from .workspaces.client import AsyncWorkspacesClient
53
+ from .sso.client import AsyncSsoClient
52
54
 
53
55
 
54
56
  class LabelStudioBase:
@@ -134,6 +136,7 @@ class LabelStudioBase:
134
136
  self.versions = VersionsClient(client_wrapper=self._client_wrapper)
135
137
  self.webhooks = WebhooksClient(client_wrapper=self._client_wrapper)
136
138
  self.workspaces = WorkspacesClient(client_wrapper=self._client_wrapper)
139
+ self.sso = SsoClient(client_wrapper=self._client_wrapper)
137
140
 
138
141
 
139
142
  class AsyncLabelStudioBase:
@@ -219,6 +222,7 @@ class AsyncLabelStudioBase:
219
222
  self.versions = AsyncVersionsClient(client_wrapper=self._client_wrapper)
220
223
  self.webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper)
221
224
  self.workspaces = AsyncWorkspacesClient(client_wrapper=self._client_wrapper)
225
+ self.sso = AsyncSsoClient(client_wrapper=self._client_wrapper)
222
226
 
223
227
 
224
228
  def _get_base_url(*, base_url: typing.Optional[str] = None, environment: LabelStudioEnvironment) -> str:
@@ -95,12 +95,12 @@ class CommentsClient:
95
95
  self,
96
96
  *,
97
97
  expand_created_by: typing.Optional[bool] = None,
98
- region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
98
+ annotation: typing.Optional[int] = OMIT,
99
99
  classifications: typing.Optional[typing.Optional[typing.Any]] = OMIT,
100
- text: typing.Optional[str] = OMIT,
101
- is_resolved: typing.Optional[bool] = OMIT,
102
100
  draft: typing.Optional[int] = OMIT,
103
- annotation: typing.Optional[int] = OMIT,
101
+ is_resolved: typing.Optional[bool] = OMIT,
102
+ region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
103
+ text: typing.Optional[str] = OMIT,
104
104
  request_options: typing.Optional[RequestOptions] = None,
105
105
  ) -> MaybeExpandedComment:
106
106
  """
@@ -111,19 +111,19 @@ class CommentsClient:
111
111
  expand_created_by : typing.Optional[bool]
112
112
  Expand the created_by field
113
113
 
114
- region_ref : typing.Optional[typing.Optional[typing.Any]]
114
+ annotation : typing.Optional[int]
115
115
 
116
116
  classifications : typing.Optional[typing.Optional[typing.Any]]
117
117
 
118
- text : typing.Optional[str]
119
- Reviewer or annotator comment
118
+ draft : typing.Optional[int]
120
119
 
121
120
  is_resolved : typing.Optional[bool]
122
121
  True if the comment is resolved
123
122
 
124
- draft : typing.Optional[int]
123
+ region_ref : typing.Optional[typing.Optional[typing.Any]]
125
124
 
126
- annotation : typing.Optional[int]
125
+ text : typing.Optional[str]
126
+ Reviewer or annotator comment
127
127
 
128
128
  request_options : typing.Optional[RequestOptions]
129
129
  Request-specific configuration.
@@ -149,12 +149,12 @@ class CommentsClient:
149
149
  "expand_created_by": expand_created_by,
150
150
  },
151
151
  json={
152
- "region_ref": region_ref,
152
+ "annotation": annotation,
153
153
  "classifications": classifications,
154
- "text": text,
155
- "is_resolved": is_resolved,
156
154
  "draft": draft,
157
- "annotation": annotation,
155
+ "is_resolved": is_resolved,
156
+ "region_ref": region_ref,
157
+ "text": text,
158
158
  },
159
159
  request_options=request_options,
160
160
  omit=OMIT,
@@ -173,6 +173,68 @@ class CommentsClient:
173
173
  raise ApiError(status_code=_response.status_code, body=_response.text)
174
174
  raise ApiError(status_code=_response.status_code, body=_response_json)
175
175
 
176
+ def export(
177
+ self,
178
+ *,
179
+ annotation: typing.Optional[int] = None,
180
+ annotators: typing.Optional[str] = None,
181
+ draft: typing.Optional[int] = None,
182
+ expand_created_by: typing.Optional[bool] = None,
183
+ projects: typing.Optional[str] = None,
184
+ tz: typing.Optional[str] = None,
185
+ request_options: typing.Optional[RequestOptions] = None,
186
+ ) -> typing.Iterator[bytes]:
187
+ """
188
+ Export comments to CSV file
189
+
190
+ Parameters
191
+ ----------
192
+ annotation : typing.Optional[int]
193
+
194
+ annotators : typing.Optional[str]
195
+
196
+ draft : typing.Optional[int]
197
+
198
+ expand_created_by : typing.Optional[bool]
199
+
200
+ projects : typing.Optional[str]
201
+
202
+ tz : typing.Optional[str]
203
+ Timezone in which to export the data. Format IANA timezone name, e.g. "America/New_York"
204
+
205
+ request_options : typing.Optional[RequestOptions]
206
+ Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
207
+
208
+ Yields
209
+ ------
210
+ typing.Iterator[bytes]
211
+ CSV file with comments
212
+ """
213
+ with self._client_wrapper.httpx_client.stream(
214
+ "api/comments/export/",
215
+ method="GET",
216
+ params={
217
+ "annotation": annotation,
218
+ "annotators": annotators,
219
+ "draft": draft,
220
+ "expand_created_by": expand_created_by,
221
+ "projects": projects,
222
+ "tz": tz,
223
+ },
224
+ request_options=request_options,
225
+ ) as _response:
226
+ try:
227
+ if 200 <= _response.status_code < 300:
228
+ _chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
229
+ for _chunk in _response.iter_bytes(chunk_size=_chunk_size):
230
+ yield _chunk
231
+ return
232
+ _response.read()
233
+ _response_json = _response.json()
234
+ except JSONDecodeError:
235
+ raise ApiError(status_code=_response.status_code, body=_response.text)
236
+ raise ApiError(status_code=_response.status_code, body=_response_json)
237
+
176
238
  def get(
177
239
  self,
178
240
  id: str,
@@ -287,12 +349,12 @@ class CommentsClient:
287
349
  id: str,
288
350
  *,
289
351
  expand_created_by: typing.Optional[bool] = None,
290
- region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
352
+ annotation: typing.Optional[int] = OMIT,
291
353
  classifications: typing.Optional[typing.Optional[typing.Any]] = OMIT,
292
- text: typing.Optional[str] = OMIT,
293
- is_resolved: typing.Optional[bool] = OMIT,
294
354
  draft: typing.Optional[int] = OMIT,
295
- annotation: typing.Optional[int] = OMIT,
355
+ is_resolved: typing.Optional[bool] = OMIT,
356
+ region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
357
+ text: typing.Optional[str] = OMIT,
296
358
  request_options: typing.Optional[RequestOptions] = None,
297
359
  ) -> MaybeExpandedComment:
298
360
  """
@@ -305,19 +367,19 @@ class CommentsClient:
305
367
  expand_created_by : typing.Optional[bool]
306
368
  Expand the created_by field
307
369
 
308
- region_ref : typing.Optional[typing.Optional[typing.Any]]
370
+ annotation : typing.Optional[int]
309
371
 
310
372
  classifications : typing.Optional[typing.Optional[typing.Any]]
311
373
 
312
- text : typing.Optional[str]
313
- Reviewer or annotator comment
374
+ draft : typing.Optional[int]
314
375
 
315
376
  is_resolved : typing.Optional[bool]
316
377
  True if the comment is resolved
317
378
 
318
- draft : typing.Optional[int]
379
+ region_ref : typing.Optional[typing.Optional[typing.Any]]
319
380
 
320
- annotation : typing.Optional[int]
381
+ text : typing.Optional[str]
382
+ Reviewer or annotator comment
321
383
 
322
384
  request_options : typing.Optional[RequestOptions]
323
385
  Request-specific configuration.
@@ -345,12 +407,12 @@ class CommentsClient:
345
407
  "expand_created_by": expand_created_by,
346
408
  },
347
409
  json={
348
- "region_ref": region_ref,
410
+ "annotation": annotation,
349
411
  "classifications": classifications,
350
- "text": text,
351
- "is_resolved": is_resolved,
352
412
  "draft": draft,
353
- "annotation": annotation,
413
+ "is_resolved": is_resolved,
414
+ "region_ref": region_ref,
415
+ "text": text,
354
416
  },
355
417
  headers={
356
418
  "content-type": "application/json",
@@ -372,68 +434,6 @@ class CommentsClient:
372
434
  raise ApiError(status_code=_response.status_code, body=_response.text)
373
435
  raise ApiError(status_code=_response.status_code, body=_response_json)
374
436
 
375
- def export(
376
- self,
377
- *,
378
- annotation: typing.Optional[int] = None,
379
- annotators: typing.Optional[str] = None,
380
- draft: typing.Optional[int] = None,
381
- expand_created_by: typing.Optional[bool] = None,
382
- projects: typing.Optional[str] = None,
383
- tz: typing.Optional[str] = None,
384
- request_options: typing.Optional[RequestOptions] = None,
385
- ) -> typing.Iterator[bytes]:
386
- """
387
- Export comments to CSV file
388
-
389
- Parameters
390
- ----------
391
- annotation : typing.Optional[int]
392
-
393
- annotators : typing.Optional[str]
394
-
395
- draft : typing.Optional[int]
396
-
397
- expand_created_by : typing.Optional[bool]
398
-
399
- projects : typing.Optional[str]
400
-
401
- tz : typing.Optional[str]
402
- Timezone in which to export the data. Format IANA timezone name, e.g. "America/New_York"
403
-
404
- request_options : typing.Optional[RequestOptions]
405
- Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
406
-
407
- Yields
408
- ------
409
- typing.Iterator[bytes]
410
- CSV file with comments
411
- """
412
- with self._client_wrapper.httpx_client.stream(
413
- "api/comments/export/",
414
- method="GET",
415
- params={
416
- "annotation": annotation,
417
- "annotators": annotators,
418
- "draft": draft,
419
- "expand_created_by": expand_created_by,
420
- "projects": projects,
421
- "tz": tz,
422
- },
423
- request_options=request_options,
424
- ) as _response:
425
- try:
426
- if 200 <= _response.status_code < 300:
427
- _chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
428
- for _chunk in _response.iter_bytes(chunk_size=_chunk_size):
429
- yield _chunk
430
- return
431
- _response.read()
432
- _response_json = _response.json()
433
- except JSONDecodeError:
434
- raise ApiError(status_code=_response.status_code, body=_response.text)
435
- raise ApiError(status_code=_response.status_code, body=_response_json)
436
-
437
437
 
438
438
  class AsyncCommentsClient:
439
439
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -524,12 +524,12 @@ class AsyncCommentsClient:
524
524
  self,
525
525
  *,
526
526
  expand_created_by: typing.Optional[bool] = None,
527
- region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
527
+ annotation: typing.Optional[int] = OMIT,
528
528
  classifications: typing.Optional[typing.Optional[typing.Any]] = OMIT,
529
- text: typing.Optional[str] = OMIT,
530
- is_resolved: typing.Optional[bool] = OMIT,
531
529
  draft: typing.Optional[int] = OMIT,
532
- annotation: typing.Optional[int] = OMIT,
530
+ is_resolved: typing.Optional[bool] = OMIT,
531
+ region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
532
+ text: typing.Optional[str] = OMIT,
533
533
  request_options: typing.Optional[RequestOptions] = None,
534
534
  ) -> MaybeExpandedComment:
535
535
  """
@@ -540,19 +540,19 @@ class AsyncCommentsClient:
540
540
  expand_created_by : typing.Optional[bool]
541
541
  Expand the created_by field
542
542
 
543
- region_ref : typing.Optional[typing.Optional[typing.Any]]
543
+ annotation : typing.Optional[int]
544
544
 
545
545
  classifications : typing.Optional[typing.Optional[typing.Any]]
546
546
 
547
- text : typing.Optional[str]
548
- Reviewer or annotator comment
547
+ draft : typing.Optional[int]
549
548
 
550
549
  is_resolved : typing.Optional[bool]
551
550
  True if the comment is resolved
552
551
 
553
- draft : typing.Optional[int]
552
+ region_ref : typing.Optional[typing.Optional[typing.Any]]
554
553
 
555
- annotation : typing.Optional[int]
554
+ text : typing.Optional[str]
555
+ Reviewer or annotator comment
556
556
 
557
557
  request_options : typing.Optional[RequestOptions]
558
558
  Request-specific configuration.
@@ -586,12 +586,12 @@ class AsyncCommentsClient:
586
586
  "expand_created_by": expand_created_by,
587
587
  },
588
588
  json={
589
- "region_ref": region_ref,
589
+ "annotation": annotation,
590
590
  "classifications": classifications,
591
- "text": text,
592
- "is_resolved": is_resolved,
593
591
  "draft": draft,
594
- "annotation": annotation,
592
+ "is_resolved": is_resolved,
593
+ "region_ref": region_ref,
594
+ "text": text,
595
595
  },
596
596
  request_options=request_options,
597
597
  omit=OMIT,
@@ -610,6 +610,68 @@ class AsyncCommentsClient:
610
610
  raise ApiError(status_code=_response.status_code, body=_response.text)
611
611
  raise ApiError(status_code=_response.status_code, body=_response_json)
612
612
 
613
+ async def export(
614
+ self,
615
+ *,
616
+ annotation: typing.Optional[int] = None,
617
+ annotators: typing.Optional[str] = None,
618
+ draft: typing.Optional[int] = None,
619
+ expand_created_by: typing.Optional[bool] = None,
620
+ projects: typing.Optional[str] = None,
621
+ tz: typing.Optional[str] = None,
622
+ request_options: typing.Optional[RequestOptions] = None,
623
+ ) -> typing.AsyncIterator[bytes]:
624
+ """
625
+ Export comments to CSV file
626
+
627
+ Parameters
628
+ ----------
629
+ annotation : typing.Optional[int]
630
+
631
+ annotators : typing.Optional[str]
632
+
633
+ draft : typing.Optional[int]
634
+
635
+ expand_created_by : typing.Optional[bool]
636
+
637
+ projects : typing.Optional[str]
638
+
639
+ tz : typing.Optional[str]
640
+ Timezone in which to export the data. Format IANA timezone name, e.g. "America/New_York"
641
+
642
+ request_options : typing.Optional[RequestOptions]
643
+ Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
644
+
645
+ Yields
646
+ ------
647
+ typing.AsyncIterator[bytes]
648
+ CSV file with comments
649
+ """
650
+ async with self._client_wrapper.httpx_client.stream(
651
+ "api/comments/export/",
652
+ method="GET",
653
+ params={
654
+ "annotation": annotation,
655
+ "annotators": annotators,
656
+ "draft": draft,
657
+ "expand_created_by": expand_created_by,
658
+ "projects": projects,
659
+ "tz": tz,
660
+ },
661
+ request_options=request_options,
662
+ ) as _response:
663
+ try:
664
+ if 200 <= _response.status_code < 300:
665
+ _chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
666
+ async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size):
667
+ yield _chunk
668
+ return
669
+ await _response.aread()
670
+ _response_json = _response.json()
671
+ except JSONDecodeError:
672
+ raise ApiError(status_code=_response.status_code, body=_response.text)
673
+ raise ApiError(status_code=_response.status_code, body=_response_json)
674
+
613
675
  async def get(
614
676
  self,
615
677
  id: str,
@@ -740,12 +802,12 @@ class AsyncCommentsClient:
740
802
  id: str,
741
803
  *,
742
804
  expand_created_by: typing.Optional[bool] = None,
743
- region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
805
+ annotation: typing.Optional[int] = OMIT,
744
806
  classifications: typing.Optional[typing.Optional[typing.Any]] = OMIT,
745
- text: typing.Optional[str] = OMIT,
746
- is_resolved: typing.Optional[bool] = OMIT,
747
807
  draft: typing.Optional[int] = OMIT,
748
- annotation: typing.Optional[int] = OMIT,
808
+ is_resolved: typing.Optional[bool] = OMIT,
809
+ region_ref: typing.Optional[typing.Optional[typing.Any]] = OMIT,
810
+ text: typing.Optional[str] = OMIT,
749
811
  request_options: typing.Optional[RequestOptions] = None,
750
812
  ) -> MaybeExpandedComment:
751
813
  """
@@ -758,19 +820,19 @@ class AsyncCommentsClient:
758
820
  expand_created_by : typing.Optional[bool]
759
821
  Expand the created_by field
760
822
 
761
- region_ref : typing.Optional[typing.Optional[typing.Any]]
823
+ annotation : typing.Optional[int]
762
824
 
763
825
  classifications : typing.Optional[typing.Optional[typing.Any]]
764
826
 
765
- text : typing.Optional[str]
766
- Reviewer or annotator comment
827
+ draft : typing.Optional[int]
767
828
 
768
829
  is_resolved : typing.Optional[bool]
769
830
  True if the comment is resolved
770
831
 
771
- draft : typing.Optional[int]
832
+ region_ref : typing.Optional[typing.Optional[typing.Any]]
772
833
 
773
- annotation : typing.Optional[int]
834
+ text : typing.Optional[str]
835
+ Reviewer or annotator comment
774
836
 
775
837
  request_options : typing.Optional[RequestOptions]
776
838
  Request-specific configuration.
@@ -806,12 +868,12 @@ class AsyncCommentsClient:
806
868
  "expand_created_by": expand_created_by,
807
869
  },
808
870
  json={
809
- "region_ref": region_ref,
871
+ "annotation": annotation,
810
872
  "classifications": classifications,
811
- "text": text,
812
- "is_resolved": is_resolved,
813
873
  "draft": draft,
814
- "annotation": annotation,
874
+ "is_resolved": is_resolved,
875
+ "region_ref": region_ref,
876
+ "text": text,
815
877
  },
816
878
  headers={
817
879
  "content-type": "application/json",
@@ -832,65 +894,3 @@ class AsyncCommentsClient:
832
894
  except JSONDecodeError:
833
895
  raise ApiError(status_code=_response.status_code, body=_response.text)
834
896
  raise ApiError(status_code=_response.status_code, body=_response_json)
835
-
836
- async def export(
837
- self,
838
- *,
839
- annotation: typing.Optional[int] = None,
840
- annotators: typing.Optional[str] = None,
841
- draft: typing.Optional[int] = None,
842
- expand_created_by: typing.Optional[bool] = None,
843
- projects: typing.Optional[str] = None,
844
- tz: typing.Optional[str] = None,
845
- request_options: typing.Optional[RequestOptions] = None,
846
- ) -> typing.AsyncIterator[bytes]:
847
- """
848
- Export comments to CSV file
849
-
850
- Parameters
851
- ----------
852
- annotation : typing.Optional[int]
853
-
854
- annotators : typing.Optional[str]
855
-
856
- draft : typing.Optional[int]
857
-
858
- expand_created_by : typing.Optional[bool]
859
-
860
- projects : typing.Optional[str]
861
-
862
- tz : typing.Optional[str]
863
- Timezone in which to export the data. Format IANA timezone name, e.g. "America/New_York"
864
-
865
- request_options : typing.Optional[RequestOptions]
866
- Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
867
-
868
- Yields
869
- ------
870
- typing.AsyncIterator[bytes]
871
- CSV file with comments
872
- """
873
- async with self._client_wrapper.httpx_client.stream(
874
- "api/comments/export/",
875
- method="GET",
876
- params={
877
- "annotation": annotation,
878
- "annotators": annotators,
879
- "draft": draft,
880
- "expand_created_by": expand_created_by,
881
- "projects": projects,
882
- "tz": tz,
883
- },
884
- request_options=request_options,
885
- ) as _response:
886
- try:
887
- if 200 <= _response.status_code < 300:
888
- _chunk_size = request_options.get("chunk_size", None) if request_options is not None else None
889
- async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size):
890
- yield _chunk
891
- return
892
- await _response.aread()
893
- _response_json = _response.json()
894
- except JSONDecodeError:
895
- raise ApiError(status_code=_response.status_code, body=_response.text)
896
- raise ApiError(status_code=_response.status_code, body=_response_json)