label-studio-sdk 1.0.3__py3-none-any.whl → 1.0.5__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.
- label_studio_sdk/__init__.py +10 -0
- label_studio_sdk/actions/client.py +8 -8
- label_studio_sdk/annotations/client.py +24 -24
- label_studio_sdk/base_client.py +3 -0
- label_studio_sdk/core/client_wrapper.py +1 -1
- label_studio_sdk/core/http_client.py +36 -8
- label_studio_sdk/core/request_options.py +2 -2
- label_studio_sdk/export_storage/__init__.py +2 -1
- label_studio_sdk/export_storage/azure/client.py +28 -28
- label_studio_sdk/export_storage/client.py +7 -4
- label_studio_sdk/export_storage/gcs/client.py +28 -28
- label_studio_sdk/export_storage/local/client.py +28 -28
- label_studio_sdk/export_storage/redis/client.py +28 -28
- label_studio_sdk/export_storage/s3/client.py +28 -28
- label_studio_sdk/export_storage/s3s/__init__.py +2 -0
- label_studio_sdk/export_storage/s3s/client.py +836 -0
- label_studio_sdk/files/client.py +24 -24
- label_studio_sdk/import_storage/__init__.py +2 -1
- label_studio_sdk/import_storage/azure/client.py +28 -28
- label_studio_sdk/import_storage/client.py +7 -4
- label_studio_sdk/import_storage/gcs/client.py +28 -28
- label_studio_sdk/import_storage/local/client.py +28 -28
- label_studio_sdk/import_storage/redis/client.py +28 -28
- label_studio_sdk/import_storage/s3/client.py +28 -28
- label_studio_sdk/import_storage/s3s/__init__.py +2 -0
- label_studio_sdk/import_storage/s3s/client.py +1054 -0
- label_studio_sdk/label_interface/base.py +2 -2
- label_studio_sdk/label_interface/control_tags.py +32 -18
- label_studio_sdk/label_interface/create.py +241 -0
- label_studio_sdk/label_interface/interface.py +68 -0
- label_studio_sdk/label_interface/object_tags.py +26 -10
- label_studio_sdk/label_interface/objects.py +5 -5
- label_studio_sdk/ml/client.py +36 -36
- label_studio_sdk/predictions/client.py +24 -24
- label_studio_sdk/projects/client.py +86 -56
- label_studio_sdk/projects/client_ext.py +16 -1
- label_studio_sdk/projects/exports/client.py +38 -38
- label_studio_sdk/tasks/client.py +70 -60
- label_studio_sdk/tasks/client_ext.py +4 -0
- label_studio_sdk/types/__init__.py +8 -0
- label_studio_sdk/types/s3s_export_storage.py +80 -0
- label_studio_sdk/types/s3s_import_storage.py +129 -0
- label_studio_sdk/types/s3s_import_storage_status.py +7 -0
- label_studio_sdk/types/workspace.py +77 -0
- label_studio_sdk/users/client.py +32 -32
- label_studio_sdk/views/client.py +24 -24
- label_studio_sdk/webhooks/client.py +24 -24
- label_studio_sdk/workspaces/__init__.py +6 -0
- label_studio_sdk/workspaces/client.py +569 -0
- label_studio_sdk/workspaces/members/__init__.py +5 -0
- label_studio_sdk/workspaces/members/client.py +297 -0
- label_studio_sdk/workspaces/members/types/__init__.py +6 -0
- label_studio_sdk/workspaces/members/types/members_create_response.py +32 -0
- label_studio_sdk/workspaces/members/types/members_list_response_item.py +32 -0
- {label_studio_sdk-1.0.3.dist-info → label_studio_sdk-1.0.5.dist-info}/METADATA +13 -12
- {label_studio_sdk-1.0.3.dist-info → label_studio_sdk-1.0.5.dist-info}/RECORD +57 -41
- {label_studio_sdk-1.0.3.dist-info → label_studio_sdk-1.0.5.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
|
7
|
+
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
|
8
|
+
from .s3s_import_storage_status import S3SImportStorageStatus
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class S3SImportStorage(pydantic_v1.BaseModel):
|
|
12
|
+
id: typing.Optional[int] = None
|
|
13
|
+
synchronizable: typing.Optional[bool] = None
|
|
14
|
+
presign: typing.Optional[bool] = None
|
|
15
|
+
last_sync: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
|
|
16
|
+
"""
|
|
17
|
+
Last sync finished time
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
last_sync_count: typing.Optional[int] = pydantic_v1.Field(default=None)
|
|
21
|
+
"""
|
|
22
|
+
Count of tasks synced last time
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
last_sync_job: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
26
|
+
"""
|
|
27
|
+
Last sync job ID
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
status: typing.Optional[S3SImportStorageStatus] = None
|
|
31
|
+
traceback: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
32
|
+
"""
|
|
33
|
+
Traceback report for the last failed sync
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
meta: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field(default=None)
|
|
37
|
+
"""
|
|
38
|
+
Meta and debug information about storage processes
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
title: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
42
|
+
"""
|
|
43
|
+
Cloud storage title
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
description: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
47
|
+
"""
|
|
48
|
+
Cloud storage description
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
created_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
|
|
52
|
+
"""
|
|
53
|
+
Creation time
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
bucket: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
57
|
+
"""
|
|
58
|
+
S3 bucket name
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
prefix: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
62
|
+
"""
|
|
63
|
+
S3 bucket prefix
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
regex_filter: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
67
|
+
"""
|
|
68
|
+
Cloud storage regex for filtering objects
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
use_blob_urls: typing.Optional[bool] = pydantic_v1.Field(default=None)
|
|
72
|
+
"""
|
|
73
|
+
Interpret objects as BLOBs and generate URLs
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
region_name: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
77
|
+
"""
|
|
78
|
+
AWS Region
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
external_id: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
82
|
+
"""
|
|
83
|
+
AWS External ID
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
role_arn: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
87
|
+
"""
|
|
88
|
+
AWS Role ARN
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
s3endpoint: typing.Optional[str] = pydantic_v1.Field(alias="s3_endpoint", default=None)
|
|
92
|
+
"""
|
|
93
|
+
S3 Endpoint
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
presign_ttl: typing.Optional[int] = pydantic_v1.Field(default=None)
|
|
97
|
+
"""
|
|
98
|
+
Presigned URLs TTL (in minutes)
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
recursive_scan: typing.Optional[bool] = pydantic_v1.Field(default=None)
|
|
102
|
+
"""
|
|
103
|
+
Perform recursive scan over the bucket content
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
project: int = pydantic_v1.Field()
|
|
107
|
+
"""
|
|
108
|
+
A unique integer value identifying this project.
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
112
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
113
|
+
return super().json(**kwargs_with_defaults)
|
|
114
|
+
|
|
115
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
116
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
117
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
118
|
+
|
|
119
|
+
return deep_union_pydantic_dicts(
|
|
120
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
class Config:
|
|
124
|
+
frozen = True
|
|
125
|
+
smart_union = True
|
|
126
|
+
allow_population_by_field_name = True
|
|
127
|
+
populate_by_name = True
|
|
128
|
+
extra = pydantic_v1.Extra.allow
|
|
129
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
|
7
|
+
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Workspace(pydantic_v1.BaseModel):
|
|
11
|
+
id: typing.Optional[int] = pydantic_v1.Field(default=None)
|
|
12
|
+
"""
|
|
13
|
+
Unique ID of the workspace
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
title: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
17
|
+
"""
|
|
18
|
+
Workspace title
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
description: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
Workspace description
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
is_public: typing.Optional[bool] = pydantic_v1.Field(default=None)
|
|
27
|
+
"""
|
|
28
|
+
Whether the workspace is public or not
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
is_personal: typing.Optional[bool] = pydantic_v1.Field(default=None)
|
|
32
|
+
"""
|
|
33
|
+
Whether the workspace is personal or not
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
is_archived: typing.Optional[bool] = pydantic_v1.Field(default=None)
|
|
37
|
+
"""
|
|
38
|
+
Whether the workspace is archived or not
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
created_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
|
|
42
|
+
"""
|
|
43
|
+
Creation time of the workspace
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
updated_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
|
|
47
|
+
"""
|
|
48
|
+
Last updated time of the workspace
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
created_by: typing.Optional[int] = pydantic_v1.Field(default=None)
|
|
52
|
+
"""
|
|
53
|
+
User ID of the workspace creator
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
color: typing.Optional[str] = pydantic_v1.Field(default=None)
|
|
57
|
+
"""
|
|
58
|
+
Workspace color
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
62
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
63
|
+
return super().json(**kwargs_with_defaults)
|
|
64
|
+
|
|
65
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
66
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
67
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
68
|
+
|
|
69
|
+
return deep_union_pydantic_dicts(
|
|
70
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
class Config:
|
|
74
|
+
frozen = True
|
|
75
|
+
smart_union = True
|
|
76
|
+
extra = pydantic_v1.Extra.allow
|
|
77
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
label_studio_sdk/users/client.py
CHANGED
|
@@ -46,9 +46,9 @@ class UsersClient:
|
|
|
46
46
|
_response = self._client_wrapper.httpx_client.request(
|
|
47
47
|
"api/current-user/reset-token/", method="POST", request_options=request_options
|
|
48
48
|
)
|
|
49
|
-
if 200 <= _response.status_code < 300:
|
|
50
|
-
return pydantic_v1.parse_obj_as(UsersResetTokenResponse, _response.json()) # type: ignore
|
|
51
49
|
try:
|
|
50
|
+
if 200 <= _response.status_code < 300:
|
|
51
|
+
return pydantic_v1.parse_obj_as(UsersResetTokenResponse, _response.json()) # type: ignore
|
|
52
52
|
_response_json = _response.json()
|
|
53
53
|
except JSONDecodeError:
|
|
54
54
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -80,9 +80,9 @@ class UsersClient:
|
|
|
80
80
|
_response = self._client_wrapper.httpx_client.request(
|
|
81
81
|
"api/current-user/token", method="GET", request_options=request_options
|
|
82
82
|
)
|
|
83
|
-
if 200 <= _response.status_code < 300:
|
|
84
|
-
return pydantic_v1.parse_obj_as(UsersGetTokenResponse, _response.json()) # type: ignore
|
|
85
83
|
try:
|
|
84
|
+
if 200 <= _response.status_code < 300:
|
|
85
|
+
return pydantic_v1.parse_obj_as(UsersGetTokenResponse, _response.json()) # type: ignore
|
|
86
86
|
_response_json = _response.json()
|
|
87
87
|
except JSONDecodeError:
|
|
88
88
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -114,9 +114,9 @@ class UsersClient:
|
|
|
114
114
|
_response = self._client_wrapper.httpx_client.request(
|
|
115
115
|
"api/current-user/whoami", method="GET", request_options=request_options
|
|
116
116
|
)
|
|
117
|
-
if 200 <= _response.status_code < 300:
|
|
118
|
-
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
119
117
|
try:
|
|
118
|
+
if 200 <= _response.status_code < 300:
|
|
119
|
+
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
120
120
|
_response_json = _response.json()
|
|
121
121
|
except JSONDecodeError:
|
|
122
122
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -148,9 +148,9 @@ class UsersClient:
|
|
|
148
148
|
_response = self._client_wrapper.httpx_client.request(
|
|
149
149
|
"api/users/", method="GET", request_options=request_options
|
|
150
150
|
)
|
|
151
|
-
if 200 <= _response.status_code < 300:
|
|
152
|
-
return pydantic_v1.parse_obj_as(typing.List[BaseUser], _response.json()) # type: ignore
|
|
153
151
|
try:
|
|
152
|
+
if 200 <= _response.status_code < 300:
|
|
153
|
+
return pydantic_v1.parse_obj_as(typing.List[BaseUser], _response.json()) # type: ignore
|
|
154
154
|
_response_json = _response.json()
|
|
155
155
|
except JSONDecodeError:
|
|
156
156
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -236,9 +236,9 @@ class UsersClient:
|
|
|
236
236
|
request_options=request_options,
|
|
237
237
|
omit=OMIT,
|
|
238
238
|
)
|
|
239
|
-
if 200 <= _response.status_code < 300:
|
|
240
|
-
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
241
239
|
try:
|
|
240
|
+
if 200 <= _response.status_code < 300:
|
|
241
|
+
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
242
242
|
_response_json = _response.json()
|
|
243
243
|
except JSONDecodeError:
|
|
244
244
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -276,9 +276,9 @@ class UsersClient:
|
|
|
276
276
|
_response = self._client_wrapper.httpx_client.request(
|
|
277
277
|
f"api/users/{jsonable_encoder(id)}/", method="GET", request_options=request_options
|
|
278
278
|
)
|
|
279
|
-
if 200 <= _response.status_code < 300:
|
|
280
|
-
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
281
279
|
try:
|
|
280
|
+
if 200 <= _response.status_code < 300:
|
|
281
|
+
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
282
282
|
_response_json = _response.json()
|
|
283
283
|
except JSONDecodeError:
|
|
284
284
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -318,9 +318,9 @@ class UsersClient:
|
|
|
318
318
|
_response = self._client_wrapper.httpx_client.request(
|
|
319
319
|
f"api/users/{jsonable_encoder(id)}/", method="DELETE", request_options=request_options
|
|
320
320
|
)
|
|
321
|
-
if 200 <= _response.status_code < 300:
|
|
322
|
-
return
|
|
323
321
|
try:
|
|
322
|
+
if 200 <= _response.status_code < 300:
|
|
323
|
+
return
|
|
324
324
|
_response_json = _response.json()
|
|
325
325
|
except JSONDecodeError:
|
|
326
326
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -414,9 +414,9 @@ class UsersClient:
|
|
|
414
414
|
request_options=request_options,
|
|
415
415
|
omit=OMIT,
|
|
416
416
|
)
|
|
417
|
-
if 200 <= _response.status_code < 300:
|
|
418
|
-
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
419
417
|
try:
|
|
418
|
+
if 200 <= _response.status_code < 300:
|
|
419
|
+
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
420
420
|
_response_json = _response.json()
|
|
421
421
|
except JSONDecodeError:
|
|
422
422
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -453,9 +453,9 @@ class AsyncUsersClient:
|
|
|
453
453
|
_response = await self._client_wrapper.httpx_client.request(
|
|
454
454
|
"api/current-user/reset-token/", method="POST", request_options=request_options
|
|
455
455
|
)
|
|
456
|
-
if 200 <= _response.status_code < 300:
|
|
457
|
-
return pydantic_v1.parse_obj_as(UsersResetTokenResponse, _response.json()) # type: ignore
|
|
458
456
|
try:
|
|
457
|
+
if 200 <= _response.status_code < 300:
|
|
458
|
+
return pydantic_v1.parse_obj_as(UsersResetTokenResponse, _response.json()) # type: ignore
|
|
459
459
|
_response_json = _response.json()
|
|
460
460
|
except JSONDecodeError:
|
|
461
461
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -487,9 +487,9 @@ class AsyncUsersClient:
|
|
|
487
487
|
_response = await self._client_wrapper.httpx_client.request(
|
|
488
488
|
"api/current-user/token", method="GET", request_options=request_options
|
|
489
489
|
)
|
|
490
|
-
if 200 <= _response.status_code < 300:
|
|
491
|
-
return pydantic_v1.parse_obj_as(UsersGetTokenResponse, _response.json()) # type: ignore
|
|
492
490
|
try:
|
|
491
|
+
if 200 <= _response.status_code < 300:
|
|
492
|
+
return pydantic_v1.parse_obj_as(UsersGetTokenResponse, _response.json()) # type: ignore
|
|
493
493
|
_response_json = _response.json()
|
|
494
494
|
except JSONDecodeError:
|
|
495
495
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -521,9 +521,9 @@ class AsyncUsersClient:
|
|
|
521
521
|
_response = await self._client_wrapper.httpx_client.request(
|
|
522
522
|
"api/current-user/whoami", method="GET", request_options=request_options
|
|
523
523
|
)
|
|
524
|
-
if 200 <= _response.status_code < 300:
|
|
525
|
-
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
526
524
|
try:
|
|
525
|
+
if 200 <= _response.status_code < 300:
|
|
526
|
+
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
527
527
|
_response_json = _response.json()
|
|
528
528
|
except JSONDecodeError:
|
|
529
529
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -555,9 +555,9 @@ class AsyncUsersClient:
|
|
|
555
555
|
_response = await self._client_wrapper.httpx_client.request(
|
|
556
556
|
"api/users/", method="GET", request_options=request_options
|
|
557
557
|
)
|
|
558
|
-
if 200 <= _response.status_code < 300:
|
|
559
|
-
return pydantic_v1.parse_obj_as(typing.List[BaseUser], _response.json()) # type: ignore
|
|
560
558
|
try:
|
|
559
|
+
if 200 <= _response.status_code < 300:
|
|
560
|
+
return pydantic_v1.parse_obj_as(typing.List[BaseUser], _response.json()) # type: ignore
|
|
561
561
|
_response_json = _response.json()
|
|
562
562
|
except JSONDecodeError:
|
|
563
563
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -643,9 +643,9 @@ class AsyncUsersClient:
|
|
|
643
643
|
request_options=request_options,
|
|
644
644
|
omit=OMIT,
|
|
645
645
|
)
|
|
646
|
-
if 200 <= _response.status_code < 300:
|
|
647
|
-
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
648
646
|
try:
|
|
647
|
+
if 200 <= _response.status_code < 300:
|
|
648
|
+
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
649
649
|
_response_json = _response.json()
|
|
650
650
|
except JSONDecodeError:
|
|
651
651
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -683,9 +683,9 @@ class AsyncUsersClient:
|
|
|
683
683
|
_response = await self._client_wrapper.httpx_client.request(
|
|
684
684
|
f"api/users/{jsonable_encoder(id)}/", method="GET", request_options=request_options
|
|
685
685
|
)
|
|
686
|
-
if 200 <= _response.status_code < 300:
|
|
687
|
-
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
688
686
|
try:
|
|
687
|
+
if 200 <= _response.status_code < 300:
|
|
688
|
+
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
689
689
|
_response_json = _response.json()
|
|
690
690
|
except JSONDecodeError:
|
|
691
691
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -725,9 +725,9 @@ class AsyncUsersClient:
|
|
|
725
725
|
_response = await self._client_wrapper.httpx_client.request(
|
|
726
726
|
f"api/users/{jsonable_encoder(id)}/", method="DELETE", request_options=request_options
|
|
727
727
|
)
|
|
728
|
-
if 200 <= _response.status_code < 300:
|
|
729
|
-
return
|
|
730
728
|
try:
|
|
729
|
+
if 200 <= _response.status_code < 300:
|
|
730
|
+
return
|
|
731
731
|
_response_json = _response.json()
|
|
732
732
|
except JSONDecodeError:
|
|
733
733
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -821,9 +821,9 @@ class AsyncUsersClient:
|
|
|
821
821
|
request_options=request_options,
|
|
822
822
|
omit=OMIT,
|
|
823
823
|
)
|
|
824
|
-
if 200 <= _response.status_code < 300:
|
|
825
|
-
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
826
824
|
try:
|
|
825
|
+
if 200 <= _response.status_code < 300:
|
|
826
|
+
return pydantic_v1.parse_obj_as(BaseUser, _response.json()) # type: ignore
|
|
827
827
|
_response_json = _response.json()
|
|
828
828
|
except JSONDecodeError:
|
|
829
829
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
label_studio_sdk/views/client.py
CHANGED
|
@@ -53,9 +53,9 @@ class ViewsClient:
|
|
|
53
53
|
_response = self._client_wrapper.httpx_client.request(
|
|
54
54
|
"api/dm/views/", method="GET", params={"project": project}, request_options=request_options
|
|
55
55
|
)
|
|
56
|
-
if 200 <= _response.status_code < 300:
|
|
57
|
-
return pydantic_v1.parse_obj_as(typing.List[View], _response.json()) # type: ignore
|
|
58
56
|
try:
|
|
57
|
+
if 200 <= _response.status_code < 300:
|
|
58
|
+
return pydantic_v1.parse_obj_as(typing.List[View], _response.json()) # type: ignore
|
|
59
59
|
_response_json = _response.json()
|
|
60
60
|
except JSONDecodeError:
|
|
61
61
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -105,9 +105,9 @@ class ViewsClient:
|
|
|
105
105
|
request_options=request_options,
|
|
106
106
|
omit=OMIT,
|
|
107
107
|
)
|
|
108
|
-
if 200 <= _response.status_code < 300:
|
|
109
|
-
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
110
108
|
try:
|
|
109
|
+
if 200 <= _response.status_code < 300:
|
|
110
|
+
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
111
111
|
_response_json = _response.json()
|
|
112
112
|
except JSONDecodeError:
|
|
113
113
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -148,9 +148,9 @@ class ViewsClient:
|
|
|
148
148
|
request_options=request_options,
|
|
149
149
|
omit=OMIT,
|
|
150
150
|
)
|
|
151
|
-
if 200 <= _response.status_code < 300:
|
|
152
|
-
return
|
|
153
151
|
try:
|
|
152
|
+
if 200 <= _response.status_code < 300:
|
|
153
|
+
return
|
|
154
154
|
_response_json = _response.json()
|
|
155
155
|
except JSONDecodeError:
|
|
156
156
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -187,9 +187,9 @@ class ViewsClient:
|
|
|
187
187
|
_response = self._client_wrapper.httpx_client.request(
|
|
188
188
|
f"api/dm/views/{jsonable_encoder(id)}/", method="GET", request_options=request_options
|
|
189
189
|
)
|
|
190
|
-
if 200 <= _response.status_code < 300:
|
|
191
|
-
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
192
190
|
try:
|
|
191
|
+
if 200 <= _response.status_code < 300:
|
|
192
|
+
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
193
193
|
_response_json = _response.json()
|
|
194
194
|
except JSONDecodeError:
|
|
195
195
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -225,9 +225,9 @@ class ViewsClient:
|
|
|
225
225
|
_response = self._client_wrapper.httpx_client.request(
|
|
226
226
|
f"api/dm/views/{jsonable_encoder(id)}/", method="DELETE", request_options=request_options
|
|
227
227
|
)
|
|
228
|
-
if 200 <= _response.status_code < 300:
|
|
229
|
-
return
|
|
230
228
|
try:
|
|
229
|
+
if 200 <= _response.status_code < 300:
|
|
230
|
+
return
|
|
231
231
|
_response_json = _response.json()
|
|
232
232
|
except JSONDecodeError:
|
|
233
233
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -281,9 +281,9 @@ class ViewsClient:
|
|
|
281
281
|
request_options=request_options,
|
|
282
282
|
omit=OMIT,
|
|
283
283
|
)
|
|
284
|
-
if 200 <= _response.status_code < 300:
|
|
285
|
-
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
286
284
|
try:
|
|
285
|
+
if 200 <= _response.status_code < 300:
|
|
286
|
+
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
287
287
|
_response_json = _response.json()
|
|
288
288
|
except JSONDecodeError:
|
|
289
289
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -327,9 +327,9 @@ class AsyncViewsClient:
|
|
|
327
327
|
_response = await self._client_wrapper.httpx_client.request(
|
|
328
328
|
"api/dm/views/", method="GET", params={"project": project}, request_options=request_options
|
|
329
329
|
)
|
|
330
|
-
if 200 <= _response.status_code < 300:
|
|
331
|
-
return pydantic_v1.parse_obj_as(typing.List[View], _response.json()) # type: ignore
|
|
332
330
|
try:
|
|
331
|
+
if 200 <= _response.status_code < 300:
|
|
332
|
+
return pydantic_v1.parse_obj_as(typing.List[View], _response.json()) # type: ignore
|
|
333
333
|
_response_json = _response.json()
|
|
334
334
|
except JSONDecodeError:
|
|
335
335
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -379,9 +379,9 @@ class AsyncViewsClient:
|
|
|
379
379
|
request_options=request_options,
|
|
380
380
|
omit=OMIT,
|
|
381
381
|
)
|
|
382
|
-
if 200 <= _response.status_code < 300:
|
|
383
|
-
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
384
382
|
try:
|
|
383
|
+
if 200 <= _response.status_code < 300:
|
|
384
|
+
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
385
385
|
_response_json = _response.json()
|
|
386
386
|
except JSONDecodeError:
|
|
387
387
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -422,9 +422,9 @@ class AsyncViewsClient:
|
|
|
422
422
|
request_options=request_options,
|
|
423
423
|
omit=OMIT,
|
|
424
424
|
)
|
|
425
|
-
if 200 <= _response.status_code < 300:
|
|
426
|
-
return
|
|
427
425
|
try:
|
|
426
|
+
if 200 <= _response.status_code < 300:
|
|
427
|
+
return
|
|
428
428
|
_response_json = _response.json()
|
|
429
429
|
except JSONDecodeError:
|
|
430
430
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -461,9 +461,9 @@ class AsyncViewsClient:
|
|
|
461
461
|
_response = await self._client_wrapper.httpx_client.request(
|
|
462
462
|
f"api/dm/views/{jsonable_encoder(id)}/", method="GET", request_options=request_options
|
|
463
463
|
)
|
|
464
|
-
if 200 <= _response.status_code < 300:
|
|
465
|
-
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
466
464
|
try:
|
|
465
|
+
if 200 <= _response.status_code < 300:
|
|
466
|
+
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
467
467
|
_response_json = _response.json()
|
|
468
468
|
except JSONDecodeError:
|
|
469
469
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -499,9 +499,9 @@ class AsyncViewsClient:
|
|
|
499
499
|
_response = await self._client_wrapper.httpx_client.request(
|
|
500
500
|
f"api/dm/views/{jsonable_encoder(id)}/", method="DELETE", request_options=request_options
|
|
501
501
|
)
|
|
502
|
-
if 200 <= _response.status_code < 300:
|
|
503
|
-
return
|
|
504
502
|
try:
|
|
503
|
+
if 200 <= _response.status_code < 300:
|
|
504
|
+
return
|
|
505
505
|
_response_json = _response.json()
|
|
506
506
|
except JSONDecodeError:
|
|
507
507
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -555,9 +555,9 @@ class AsyncViewsClient:
|
|
|
555
555
|
request_options=request_options,
|
|
556
556
|
omit=OMIT,
|
|
557
557
|
)
|
|
558
|
-
if 200 <= _response.status_code < 300:
|
|
559
|
-
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
560
558
|
try:
|
|
559
|
+
if 200 <= _response.status_code < 300:
|
|
560
|
+
return pydantic_v1.parse_obj_as(View, _response.json()) # type: ignore
|
|
561
561
|
_response_json = _response.json()
|
|
562
562
|
except JSONDecodeError:
|
|
563
563
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -55,9 +55,9 @@ class WebhooksClient:
|
|
|
55
55
|
_response = self._client_wrapper.httpx_client.request(
|
|
56
56
|
"api/webhooks/", method="GET", params={"project": project}, request_options=request_options
|
|
57
57
|
)
|
|
58
|
-
if 200 <= _response.status_code < 300:
|
|
59
|
-
return pydantic_v1.parse_obj_as(typing.List[Webhook], _response.json()) # type: ignore
|
|
60
58
|
try:
|
|
59
|
+
if 200 <= _response.status_code < 300:
|
|
60
|
+
return pydantic_v1.parse_obj_as(typing.List[Webhook], _response.json()) # type: ignore
|
|
61
61
|
_response_json = _response.json()
|
|
62
62
|
except JSONDecodeError:
|
|
63
63
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -101,9 +101,9 @@ class WebhooksClient:
|
|
|
101
101
|
_response = self._client_wrapper.httpx_client.request(
|
|
102
102
|
"api/webhooks/", method="POST", json=request, request_options=request_options, omit=OMIT
|
|
103
103
|
)
|
|
104
|
-
if 200 <= _response.status_code < 300:
|
|
105
|
-
return pydantic_v1.parse_obj_as(Webhook, _response.json()) # type: ignore
|
|
106
104
|
try:
|
|
105
|
+
if 200 <= _response.status_code < 300:
|
|
106
|
+
return pydantic_v1.parse_obj_as(Webhook, _response.json()) # type: ignore
|
|
107
107
|
_response_json = _response.json()
|
|
108
108
|
except JSONDecodeError:
|
|
109
109
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -145,9 +145,9 @@ class WebhooksClient:
|
|
|
145
145
|
params={"organization-only": organization_only},
|
|
146
146
|
request_options=request_options,
|
|
147
147
|
)
|
|
148
|
-
if 200 <= _response.status_code < 300:
|
|
149
|
-
return
|
|
150
148
|
try:
|
|
149
|
+
if 200 <= _response.status_code < 300:
|
|
150
|
+
return
|
|
151
151
|
_response_json = _response.json()
|
|
152
152
|
except JSONDecodeError:
|
|
153
153
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -186,9 +186,9 @@ class WebhooksClient:
|
|
|
186
186
|
_response = self._client_wrapper.httpx_client.request(
|
|
187
187
|
f"api/webhooks/{jsonable_encoder(id)}/", method="GET", request_options=request_options
|
|
188
188
|
)
|
|
189
|
-
if 200 <= _response.status_code < 300:
|
|
190
|
-
return pydantic_v1.parse_obj_as(Webhook, _response.json()) # type: ignore
|
|
191
189
|
try:
|
|
190
|
+
if 200 <= _response.status_code < 300:
|
|
191
|
+
return pydantic_v1.parse_obj_as(Webhook, _response.json()) # type: ignore
|
|
192
192
|
_response_json = _response.json()
|
|
193
193
|
except JSONDecodeError:
|
|
194
194
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -226,9 +226,9 @@ class WebhooksClient:
|
|
|
226
226
|
_response = self._client_wrapper.httpx_client.request(
|
|
227
227
|
f"api/webhooks/{jsonable_encoder(id)}/", method="DELETE", request_options=request_options
|
|
228
228
|
)
|
|
229
|
-
if 200 <= _response.status_code < 300:
|
|
230
|
-
return
|
|
231
229
|
try:
|
|
230
|
+
if 200 <= _response.status_code < 300:
|
|
231
|
+
return
|
|
232
232
|
_response_json = _response.json()
|
|
233
233
|
except JSONDecodeError:
|
|
234
234
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -317,9 +317,9 @@ class WebhooksClient:
|
|
|
317
317
|
request_options=request_options,
|
|
318
318
|
omit=OMIT,
|
|
319
319
|
)
|
|
320
|
-
if 200 <= _response.status_code < 300:
|
|
321
|
-
return pydantic_v1.parse_obj_as(WebhookSerializerForUpdate, _response.json()) # type: ignore
|
|
322
320
|
try:
|
|
321
|
+
if 200 <= _response.status_code < 300:
|
|
322
|
+
return pydantic_v1.parse_obj_as(WebhookSerializerForUpdate, _response.json()) # type: ignore
|
|
323
323
|
_response_json = _response.json()
|
|
324
324
|
except JSONDecodeError:
|
|
325
325
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -365,9 +365,9 @@ class AsyncWebhooksClient:
|
|
|
365
365
|
_response = await self._client_wrapper.httpx_client.request(
|
|
366
366
|
"api/webhooks/", method="GET", params={"project": project}, request_options=request_options
|
|
367
367
|
)
|
|
368
|
-
if 200 <= _response.status_code < 300:
|
|
369
|
-
return pydantic_v1.parse_obj_as(typing.List[Webhook], _response.json()) # type: ignore
|
|
370
368
|
try:
|
|
369
|
+
if 200 <= _response.status_code < 300:
|
|
370
|
+
return pydantic_v1.parse_obj_as(typing.List[Webhook], _response.json()) # type: ignore
|
|
371
371
|
_response_json = _response.json()
|
|
372
372
|
except JSONDecodeError:
|
|
373
373
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -411,9 +411,9 @@ class AsyncWebhooksClient:
|
|
|
411
411
|
_response = await self._client_wrapper.httpx_client.request(
|
|
412
412
|
"api/webhooks/", method="POST", json=request, request_options=request_options, omit=OMIT
|
|
413
413
|
)
|
|
414
|
-
if 200 <= _response.status_code < 300:
|
|
415
|
-
return pydantic_v1.parse_obj_as(Webhook, _response.json()) # type: ignore
|
|
416
414
|
try:
|
|
415
|
+
if 200 <= _response.status_code < 300:
|
|
416
|
+
return pydantic_v1.parse_obj_as(Webhook, _response.json()) # type: ignore
|
|
417
417
|
_response_json = _response.json()
|
|
418
418
|
except JSONDecodeError:
|
|
419
419
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -455,9 +455,9 @@ class AsyncWebhooksClient:
|
|
|
455
455
|
params={"organization-only": organization_only},
|
|
456
456
|
request_options=request_options,
|
|
457
457
|
)
|
|
458
|
-
if 200 <= _response.status_code < 300:
|
|
459
|
-
return
|
|
460
458
|
try:
|
|
459
|
+
if 200 <= _response.status_code < 300:
|
|
460
|
+
return
|
|
461
461
|
_response_json = _response.json()
|
|
462
462
|
except JSONDecodeError:
|
|
463
463
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -496,9 +496,9 @@ class AsyncWebhooksClient:
|
|
|
496
496
|
_response = await self._client_wrapper.httpx_client.request(
|
|
497
497
|
f"api/webhooks/{jsonable_encoder(id)}/", method="GET", request_options=request_options
|
|
498
498
|
)
|
|
499
|
-
if 200 <= _response.status_code < 300:
|
|
500
|
-
return pydantic_v1.parse_obj_as(Webhook, _response.json()) # type: ignore
|
|
501
499
|
try:
|
|
500
|
+
if 200 <= _response.status_code < 300:
|
|
501
|
+
return pydantic_v1.parse_obj_as(Webhook, _response.json()) # type: ignore
|
|
502
502
|
_response_json = _response.json()
|
|
503
503
|
except JSONDecodeError:
|
|
504
504
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -536,9 +536,9 @@ class AsyncWebhooksClient:
|
|
|
536
536
|
_response = await self._client_wrapper.httpx_client.request(
|
|
537
537
|
f"api/webhooks/{jsonable_encoder(id)}/", method="DELETE", request_options=request_options
|
|
538
538
|
)
|
|
539
|
-
if 200 <= _response.status_code < 300:
|
|
540
|
-
return
|
|
541
539
|
try:
|
|
540
|
+
if 200 <= _response.status_code < 300:
|
|
541
|
+
return
|
|
542
542
|
_response_json = _response.json()
|
|
543
543
|
except JSONDecodeError:
|
|
544
544
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -627,9 +627,9 @@ class AsyncWebhooksClient:
|
|
|
627
627
|
request_options=request_options,
|
|
628
628
|
omit=OMIT,
|
|
629
629
|
)
|
|
630
|
-
if 200 <= _response.status_code < 300:
|
|
631
|
-
return pydantic_v1.parse_obj_as(WebhookSerializerForUpdate, _response.json()) # type: ignore
|
|
632
630
|
try:
|
|
631
|
+
if 200 <= _response.status_code < 300:
|
|
632
|
+
return pydantic_v1.parse_obj_as(WebhookSerializerForUpdate, _response.json()) # type: ignore
|
|
633
633
|
_response_json = _response.json()
|
|
634
634
|
except JSONDecodeError:
|
|
635
635
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|