label-studio-sdk 2.0.0__py3-none-any.whl → 2.0.2__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (175) hide show
  1. label_studio_sdk/__init__.py +24 -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/billing/__init__.py +2 -0
  8. label_studio_sdk/billing/client.py +112 -0
  9. label_studio_sdk/comments/client.py +176 -176
  10. label_studio_sdk/export_storage/azure/client.py +274 -274
  11. label_studio_sdk/export_storage/gcs/client.py +263 -263
  12. label_studio_sdk/export_storage/local/client.py +206 -206
  13. label_studio_sdk/export_storage/redis/client.py +287 -287
  14. label_studio_sdk/export_storage/s3/client.py +347 -347
  15. label_studio_sdk/export_storage/s3s/client.py +678 -678
  16. label_studio_sdk/import_storage/azure/client.py +357 -357
  17. label_studio_sdk/import_storage/gcs/client.py +357 -357
  18. label_studio_sdk/import_storage/local/client.py +206 -206
  19. label_studio_sdk/import_storage/redis/client.py +309 -309
  20. label_studio_sdk/import_storage/s3/client.py +452 -452
  21. label_studio_sdk/import_storage/s3s/client.py +735 -735
  22. label_studio_sdk/jwt_settings/client.py +10 -10
  23. label_studio_sdk/ml/client.py +118 -118
  24. label_studio_sdk/ml/types/ml_list_model_versions_response.py +1 -1
  25. label_studio_sdk/model_providers/client.py +181 -181
  26. label_studio_sdk/organizations/members/client.py +348 -2
  27. label_studio_sdk/predictions/client.py +60 -60
  28. label_studio_sdk/projects/__init__.py +30 -1
  29. label_studio_sdk/projects/assignments/__init__.py +33 -0
  30. label_studio_sdk/projects/assignments/client.py +764 -0
  31. label_studio_sdk/projects/assignments/types/__init__.py +35 -0
  32. label_studio_sdk/projects/assignments/types/assignments_assign_request_type.py +5 -0
  33. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters.py +33 -0
  34. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_conjunction.py +5 -0
  35. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item.py +44 -0
  36. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_filter.py +31 -0
  37. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_operator.py +23 -0
  38. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_value.py +7 -0
  39. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items.py +9 -0
  40. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_excluded.py +29 -0
  41. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_included.py +29 -0
  42. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_type.py +5 -0
  43. label_studio_sdk/projects/assignments/types/assignments_bulk_assign_response.py +22 -0
  44. label_studio_sdk/projects/assignments/types/assignments_update_request_type.py +5 -0
  45. label_studio_sdk/projects/client.py +441 -425
  46. label_studio_sdk/projects/exports/client.py +55 -55
  47. label_studio_sdk/projects/exports/types/exports_convert_response.py +1 -1
  48. label_studio_sdk/projects/stats/types/stats_iaa_response.py +5 -5
  49. label_studio_sdk/projects/types/projects_import_tasks_response.py +12 -12
  50. label_studio_sdk/prompts/client.py +211 -211
  51. label_studio_sdk/prompts/runs/client.py +33 -33
  52. label_studio_sdk/prompts/versions/client.py +72 -72
  53. label_studio_sdk/tasks/client.py +174 -174
  54. label_studio_sdk/types/__init__.py +22 -0
  55. label_studio_sdk/types/all_roles_project_list.py +98 -98
  56. label_studio_sdk/types/annotation.py +35 -35
  57. label_studio_sdk/types/annotation_request.py +27 -27
  58. label_studio_sdk/types/azure_blob_export_storage.py +29 -29
  59. label_studio_sdk/types/azure_blob_import_storage.py +33 -33
  60. label_studio_sdk/types/batch_failed_predictions.py +1 -1
  61. label_studio_sdk/types/billing_checks.py +39 -0
  62. label_studio_sdk/types/billing_flags.py +44 -0
  63. label_studio_sdk/types/billing_info_response.py +22 -0
  64. label_studio_sdk/types/blueprint_list.py +7 -8
  65. label_studio_sdk/types/child_filter.py +11 -10
  66. label_studio_sdk/types/comment.py +15 -15
  67. label_studio_sdk/types/comment_request.py +7 -8
  68. label_studio_sdk/types/comment_serializer_with_expanded_user.py +17 -18
  69. label_studio_sdk/types/converted_format.py +1 -1
  70. label_studio_sdk/types/converted_format_request.py +1 -1
  71. label_studio_sdk/types/count_limit.py +22 -0
  72. label_studio_sdk/types/export.py +8 -8
  73. label_studio_sdk/types/file_upload.py +3 -2
  74. label_studio_sdk/types/filter.py +10 -9
  75. label_studio_sdk/types/filter_group.py +4 -3
  76. label_studio_sdk/types/gcs_export_storage.py +23 -23
  77. label_studio_sdk/types/gcs_import_storage.py +27 -27
  78. label_studio_sdk/types/import_api_request.py +26 -26
  79. label_studio_sdk/types/inference_run_cost_estimate.py +10 -10
  80. label_studio_sdk/types/local_files_export_storage.py +23 -23
  81. label_studio_sdk/types/local_files_import_storage.py +26 -26
  82. label_studio_sdk/types/lse_annotation_filter_options.py +10 -10
  83. label_studio_sdk/types/lse_annotation_filter_options_request.py +10 -10
  84. label_studio_sdk/types/lse_export_create.py +12 -12
  85. label_studio_sdk/types/lse_fields.py +14 -14
  86. label_studio_sdk/types/lse_organization.py +17 -17
  87. label_studio_sdk/types/lse_organization_member_list.py +32 -0
  88. label_studio_sdk/types/lse_project_create.py +72 -72
  89. label_studio_sdk/types/lse_project_update.py +89 -89
  90. label_studio_sdk/types/lse_s3export_storage.py +46 -46
  91. label_studio_sdk/types/lse_s3export_storage_request.py +43 -43
  92. label_studio_sdk/types/lse_s3import_storage.py +53 -53
  93. label_studio_sdk/types/lse_s3import_storage_request.py +49 -49
  94. label_studio_sdk/types/lse_task.py +49 -49
  95. label_studio_sdk/types/lse_task_drafts_item.py +1 -1
  96. label_studio_sdk/types/lse_task_filter_options.py +14 -14
  97. label_studio_sdk/types/lse_task_filter_options_request.py +14 -14
  98. label_studio_sdk/types/lse_task_predictions_item.py +5 -5
  99. label_studio_sdk/types/lse_task_serializer_for_annotators.py +12 -12
  100. label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +1 -1
  101. label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +5 -5
  102. label_studio_sdk/types/lse_task_serializer_for_reviewers.py +49 -49
  103. label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +1 -1
  104. label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +5 -5
  105. label_studio_sdk/types/lse_user.py +13 -13
  106. label_studio_sdk/types/lse_user_api.py +11 -11
  107. label_studio_sdk/types/lse_user_organization_member_list.py +48 -0
  108. label_studio_sdk/types/lseapi_token_create.py +1 -1
  109. label_studio_sdk/types/lseapi_token_list.py +1 -1
  110. label_studio_sdk/types/lsejwt_settings.py +5 -5
  111. label_studio_sdk/types/ml_backend.py +27 -28
  112. label_studio_sdk/types/model_interface.py +12 -12
  113. label_studio_sdk/types/model_interface_request.py +7 -8
  114. label_studio_sdk/types/model_interface_serializer_get.py +13 -13
  115. label_studio_sdk/types/model_provider_connection.py +34 -34
  116. label_studio_sdk/types/model_provider_connection_request.py +15 -14
  117. label_studio_sdk/types/model_run.py +12 -12
  118. label_studio_sdk/types/organization_billing.py +1 -1
  119. label_studio_sdk/types/organization_id.py +2 -2
  120. label_studio_sdk/types/organization_invite.py +1 -1
  121. label_studio_sdk/types/organization_member.py +8 -9
  122. label_studio_sdk/types/organization_membership.py +2 -1
  123. label_studio_sdk/types/paginated_lse_organization_member_list_list.py +23 -0
  124. label_studio_sdk/types/pause.py +23 -23
  125. label_studio_sdk/types/prediction.py +21 -21
  126. label_studio_sdk/types/prediction_request.py +16 -16
  127. label_studio_sdk/types/project.py +72 -72
  128. label_studio_sdk/types/project_import.py +21 -21
  129. label_studio_sdk/types/prompts_status_enum.py +16 -0
  130. label_studio_sdk/types/redis_export_storage.py +34 -34
  131. label_studio_sdk/types/redis_import_storage.py +37 -37
  132. label_studio_sdk/types/refined_prompt_response.py +11 -11
  133. label_studio_sdk/types/review_settings.py +29 -30
  134. label_studio_sdk/types/review_settings_request.py +29 -30
  135. label_studio_sdk/types/role9e7enum.py +5 -0
  136. label_studio_sdk/types/s3export_storage.py +45 -45
  137. label_studio_sdk/types/s3import_storage.py +44 -44
  138. label_studio_sdk/types/selected_items_request.py +1 -1
  139. label_studio_sdk/types/serialization_options.py +10 -10
  140. label_studio_sdk/types/serialization_options_request.py +10 -10
  141. label_studio_sdk/types/task_assignment.py +43 -0
  142. label_studio_sdk/types/third_party_model_version.py +11 -11
  143. label_studio_sdk/types/third_party_model_version_request.py +6 -7
  144. label_studio_sdk/types/type_enum.py +5 -0
  145. label_studio_sdk/types/user_simple.py +3 -3
  146. label_studio_sdk/types/user_simple_request.py +1 -1
  147. label_studio_sdk/types/version_response.py +19 -20
  148. label_studio_sdk/types/view.py +8 -8
  149. label_studio_sdk/types/webhook.py +16 -16
  150. label_studio_sdk/types/webhook_serializer_for_update.py +16 -16
  151. label_studio_sdk/types/workspace.py +10 -11
  152. label_studio_sdk/users/client.py +160 -160
  153. label_studio_sdk/views/client.py +164 -164
  154. label_studio_sdk/webhooks/client.py +183 -183
  155. label_studio_sdk/webhooks/types/webhooks_info_response.py +32 -32
  156. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +1 -1
  157. label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +1 -1
  158. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +1 -1
  159. label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +1 -1
  160. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +1 -1
  161. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +1 -1
  162. label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +1 -1
  163. label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +1 -1
  164. label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +1 -1
  165. label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +1 -1
  166. label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +1 -1
  167. label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +1 -1
  168. label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +1 -1
  169. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +1 -1
  170. label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +1 -1
  171. label_studio_sdk/workspaces/client.py +40 -40
  172. {label_studio_sdk-2.0.0.dist-info → label_studio_sdk-2.0.2.dist-info}/METADATA +73 -25
  173. {label_studio_sdk-2.0.0.dist-info → label_studio_sdk-2.0.2.dist-info}/RECORD +175 -146
  174. {label_studio_sdk-2.0.0.dist-info → label_studio_sdk-2.0.2.dist-info}/LICENSE +0 -0
  175. {label_studio_sdk-2.0.0.dist-info → label_studio_sdk-2.0.2.dist-info}/WHEEL +0 -0
