label-studio-sdk 2.0.2__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.
- label_studio_sdk/__init__.py +16 -0
- label_studio_sdk/base_client.py +4 -0
- label_studio_sdk/projects/__init__.py +4 -1
- label_studio_sdk/projects/assignments/__init__.py +2 -0
- label_studio_sdk/projects/assignments/client.py +43 -6
- label_studio_sdk/projects/assignments/types/__init__.py +2 -0
- label_studio_sdk/projects/assignments/types/assignments_delete_request_type.py +5 -0
- label_studio_sdk/projects/client.py +4 -0
- label_studio_sdk/projects/members/__init__.py +2 -0
- label_studio_sdk/projects/members/client.py +137 -0
- label_studio_sdk/sso/__init__.py +5 -0
- label_studio_sdk/sso/client.py +22 -0
- label_studio_sdk/sso/saml/__init__.py +2 -0
- label_studio_sdk/sso/saml/client.py +278 -0
- label_studio_sdk/sso/scim/__init__.py +2 -0
- label_studio_sdk/sso/scim/client.py +278 -0
- label_studio_sdk/types/__init__.py +14 -0
- label_studio_sdk/types/project_group.py +22 -0
- label_studio_sdk/types/project_group_request.py +22 -0
- label_studio_sdk/types/project_group_role_enum.py +5 -0
- label_studio_sdk/types/saml_settings.py +21 -0
- label_studio_sdk/types/saml_settings_update.py +22 -0
- label_studio_sdk/types/scim_settings.py +21 -0
- label_studio_sdk/types/scim_settings_update.py +22 -0
- {label_studio_sdk-2.0.2.dist-info → label_studio_sdk-2.0.3.dist-info}/METADATA +1 -1
- {label_studio_sdk-2.0.2.dist-info → label_studio_sdk-2.0.3.dist-info}/RECORD +28 -12
- {label_studio_sdk-2.0.2.dist-info → label_studio_sdk-2.0.3.dist-info}/LICENSE +0 -0
- {label_studio_sdk-2.0.2.dist-info → label_studio_sdk-2.0.3.dist-info}/WHEEL +0 -0
label_studio_sdk/__init__.py
CHANGED
|
@@ -123,6 +123,9 @@ from .types import (
|
|
|
123
123
|
Prediction,
|
|
124
124
|
PredictionRequest,
|
|
125
125
|
Project,
|
|
126
|
+
ProjectGroup,
|
|
127
|
+
ProjectGroupRequest,
|
|
128
|
+
ProjectGroupRoleEnum,
|
|
126
129
|
ProjectImport,
|
|
127
130
|
ProjectLabelConfig,
|
|
128
131
|
ProjectLabelConfigRequest,
|
|
@@ -148,7 +151,11 @@ from .types import (
|
|
|
148
151
|
RoleBasedTask,
|
|
149
152
|
S3ExportStorage,
|
|
150
153
|
S3ImportStorage,
|
|
154
|
+
SamlSettings,
|
|
155
|
+
SamlSettingsUpdate,
|
|
151
156
|
SamplingEnum,
|
|
157
|
+
ScimSettings,
|
|
158
|
+
ScimSettingsUpdate,
|
|
152
159
|
ScopeEnum,
|
|
153
160
|
SelectedItemsRequest,
|
|
154
161
|
SerializationOption,
|
|
@@ -201,6 +208,7 @@ from . import (
|
|
|
201
208
|
predictions,
|
|
202
209
|
projects,
|
|
203
210
|
prompts,
|
|
211
|
+
sso,
|
|
204
212
|
tasks,
|
|
205
213
|
tokens,
|
|
206
214
|
users,
|
|
@@ -439,6 +447,9 @@ __all__ = [
|
|
|
439
447
|
"Prediction",
|
|
440
448
|
"PredictionRequest",
|
|
441
449
|
"Project",
|
|
450
|
+
"ProjectGroup",
|
|
451
|
+
"ProjectGroupRequest",
|
|
452
|
+
"ProjectGroupRoleEnum",
|
|
442
453
|
"ProjectImport",
|
|
443
454
|
"ProjectLabelConfig",
|
|
444
455
|
"ProjectLabelConfigRequest",
|
|
@@ -468,7 +479,11 @@ __all__ = [
|
|
|
468
479
|
"RoleBasedTask",
|
|
469
480
|
"S3ExportStorage",
|
|
470
481
|
"S3ImportStorage",
|
|
482
|
+
"SamlSettings",
|
|
483
|
+
"SamlSettingsUpdate",
|
|
471
484
|
"SamplingEnum",
|
|
485
|
+
"ScimSettings",
|
|
486
|
+
"ScimSettingsUpdate",
|
|
472
487
|
"ScopeEnum",
|
|
473
488
|
"SelectedItemsRequest",
|
|
474
489
|
"SerializationOption",
|
|
@@ -548,6 +563,7 @@ __all__ = [
|
|
|
548
563
|
"predictions",
|
|
549
564
|
"projects",
|
|
550
565
|
"prompts",
|
|
566
|
+
"sso",
|
|
551
567
|
"tasks",
|
|
552
568
|
"tokens",
|
|
553
569
|
"users",
|
label_studio_sdk/base_client.py
CHANGED
|
@@ -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:
|
|
@@ -9,7 +9,7 @@ from .types import (
|
|
|
9
9
|
ProjectsImportTasksResponse,
|
|
10
10
|
ProjectsListRequestFilter,
|
|
11
11
|
)
|
|
12
|
-
from . import assignments, exports, pauses, stats
|
|
12
|
+
from . import assignments, exports, members, pauses, stats
|
|
13
13
|
from .assignments import (
|
|
14
14
|
AssignmentsAssignRequestType,
|
|
15
15
|
AssignmentsBulkAssignRequestFilters,
|
|
@@ -23,6 +23,7 @@ from .assignments import (
|
|
|
23
23
|
AssignmentsBulkAssignRequestSelectedItemsIncluded,
|
|
24
24
|
AssignmentsBulkAssignRequestType,
|
|
25
25
|
AssignmentsBulkAssignResponse,
|
|
26
|
+
AssignmentsDeleteRequestType,
|
|
26
27
|
AssignmentsUpdateRequestType,
|
|
27
28
|
)
|
|
28
29
|
from .exports import ExportsConvertResponse
|
|
@@ -41,6 +42,7 @@ __all__ = [
|
|
|
41
42
|
"AssignmentsBulkAssignRequestSelectedItemsIncluded",
|
|
42
43
|
"AssignmentsBulkAssignRequestType",
|
|
43
44
|
"AssignmentsBulkAssignResponse",
|
|
45
|
+
"AssignmentsDeleteRequestType",
|
|
44
46
|
"AssignmentsUpdateRequestType",
|
|
45
47
|
"ExportsConvertResponse",
|
|
46
48
|
"LseProjectCreateRequestSampling",
|
|
@@ -56,6 +58,7 @@ __all__ = [
|
|
|
56
58
|
"StatsIaaResponseStd",
|
|
57
59
|
"assignments",
|
|
58
60
|
"exports",
|
|
61
|
+
"members",
|
|
59
62
|
"pauses",
|
|
60
63
|
"stats",
|
|
61
64
|
]
|
|
@@ -13,6 +13,7 @@ from .types import (
|
|
|
13
13
|
AssignmentsBulkAssignRequestSelectedItemsIncluded,
|
|
14
14
|
AssignmentsBulkAssignRequestType,
|
|
15
15
|
AssignmentsBulkAssignResponse,
|
|
16
|
+
AssignmentsDeleteRequestType,
|
|
16
17
|
AssignmentsUpdateRequestType,
|
|
17
18
|
)
|
|
18
19
|
|
|
@@ -29,5 +30,6 @@ __all__ = [
|
|
|
29
30
|
"AssignmentsBulkAssignRequestSelectedItemsIncluded",
|
|
30
31
|
"AssignmentsBulkAssignRequestType",
|
|
31
32
|
"AssignmentsBulkAssignResponse",
|
|
33
|
+
"AssignmentsDeleteRequestType",
|
|
32
34
|
"AssignmentsUpdateRequestType",
|
|
33
35
|
]
|
|
@@ -15,6 +15,7 @@ from json.decoder import JSONDecodeError
|
|
|
15
15
|
from ...core.api_error import ApiError
|
|
16
16
|
from ...types.task_assignment import TaskAssignment
|
|
17
17
|
from .types.assignments_assign_request_type import AssignmentsAssignRequestType
|
|
18
|
+
from .types.assignments_delete_request_type import AssignmentsDeleteRequestType
|
|
18
19
|
from .types.assignments_update_request_type import AssignmentsUpdateRequestType
|
|
19
20
|
from ...core.client_wrapper import AsyncClientWrapper
|
|
20
21
|
|
|
@@ -37,7 +38,7 @@ class AssignmentsClient:
|
|
|
37
38
|
request_options: typing.Optional[RequestOptions] = None,
|
|
38
39
|
) -> AssignmentsBulkAssignResponse:
|
|
39
40
|
"""
|
|
40
|
-
Assign multiple
|
|
41
|
+
Assign multiple users to a collection of tasks within a specific project.
|
|
41
42
|
|
|
42
43
|
Parameters
|
|
43
44
|
----------
|
|
@@ -253,9 +254,17 @@ class AssignmentsClient:
|
|
|
253
254
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
254
255
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
255
256
|
|
|
256
|
-
def delete(
|
|
257
|
+
def delete(
|
|
258
|
+
self,
|
|
259
|
+
id: int,
|
|
260
|
+
task_pk: int,
|
|
261
|
+
*,
|
|
262
|
+
type: typing.Optional[AssignmentsDeleteRequestType] = None,
|
|
263
|
+
users: typing.Optional[str] = None,
|
|
264
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
265
|
+
) -> None:
|
|
257
266
|
"""
|
|
258
|
-
Remove
|
|
267
|
+
Remove assignees for a task within a specific project.
|
|
259
268
|
|
|
260
269
|
Parameters
|
|
261
270
|
----------
|
|
@@ -265,6 +274,12 @@ class AssignmentsClient:
|
|
|
265
274
|
task_pk : int
|
|
266
275
|
A unique integer value identifying this task.
|
|
267
276
|
|
|
277
|
+
type : typing.Optional[AssignmentsDeleteRequestType]
|
|
278
|
+
Assignment type to delete (optional). If omitted, deletes all assignments for the task.
|
|
279
|
+
|
|
280
|
+
users : typing.Optional[str]
|
|
281
|
+
Comma separated list of user IDs to delete, as a string. If omitted, deletes all assignees for the given type.
|
|
282
|
+
|
|
268
283
|
request_options : typing.Optional[RequestOptions]
|
|
269
284
|
Request-specific configuration.
|
|
270
285
|
|
|
@@ -287,6 +302,10 @@ class AssignmentsClient:
|
|
|
287
302
|
_response = self._client_wrapper.httpx_client.request(
|
|
288
303
|
f"api/projects/{jsonable_encoder(id)}/tasks/{jsonable_encoder(task_pk)}/assignees",
|
|
289
304
|
method="DELETE",
|
|
305
|
+
params={
|
|
306
|
+
"type": type,
|
|
307
|
+
"users": users,
|
|
308
|
+
},
|
|
290
309
|
request_options=request_options,
|
|
291
310
|
)
|
|
292
311
|
try:
|
|
@@ -388,7 +407,7 @@ class AsyncAssignmentsClient:
|
|
|
388
407
|
request_options: typing.Optional[RequestOptions] = None,
|
|
389
408
|
) -> AssignmentsBulkAssignResponse:
|
|
390
409
|
"""
|
|
391
|
-
Assign multiple
|
|
410
|
+
Assign multiple users to a collection of tasks within a specific project.
|
|
392
411
|
|
|
393
412
|
Parameters
|
|
394
413
|
----------
|
|
@@ -628,9 +647,17 @@ class AsyncAssignmentsClient:
|
|
|
628
647
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
629
648
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
630
649
|
|
|
631
|
-
async def delete(
|
|
650
|
+
async def delete(
|
|
651
|
+
self,
|
|
652
|
+
id: int,
|
|
653
|
+
task_pk: int,
|
|
654
|
+
*,
|
|
655
|
+
type: typing.Optional[AssignmentsDeleteRequestType] = None,
|
|
656
|
+
users: typing.Optional[str] = None,
|
|
657
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
658
|
+
) -> None:
|
|
632
659
|
"""
|
|
633
|
-
Remove
|
|
660
|
+
Remove assignees for a task within a specific project.
|
|
634
661
|
|
|
635
662
|
Parameters
|
|
636
663
|
----------
|
|
@@ -640,6 +667,12 @@ class AsyncAssignmentsClient:
|
|
|
640
667
|
task_pk : int
|
|
641
668
|
A unique integer value identifying this task.
|
|
642
669
|
|
|
670
|
+
type : typing.Optional[AssignmentsDeleteRequestType]
|
|
671
|
+
Assignment type to delete (optional). If omitted, deletes all assignments for the task.
|
|
672
|
+
|
|
673
|
+
users : typing.Optional[str]
|
|
674
|
+
Comma separated list of user IDs to delete, as a string. If omitted, deletes all assignees for the given type.
|
|
675
|
+
|
|
643
676
|
request_options : typing.Optional[RequestOptions]
|
|
644
677
|
Request-specific configuration.
|
|
645
678
|
|
|
@@ -670,6 +703,10 @@ class AsyncAssignmentsClient:
|
|
|
670
703
|
_response = await self._client_wrapper.httpx_client.request(
|
|
671
704
|
f"api/projects/{jsonable_encoder(id)}/tasks/{jsonable_encoder(task_pk)}/assignees",
|
|
672
705
|
method="DELETE",
|
|
706
|
+
params={
|
|
707
|
+
"type": type,
|
|
708
|
+
"users": users,
|
|
709
|
+
},
|
|
673
710
|
request_options=request_options,
|
|
674
711
|
)
|
|
675
712
|
try:
|
|
@@ -16,6 +16,7 @@ from .assignments_bulk_assign_request_selected_items_excluded import Assignments
|
|
|
16
16
|
from .assignments_bulk_assign_request_selected_items_included import AssignmentsBulkAssignRequestSelectedItemsIncluded
|
|
17
17
|
from .assignments_bulk_assign_request_type import AssignmentsBulkAssignRequestType
|
|
18
18
|
from .assignments_bulk_assign_response import AssignmentsBulkAssignResponse
|
|
19
|
+
from .assignments_delete_request_type import AssignmentsDeleteRequestType
|
|
19
20
|
from .assignments_update_request_type import AssignmentsUpdateRequestType
|
|
20
21
|
|
|
21
22
|
__all__ = [
|
|
@@ -31,5 +32,6 @@ __all__ = [
|
|
|
31
32
|
"AssignmentsBulkAssignRequestSelectedItemsIncluded",
|
|
32
33
|
"AssignmentsBulkAssignRequestType",
|
|
33
34
|
"AssignmentsBulkAssignResponse",
|
|
35
|
+
"AssignmentsDeleteRequestType",
|
|
34
36
|
"AssignmentsUpdateRequestType",
|
|
35
37
|
]
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
from ..core.client_wrapper import SyncClientWrapper
|
|
5
5
|
from .exports.client import ExportsClient
|
|
6
|
+
from .members.client import MembersClient
|
|
6
7
|
from .stats.client import StatsClient
|
|
7
8
|
from .assignments.client import AssignmentsClient
|
|
8
9
|
from .pauses.client import PausesClient
|
|
@@ -35,6 +36,7 @@ from ..errors.bad_request_error import BadRequestError
|
|
|
35
36
|
from ..types.project_label_config import ProjectLabelConfig
|
|
36
37
|
from ..core.client_wrapper import AsyncClientWrapper
|
|
37
38
|
from .exports.client import AsyncExportsClient
|
|
39
|
+
from .members.client import AsyncMembersClient
|
|
38
40
|
from .stats.client import AsyncStatsClient
|
|
39
41
|
from .assignments.client import AsyncAssignmentsClient
|
|
40
42
|
from .pauses.client import AsyncPausesClient
|
|
@@ -48,6 +50,7 @@ class ProjectsClient:
|
|
|
48
50
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
49
51
|
self._client_wrapper = client_wrapper
|
|
50
52
|
self.exports = ExportsClient(client_wrapper=self._client_wrapper)
|
|
53
|
+
self.members = MembersClient(client_wrapper=self._client_wrapper)
|
|
51
54
|
self.stats = StatsClient(client_wrapper=self._client_wrapper)
|
|
52
55
|
self.assignments = AssignmentsClient(client_wrapper=self._client_wrapper)
|
|
53
56
|
self.pauses = PausesClient(client_wrapper=self._client_wrapper)
|
|
@@ -976,6 +979,7 @@ class AsyncProjectsClient:
|
|
|
976
979
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
977
980
|
self._client_wrapper = client_wrapper
|
|
978
981
|
self.exports = AsyncExportsClient(client_wrapper=self._client_wrapper)
|
|
982
|
+
self.members = AsyncMembersClient(client_wrapper=self._client_wrapper)
|
|
979
983
|
self.stats = AsyncStatsClient(client_wrapper=self._client_wrapper)
|
|
980
984
|
self.assignments = AsyncAssignmentsClient(client_wrapper=self._client_wrapper)
|
|
981
985
|
self.pauses = AsyncPausesClient(client_wrapper=self._client_wrapper)
|
|
@@ -0,0 +1,137 @@
|
|
|
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.lse_user import LseUser
|
|
7
|
+
from ...core.jsonable_encoder import jsonable_encoder
|
|
8
|
+
from ...core.unchecked_base_model import construct_type
|
|
9
|
+
from json.decoder import JSONDecodeError
|
|
10
|
+
from ...core.api_error import ApiError
|
|
11
|
+
from ...core.client_wrapper import AsyncClientWrapper
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class MembersClient:
|
|
15
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
16
|
+
self._client_wrapper = client_wrapper
|
|
17
|
+
|
|
18
|
+
def get(
|
|
19
|
+
self, id: int, *, user_ids: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
|
|
20
|
+
) -> typing.List[LseUser]:
|
|
21
|
+
"""
|
|
22
|
+
Retrieve the members for a specific project. Optionally filter by user IDs (comma-separated).
|
|
23
|
+
|
|
24
|
+
Parameters
|
|
25
|
+
----------
|
|
26
|
+
id : int
|
|
27
|
+
|
|
28
|
+
user_ids : typing.Optional[str]
|
|
29
|
+
Comma-separated list of user IDs to include. Example: user_ids=1,2,3
|
|
30
|
+
|
|
31
|
+
request_options : typing.Optional[RequestOptions]
|
|
32
|
+
Request-specific configuration.
|
|
33
|
+
|
|
34
|
+
Returns
|
|
35
|
+
-------
|
|
36
|
+
typing.List[LseUser]
|
|
37
|
+
List of users with membership information
|
|
38
|
+
|
|
39
|
+
Examples
|
|
40
|
+
--------
|
|
41
|
+
from label_studio_sdk import LabelStudio
|
|
42
|
+
|
|
43
|
+
client = LabelStudio(
|
|
44
|
+
api_key="YOUR_API_KEY",
|
|
45
|
+
)
|
|
46
|
+
client.projects.members.get(
|
|
47
|
+
id=1,
|
|
48
|
+
)
|
|
49
|
+
"""
|
|
50
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
51
|
+
f"api/projects/{jsonable_encoder(id)}/members/",
|
|
52
|
+
method="GET",
|
|
53
|
+
params={
|
|
54
|
+
"user_ids": user_ids,
|
|
55
|
+
},
|
|
56
|
+
request_options=request_options,
|
|
57
|
+
)
|
|
58
|
+
try:
|
|
59
|
+
if 200 <= _response.status_code < 300:
|
|
60
|
+
return typing.cast(
|
|
61
|
+
typing.List[LseUser],
|
|
62
|
+
construct_type(
|
|
63
|
+
type_=typing.List[LseUser], # type: ignore
|
|
64
|
+
object_=_response.json(),
|
|
65
|
+
),
|
|
66
|
+
)
|
|
67
|
+
_response_json = _response.json()
|
|
68
|
+
except JSONDecodeError:
|
|
69
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
70
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class AsyncMembersClient:
|
|
74
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
75
|
+
self._client_wrapper = client_wrapper
|
|
76
|
+
|
|
77
|
+
async def get(
|
|
78
|
+
self, id: int, *, user_ids: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
|
|
79
|
+
) -> typing.List[LseUser]:
|
|
80
|
+
"""
|
|
81
|
+
Retrieve the members for a specific project. Optionally filter by user IDs (comma-separated).
|
|
82
|
+
|
|
83
|
+
Parameters
|
|
84
|
+
----------
|
|
85
|
+
id : int
|
|
86
|
+
|
|
87
|
+
user_ids : typing.Optional[str]
|
|
88
|
+
Comma-separated list of user IDs to include. Example: user_ids=1,2,3
|
|
89
|
+
|
|
90
|
+
request_options : typing.Optional[RequestOptions]
|
|
91
|
+
Request-specific configuration.
|
|
92
|
+
|
|
93
|
+
Returns
|
|
94
|
+
-------
|
|
95
|
+
typing.List[LseUser]
|
|
96
|
+
List of users with membership information
|
|
97
|
+
|
|
98
|
+
Examples
|
|
99
|
+
--------
|
|
100
|
+
import asyncio
|
|
101
|
+
|
|
102
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
103
|
+
|
|
104
|
+
client = AsyncLabelStudio(
|
|
105
|
+
api_key="YOUR_API_KEY",
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
async def main() -> None:
|
|
110
|
+
await client.projects.members.get(
|
|
111
|
+
id=1,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
asyncio.run(main())
|
|
116
|
+
"""
|
|
117
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
118
|
+
f"api/projects/{jsonable_encoder(id)}/members/",
|
|
119
|
+
method="GET",
|
|
120
|
+
params={
|
|
121
|
+
"user_ids": user_ids,
|
|
122
|
+
},
|
|
123
|
+
request_options=request_options,
|
|
124
|
+
)
|
|
125
|
+
try:
|
|
126
|
+
if 200 <= _response.status_code < 300:
|
|
127
|
+
return typing.cast(
|
|
128
|
+
typing.List[LseUser],
|
|
129
|
+
construct_type(
|
|
130
|
+
type_=typing.List[LseUser], # type: ignore
|
|
131
|
+
object_=_response.json(),
|
|
132
|
+
),
|
|
133
|
+
)
|
|
134
|
+
_response_json = _response.json()
|
|
135
|
+
except JSONDecodeError:
|
|
136
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
137
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.client_wrapper import SyncClientWrapper
|
|
4
|
+
from .saml.client import SamlClient
|
|
5
|
+
from .scim.client import ScimClient
|
|
6
|
+
from ..core.client_wrapper import AsyncClientWrapper
|
|
7
|
+
from .saml.client import AsyncSamlClient
|
|
8
|
+
from .scim.client import AsyncScimClient
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class SsoClient:
|
|
12
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
13
|
+
self._client_wrapper = client_wrapper
|
|
14
|
+
self.saml = SamlClient(client_wrapper=self._client_wrapper)
|
|
15
|
+
self.scim = ScimClient(client_wrapper=self._client_wrapper)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class AsyncSsoClient:
|
|
19
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
20
|
+
self._client_wrapper = client_wrapper
|
|
21
|
+
self.saml = AsyncSamlClient(client_wrapper=self._client_wrapper)
|
|
22
|
+
self.scim = AsyncScimClient(client_wrapper=self._client_wrapper)
|