Skip to content

Commit f15108f

Browse files
feat: UTC-507: Organization member tag user management (#727)
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 4879e9c commit f15108f

22 files changed

Lines changed: 659 additions & 11 deletions

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reference.md

Lines changed: 131 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29301,6 +29301,104 @@ client.organizations.member_tags.create(
2930129301
</dl>
2930229302

2930329303

29304+
</dd>
29305+
</dl>
29306+
</details>
29307+
29308+
<details><summary><code>client.organizations.member_tags.<a href="src/label_studio_sdk/organizations/member_tags/client.py">assign</a>(...) -&gt; AsyncHttpResponse[AssignMemberTagsResponse]</code></summary>
29309+
<dl>
29310+
<dd>
29311+
29312+
#### 📝 Description
29313+
29314+
<dl>
29315+
<dd>
29316+
29317+
<dl>
29318+
<dd>
29319+
29320+
<Card href="https://humansignal.com/goenterprise">
29321+
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
29322+
<p style="margin-top: 10px; font-size: 14px;">
29323+
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
29324+
</p>
29325+
</Card>
29326+
Assign tags to multiple organization members in bulk.
29327+
</dd>
29328+
</dl>
29329+
</dd>
29330+
</dl>
29331+
29332+
#### 🔌 Usage
29333+
29334+
<dl>
29335+
<dd>
29336+
29337+
<dl>
29338+
<dd>
29339+
29340+
```python
29341+
from label_studio_sdk import LabelStudio, OrganizationMemberTagAssignmentRequest
29342+
29343+
client = LabelStudio(
29344+
api_key="YOUR_API_KEY",
29345+
)
29346+
client.organizations.member_tags.assign(
29347+
id=1,
29348+
assignments=[
29349+
OrganizationMemberTagAssignmentRequest(
29350+
tag_ids=[1],
29351+
user_id=1,
29352+
)
29353+
],
29354+
)
29355+
29356+
```
29357+
</dd>
29358+
</dl>
29359+
</dd>
29360+
</dl>
29361+
29362+
#### ⚙️ Parameters
29363+
29364+
<dl>
29365+
<dd>
29366+
29367+
<dl>
29368+
<dd>
29369+
29370+
**id:** `int` — A unique integer value identifying this organization.
29371+
29372+
</dd>
29373+
</dl>
29374+
29375+
<dl>
29376+
<dd>
29377+
29378+
**assignments:** `typing.Sequence[OrganizationMemberTagAssignmentRequest]` — List of member tag assignments to assign.
29379+
29380+
</dd>
29381+
</dl>
29382+
29383+
<dl>
29384+
<dd>
29385+
29386+
**overwrite:** `typing.Optional[bool]` — If true, replace all existing tag assignments for each user with the provided ones. If false, only add new assignments.
29387+
29388+
</dd>
29389+
</dl>
29390+
29391+
<dl>
29392+
<dd>
29393+
29394+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
29395+
29396+
</dd>
29397+
</dl>
29398+
</dd>
29399+
</dl>
29400+
29401+
2930429402
</dd>
2930529403
</dl>
2930629404
</details>
@@ -29712,6 +29810,14 @@ Filter members by organization role. Accepts single role or comma-separated list
2971229810
<dl>
2971329811
<dd>
2971429812

29813+
**tags:** `typing.Optional[str]` — Filter members by tags. Use a comma-separated list of tag IDs.
29814+
29815+
</dd>
29816+
</dl>
29817+
29818+
<dl>
29819+
<dd>
29820+
2971529821
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
2971629822

2971729823
</dd>
@@ -31145,7 +31251,7 @@ client.projects.roles.get(
3114531251

3114631252

3114731253
This endpoint is deprecated in Enterprise. Use the async export API instead:
31148-
POST /api/projects/\{id\}/exports/ (see [Create new export](/api#operation/api_projects_exports_create)).
31254+
POST /api/projects/{{id}}/exports/ (see [Create new export](/api#operation/api_projects_exports_create)).
3114931255

3115031256
In Label Studio Enterprise, this endpoint will always return a 404 Not Found response with instructions to use the async export API.
3115131257

@@ -34683,6 +34789,14 @@ client.projects.members.bulk.post(
3468334789
<dl>
3468434790
<dd>
3468534791

34792+
**tags:** `typing.Optional[str]` — Filter tags by in list (comma-separated values)
34793+
34794+
</dd>
34795+
</dl>
34796+
34797+
<dl>
34798+
<dd>
34799+
3468634800
**excluded:** `typing.Optional[typing.Sequence[int]]`
3468734801

3468834802
</dd>
@@ -34815,6 +34929,14 @@ client.projects.members.bulk.delete(
3481534929
<dl>
3481634930
<dd>
3481734931

34932+
**tags:** `typing.Optional[str]` — Filter tags by in list (comma-separated values)
34933+
34934+
</dd>
34935+
</dl>
34936+
34937+
<dl>
34938+
<dd>
34939+
3481834940
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
3481934941

3482034942
</dd>
@@ -35014,6 +35136,14 @@ Returns users who have any of the specified roles either:
3501435136
<dl>
3501535137
<dd>
3501635138

35139+
**tags:** `typing.Optional[str]` — Filter members by tags. Use a comma-separated list of tag IDs.
35140+
35141+
</dd>
35142+
</dl>
35143+
35144+
<dl>
35145+
<dd>
35146+
3501735147
**with_deleted:** `typing.Optional[bool]` — Include deleted members in the results
3501835148

3501935149
</dd>

src/label_studio_sdk/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
OrganizationMemberContributedToProjectsItem,
128128
OrganizationMemberCreatedProjectsItem,
129129
OrganizationMemberTag,
130+
OrganizationMemberTagAssignmentRequest,
130131
OrganizationMembership,
131132
OrganizationPermission,
132133
OrganizationPermissionRequest,
@@ -188,6 +189,7 @@
188189
SerializationOptions,
189190
SerializationOptionsRequest,
190191
SessionTimeoutPolicy,
192+
SimpleOrganizationMemberTag,
191193
SkillNameEnum,
192194
SkipQueueEnum,
193195
SkippedEnum,
@@ -500,6 +502,7 @@
500502
"OrganizationMemberContributedToProjectsItem": ".types",
501503
"OrganizationMemberCreatedProjectsItem": ".types",
502504
"OrganizationMemberTag": ".types",
505+
"OrganizationMemberTagAssignmentRequest": ".types",
503506
"OrganizationMembership": ".types",
504507
"OrganizationPermission": ".types",
505508
"OrganizationPermissionRequest": ".types",
@@ -562,6 +565,7 @@
562565
"SerializationOptions": ".types",
563566
"SerializationOptionsRequest": ".types",
564567
"SessionTimeoutPolicy": ".types",
568+
"SimpleOrganizationMemberTag": ".types",
565569
"SkillNameEnum": ".types",
566570
"SkipQueueEnum": ".types",
567571
"SkippedEnum": ".types",
@@ -831,6 +835,7 @@ def __dir__():
831835
"OrganizationMemberContributedToProjectsItem",
832836
"OrganizationMemberCreatedProjectsItem",
833837
"OrganizationMemberTag",
838+
"OrganizationMemberTagAssignmentRequest",
834839
"OrganizationMembership",
835840
"OrganizationPermission",
836841
"OrganizationPermissionRequest",
@@ -893,6 +898,7 @@ def __dir__():
893898
"SerializationOptions",
894899
"SerializationOptionsRequest",
895900
"SessionTimeoutPolicy",
901+
"SimpleOrganizationMemberTag",
896902
"SkillNameEnum",
897903
"SkipQueueEnum",
898904
"SkippedEnum",

src/label_studio_sdk/organizations/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
if typing.TYPE_CHECKING:
99
from . import invites, member_tags, members, permissions
10+
from .member_tags import AssignMemberTagsResponse
1011
_dynamic_imports: typing.Dict[str, str] = {
12+
"AssignMemberTagsResponse": ".member_tags",
1113
"invites": ".invites",
1214
"member_tags": ".member_tags",
1315
"members": ".members",
@@ -36,4 +38,4 @@ def __dir__():
3638
return sorted(lazy_attrs)
3739

3840

39-
__all__ = ["invites", "member_tags", "members", "permissions"]
41+
__all__ = ["AssignMemberTagsResponse", "invites", "member_tags", "members", "permissions"]

src/label_studio_sdk/organizations/member_tags/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
from importlib import import_module
77

88
if typing.TYPE_CHECKING:
9+
from .types import AssignMemberTagsResponse
910
from . import bulk
1011
from .bulk import DeleteBulkResponse, PostBulkResponse
11-
_dynamic_imports: typing.Dict[str, str] = {"DeleteBulkResponse": ".bulk", "PostBulkResponse": ".bulk", "bulk": ".bulk"}
12+
_dynamic_imports: typing.Dict[str, str] = {
13+
"AssignMemberTagsResponse": ".types",
14+
"DeleteBulkResponse": ".bulk",
15+
"PostBulkResponse": ".bulk",
16+
"bulk": ".bulk",
17+
}
1218

1319

1420
def __getattr__(attr_name: str) -> typing.Any:
@@ -32,4 +38,4 @@ def __dir__():
3238
return sorted(lazy_attrs)
3339

3440

35-
__all__ = ["DeleteBulkResponse", "PostBulkResponse", "bulk"]
41+
__all__ = ["AssignMemberTagsResponse", "DeleteBulkResponse", "PostBulkResponse", "bulk"]

0 commit comments

Comments
 (0)