@@ -7,6 +7,7 @@ import httpx
7
7
  from .core.api_error import ApiError
8
8
  from .core.client_wrapper import SyncClientWrapper
9
9
  from .annotations.client import AnnotationsClient
10
+ from .billing.client import BillingClient
10
11
  from .comments.client import CommentsClient
11
12
  from .users.client import UsersClient
12
13
  from .actions.client import ActionsClient
@@ -28,6 +29,7 @@ from .webhooks.client import WebhooksClient
28
29
  from .workspaces.client import WorkspacesClient
29
30
  from .core.client_wrapper import AsyncClientWrapper
30
31
  from .annotations.client import AsyncAnnotationsClient
32
+ from .billing.client import AsyncBillingClient
31
33
  from .comments.client import AsyncCommentsClient
32
34
  from .users.client import AsyncUsersClient
33
35
  from .actions.client import AsyncActionsClient
@@ -112,6 +114,7 @@ class LabelStudioBase:
112
114
  timeout=_defaulted_timeout,
113
115
  )
114
116
  self.annotations = AnnotationsClient(client_wrapper=self._client_wrapper)
117
+ self.billing = BillingClient(client_wrapper=self._client_wrapper)
115
118
  self.comments = CommentsClient(client_wrapper=self._client_wrapper)
