Skip to content

Commit 74de937

Browse files
robot-ci-heartexfern-api[bot]mcanu
authored
feat: FIT-477: Bulk workspace members assign/unassign (#553)
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Marcel Canu <[email protected]>
1 parent 727a301 commit 74de937

File tree

13 files changed

+688
-1
lines changed

13 files changed

+688
-1
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
types:
2+
BulkPostResponse:
3+
properties:
4+
assignments: optional<integer>
5+
source:
6+
openapi: openapi/openapi.yaml
7+
BulkDeleteResponse:
8+
properties:
9+
unassignments: optional<integer>
10+
source:
11+
openapi: openapi/openapi.yaml
12+
service:
13+
auth: false
14+
base-path: ''
15+
endpoints:
16+
post:
17+
path: /api/workspaces/{id}/memberships/bulk/
18+
method: POST
19+
auth: true
20+
docs: Assign workspace members in bulk.
21+
source:
22+
openapi: openapi/openapi.yaml
23+
path-parameters:
24+
id: integer
25+
display-name: Bulk assign workspace members
26+
request:
27+
name: WorkspaceMemberBulkAssignRequest
28+
body:
29+
properties:
30+
all: boolean
31+
excluded: optional<list<integer>>
32+
included: optional<list<integer>>
33+
content-type: application/json
34+
response:
35+
docs: ''
36+
type: BulkPostResponse
37+
examples:
38+
- path-parameters:
39+
id: 1
40+
request:
41+
all: true
42+
response:
43+
body:
44+
assignments: 1
45+
audiences:
46+
- public
47+
delete:
48+
path: /api/workspaces/{id}/memberships/bulk/
49+
method: DELETE
50+
auth: true
51+
docs: >-
52+
Unassign workspace members in bulk. Allows the same request body as bulk
53+
assign.
54+
source:
55+
openapi: openapi/openapi.yaml
56+
path-parameters:
57+
id: integer
58+
display-name: Bulk unassign workspace members
59+
response:
60+
docs: ''
61+
type: BulkDeleteResponse
62+
examples:
63+
- path-parameters:
64+
id: 1
65+
response:
66+
body:
67+
unassignments: 1
68+
audiences:
69+
- public
70+
source:
71+
openapi: openapi/openapi.yaml

.mock/openapi/openapi.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15344,6 +15344,81 @@ paths:
1534415344
- workspaces
1534515345
- members
1534615346
x-fern-sdk-method-name: create
15347+
/api/workspaces/{id}/memberships/bulk/:
15348+
delete:
15349+
description: Unassign workspace members in bulk. Allows the same request body as bulk assign.
15350+
operationId: api_workspaces_memberships_bulk_destroy
15351+
parameters:
15352+
- in: path
15353+
name: id
15354+
required: true
15355+
schema:
15356+
type: integer
15357+
responses:
15358+
'200':
15359+
content:
15360+
application/json:
15361+
schema:
15362+
properties:
15363+
unassignments:
15364+
type: integer
15365+
type: object
15366+
description: ''
15367+
security:
15368+
- Token: []
15369+
summary: Bulk unassign workspace members
15370+
tags:
15371+
- Workspaces
15372+
x-fern-audiences:
15373+
- public
15374+
x-fern-sdk-group-name:
15375+
- workspaces
15376+
- members
15377+
- bulk
15378+
x-fern-sdk-method-name: delete
15379+
post:
15380+
description: Assign workspace members in bulk.
15381+
operationId: api_workspaces_memberships_bulk_create
15382+
parameters:
15383+
- in: path
15384+
name: id
15385+
required: true
15386+
schema:
15387+
type: integer
15388+
requestBody:
15389+
content:
15390+
application/json:
15391+
schema:
15392+
$ref: '#/components/schemas/WorkspaceMemberBulkAssignRequest'
15393+
application/x-www-form-urlencoded:
15394+
schema:
15395+
$ref: '#/components/schemas/WorkspaceMemberBulkAssignRequest'
15396+
multipart/form-data:
15397+
schema:
15398+
$ref: '#/components/schemas/WorkspaceMemberBulkAssignRequest'
15399+
required: true
15400+
responses:
15401+
'200':
15402+
content:
15403+
application/json:
15404+
schema:
15405+
properties:
15406+
assignments:
15407+
type: integer
15408+
type: object
15409+
description: ''
15410+
security:
15411+
- Token: []
15412+
summary: Bulk assign workspace members
15413+
tags:
15414+
- Workspaces
15415+
x-fern-audiences:
15416+
- public
15417+
x-fern-sdk-group-name:
15418+
- workspaces
15419+
- members
15420+
- bulk
15421+
x-fern-sdk-method-name: post
1534715422
/api/workspaces/{id}/projects/:
1534815423
delete:
1534915424
description: Delete projects from a specific workspace.
@@ -27577,6 +27652,23 @@ components:
2757727652
- id
2757827653
- title
2757927654
type: object
27655+
WorkspaceMemberBulkAssignRequest:
27656+
properties:
27657+
all:
27658+
type: boolean
27659+
excluded:
27660+
items:
27661+
minimum: 1
27662+
type: integer
27663+
type: array
27664+
included:
27665+
items:
27666+
minimum: 1
27667+
type: integer
27668+
type: array
27669+
required:
27670+
- all
27671+
type: object
2758027672
WorkspaceMemberCreate:
2758127673
properties:
2758227674
user:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "label-studio-sdk"
33

44
[tool.poetry]
55
name = "label-studio-sdk"
6-
version = "2.0.5.dev"
6+
version = "2.0.5"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23408,3 +23408,169 @@ client.workspaces.members.delete(
2340823408
</dl>
2340923409
</details>
2341023410

23411+
## Workspaces Members Bulk
23412+
<details><summary><code>client.workspaces.members.bulk.<a href="src/label_studio_sdk/workspaces/members/bulk/client.py">post</a>(...)</code></summary>
23413+
<dl>
23414+
<dd>
23415+
23416+
#### 📝 Description
23417+
23418+
<dl>
23419+
<dd>
23420+
23421+
<dl>
23422+
<dd>
23423+
23424+
Assign workspace members in bulk.
23425+
</dd>
23426+
</dl>
23427+
</dd>
23428+
</dl>
23429+
23430+
#### 🔌 Usage
23431+
23432+
<dl>
23433+
<dd>
23434+
23435+
<dl>
23436+
<dd>
23437+
23438+
```python
23439+
from label_studio_sdk import LabelStudio
23440+
23441+
client = LabelStudio(
23442+
api_key="YOUR_API_KEY",
23443+
)
23444+
client.workspaces.members.bulk.post(
23445+
id=1,
23446+
all_=True,
23447+
)
23448+
23449+
```
23450+
</dd>
23451+
</dl>
23452+
</dd>
23453+
</dl>
23454+
23455+
#### ⚙️ Parameters
23456+
23457+
<dl>
23458+
<dd>
23459+
23460+
<dl>
23461+
<dd>
23462+
23463+
**id:** `int`
23464+
23465+
</dd>
23466+
</dl>
23467+
23468+
<dl>
23469+
<dd>
23470+
23471+
**all_:** `bool`
23472+
23473+
</dd>
23474+
</dl>
23475+
23476+
<dl>
23477+
<dd>
23478+
23479+
**excluded:** `typing.Optional[typing.Sequence[int]]`
23480+
23481+
</dd>
23482+
</dl>
23483+
23484+
<dl>
23485+
<dd>
23486+
23487+
**included:** `typing.Optional[typing.Sequence[int]]`
23488+
23489+
</dd>
23490+
</dl>
23491+
23492+
<dl>
23493+
<dd>
23494+
23495+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
23496+
23497+
</dd>
23498+
</dl>
23499+
</dd>
23500+
</dl>
23501+
23502+
23503+
</dd>
23504+
</dl>
23505+
</details>
23506+
23507+
<details><summary><code>client.workspaces.members.bulk.<a href="src/label_studio_sdk/workspaces/members/bulk/client.py">delete</a>(...)</code></summary>
23508+
<dl>
23509+
<dd>
23510+
23511+
#### 📝 Description
23512+
23513+
<dl>
23514+
<dd>
23515+
23516+
<dl>
23517+
<dd>
23518+
23519+
Unassign workspace members in bulk. Allows the same request body as bulk assign.
23520+
</dd>
23521+
</dl>
23522+
</dd>
23523+
</dl>
23524+
23525+
#### 🔌 Usage
23526+
23527+
<dl>
23528+
<dd>
23529+
23530+
<dl>
23531+
<dd>
23532+
23533+
```python
23534+
from label_studio_sdk import LabelStudio
23535+
23536+
client = LabelStudio(
23537+
api_key="YOUR_API_KEY",
23538+
)
23539+
client.workspaces.members.bulk.delete(
23540+
id=1,
23541+
)
23542+
23543+
```
23544+
</dd>
23545+
</dl>
23546+
</dd>
23547+
</dl>
23548+
23549+
#### ⚙️ Parameters
23550+
23551+
<dl>
23552+
<dd>
23553+
23554+
<dl>
23555+
<dd>
23556+
23557+
**id:** `int`
23558+
23559+
</dd>
23560+
</dl>
23561+
23562+
<dl>
23563+
<dd>
23564+
23565+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
23566+
23567+
</dd>
23568+
</dl>
23569+
</dd>
23570+
</dl>
23571+
23572+
23573+
</dd>
23574+
</dl>
23575+
</details>
23576+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
# This file was auto-generated by Fern from our API Definition.
22

3+
from . import bulk
4+
from .bulk import BulkDeleteResponse, BulkPostResponse
5+
6+
__all__ = ["BulkDeleteResponse", "BulkPostResponse", "bulk"]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from .types import BulkDeleteResponse, BulkPostResponse
4+
5+
__all__ = ["BulkDeleteResponse", "BulkPostResponse"]

0 commit comments

Comments
 (0)