116
119
  self.users = UsersClient(client_wrapper=self._client_wrapper)
117
120
  self.actions = ActionsClient(client_wrapper=self._client_wrapper)
@@ -196,6 +199,7 @@ class AsyncLabelStudioBase:
196
199
  timeout=_defaulted_timeout,
197
200
  )
198
201
  self.annotations = AsyncAnnotationsClient(client_wrapper=self._client_wrapper)
202
+ self.billing = AsyncBillingClient(client_wrapper=self._client_wrapper)
199
203
  self.comments = AsyncCommentsClient(client_wrapper=self._client_wrapper)
200
204
  self.users = AsyncUsersClient(client_wrapper=self._client_wrapper)
201
205
  self.actions = AsyncActionsClient(client_wrapper=self._client_wrapper)
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
@@ -0,0 +1,112 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.client_wrapper import SyncClientWrapper
4
+ import typing
5
+ from ..core.request_options import RequestOptions
6
+ from ..types.billing_info_response import BillingInfoResponse
7
+ from ..core.unchecked_base_model import construct_type
8
+ from json.decoder import JSONDecodeError
9
+ from ..core.api_error import ApiError
10
+ from ..core.client_wrapper import AsyncClientWrapper
11
+
12
+
13
+ class BillingClient:
14
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
15
+ self._client_wrapper = client_wrapper
16
+
17
+ def info(self, *, request_options: typing.Optional[RequestOptions] = None) -> BillingInfoResponse:
18
+ """
19
+ Retrieve billing checks and feature flags for the active organization.
20
+
21
+ Parameters
22
+ ----------
23
+ request_options : typing.Optional[RequestOptions]
24
+ Request-specific configuration.
25
+
26
+ Returns
27
+ -------
28
+ BillingInfoResponse
29
+ Billing information for the active organization
30
+
31
+ Examples
32
+ --------
33
+ from label_studio_sdk import LabelStudio
34
+
35
+ client = LabelStudio(
36
+ api_key="YOUR_API_KEY",
37
+ )
38
+ client.billing.info()
39
+ """
40
+ _response = self._client_wrapper.httpx_client.request(
41
+ "api/billing/info",
42
+ method="GET",
43
+ request_options=request_options,
44
+ )
45
+ try:
46
+ if 200 <= _response.status_code < 300:
47
+ return typing.cast(
48
+ BillingInfoResponse,
49
+ construct_type(
50
+ type_=BillingInfoResponse, # type: ignore
51
+ object_=_response.json(),
52
+ ),
53
+ )
54
+ _response_json = _response.json()
55
+ except JSONDecodeError:
56
+ raise ApiError(status_code=_response.status_code, body=_response.text)
57
+ raise ApiError(status_code=_response.status_code, body=_response_json)
58
+
59
+
60
+ class AsyncBillingClient:
61
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
62
+ self._client_wrapper = client_wrapper
63
+
64
+ async def info(self, *, request_options: typing.Optional[RequestOptions] = None) -> BillingInfoResponse:
65
+ """
66
+ Retrieve billing checks and feature flags for the active organization.
67
+
68
+ Parameters
69
+ ----------
70
+ request_options : typing.Optional[RequestOptions]
71
+ Request-specific configuration.
72
+
73
+ Returns
74
+ -------
75
+ BillingInfoResponse
76
+ Billing information for the active organization
77
+
78
+ Examples
79
+ --------
80
+ import asyncio
81
+
82
+ from label_studio_sdk import AsyncLabelStudio
83
+
84
+ client = AsyncLabelStudio(
85
+ api_key="YOUR_API_KEY",
86
+ )
87
+
88
+
89
+ async def main() -> None:
90
+ await client.billing.info()
91
+
92
+
93
+ asyncio.run(main())
94
+ """
95
+ _response = await self._client_wrapper.httpx_client.request(
96
+ "api/billing/info",
97
+ method="GET",
98
+ request_options=request_options,
99
+ )
100
+ try:
101
+ if 200 <= _response.status_code < 300:
102
+ return typing.cast(
103
+ BillingInfoResponse,
104
+ construct_type(
105
+ type_=BillingInfoResponse, # type: ignore
106
+ object_=_response.json(),
107
+ ),
108
+ )
109
+ _response_json = _response.json()
110
+ except JSONDecodeError:
111
+ raise ApiError(status_code=_response.status_code, body=_response.text)
112
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -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)