From 0b7ece0554de291d05d446ea5240e56724e384e8 Mon Sep 17 00:00:00 2001 From: niklub Date: Sat, 13 Jul 2024 08:50:26 +0100 Subject: [PATCH] fix: RND-103: add workspace.is_archived (#264) * fix: RND-103: add workspace.is_archived * :herb: Fern Regeneration -- July 13, 2024 (#263) SDK regeneration Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> --------- Co-authored-by: nik Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com> --- .mock/definition/workspaces.yml | 6 + README.md | 16 +- poetry.lock | 6 +- reference.md | 472 +--------------------- src/label_studio_sdk/workspaces/client.py | 20 + 5 files changed, 38 insertions(+), 482 deletions(-) diff --git a/.mock/definition/workspaces.yml b/.mock/definition/workspaces.yml index 0f593c2db..022f75b22 100644 --- a/.mock/definition/workspaces.yml +++ b/.mock/definition/workspaces.yml @@ -72,6 +72,9 @@ service: is_personal: type: optional docs: Is workspace personal + is_archived: + type: optional + docs: Is workspace archived color: type: optional docs: Workspace color in HEX format @@ -175,6 +178,9 @@ service: is_personal: type: optional docs: Is workspace personal + is_archived: + type: optional + docs: Is workspace archived color: type: optional docs: Workspace color in HEX format diff --git a/README.md b/README.md index 84213b651..48804904d 100644 --- a/README.md +++ b/README.md @@ -62,18 +62,16 @@ Check more examples [here](https://api.labelstud.io/). ## Create a new project ```python +from label_studio_sdk.label_interface import LabelInterface +from label_studio_sdk.label_interface.create import labels + project = ls.projects.create( name="Project name", description="Project description", - label_config=""" - - - - - - """ + label_config=LabelInterface.create({ + "image": "Image", + "bbox": labels(["cat", "dog"], tag_type="RectangleLabels") + }) ) ``` diff --git a/poetry.lock b/poetry.lock index 8d1487335..ef2d3b9f3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -203,13 +203,13 @@ files = [ [[package]] name = "exceptiongroup" -version = "1.2.1" +version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, - {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, ] [package.extras] diff --git a/reference.md b/reference.md index 33dd67295..aeb2f8d2f 100644 --- a/reference.md +++ b/reference.md @@ -15242,249 +15242,7 @@ client.workspaces.create()
-**color:** `typing.Optional[str]` — Workspace color in HEX format - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
- - - - - - - - -
client.workspaces.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get information about a specific workspace. You will need to provide the workspace ID. You can find this using [List workspaces](list). -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from label_studio_sdk.client import LabelStudio - -client = LabelStudio( - api_key="YOUR_API_KEY", -) -client.workspaces.get( - id=1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `int` — Workspace ID - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspaces.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete a specific workspace. You will need to provide the workspace ID. You can find this using [List workspaces](list). -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from label_studio_sdk.client import LabelStudio - -client = LabelStudio( - api_key="YOUR_API_KEY", -) -client.workspaces.delete( - id=1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `int` — Workspace ID - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspaces.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update a specific workspace. You will need to provide the workspace ID. You can find this using [List workspaces](list). -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from label_studio_sdk.client import LabelStudio - -client = LabelStudio( - api_key="YOUR_API_KEY", -) -client.workspaces.update( - id=1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `int` — Workspace ID - -
-
- -
-
- -**title:** `typing.Optional[str]` — Workspace title - -
-
- -
-
- -**description:** `typing.Optional[str]` — Workspace description - -
-
- -
-
- -**is_public:** `typing.Optional[bool]` — Is workspace public - -
-
- -
-
- -**is_personal:** `typing.Optional[bool]` — Is workspace personal +**is_archived:** `typing.Optional[bool]` — Is workspace archived
@@ -15512,230 +15270,4 @@ client.workspaces.update(
-## Workspaces Members -
client.workspaces.members.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -List all workspace memberships for a specific workspace. You will need to provide the workspace ID. You can find this using [List workspaces](list). -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from label_studio_sdk.client import LabelStudio - -client = LabelStudio( - api_key="YOUR_API_KEY", -) -client.workspaces.members.list( - id=1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `int` — Workspace ID - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspaces.members.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a new workspace membership. You will need to provide the workspace ID. You can find this using [List workspaces](list). -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from label_studio_sdk.client import LabelStudio - -client = LabelStudio( - api_key="YOUR_API_KEY", -) -client.workspaces.members.create( - id=1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `int` — Workspace ID - -
-
- -
-
- -**user:** `typing.Optional[int]` — User ID of the workspace member - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspaces.members.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete a specific workspace membership. You will need to provide the workspace ID and the user ID. You can find this using [List workspace memberships](list). -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from label_studio_sdk.client import LabelStudio - -client = LabelStudio( - api_key="YOUR_API_KEY", -) -client.workspaces.members.delete( - id=1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `int` — Workspace ID - -
-
- -
-
- -**user:** `typing.Optional[int]` — User ID of the workspace member - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- +
client.workspaces.get(...) diff --git a/src/label_studio_sdk/workspaces/client.py b/src/label_studio_sdk/workspaces/client.py index febb191e4..452ff3f6d 100644 --- a/src/label_studio_sdk/workspaces/client.py +++ b/src/label_studio_sdk/workspaces/client.py @@ -65,6 +65,7 @@ def create( description: typing.Optional[str] = OMIT, is_public: typing.Optional[bool] = OMIT, is_personal: typing.Optional[bool] = OMIT, + is_archived: typing.Optional[bool] = OMIT, color: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> Workspace: @@ -89,6 +90,9 @@ def create( is_personal : typing.Optional[bool] Is workspace personal + is_archived : typing.Optional[bool] + Is workspace archived + color : typing.Optional[str] Workspace color in HEX format @@ -117,6 +121,7 @@ def create( "description": description, "is_public": is_public, "is_personal": is_personal, + "is_archived": is_archived, "color": color, }, request_options=request_options, @@ -215,6 +220,7 @@ def update( description: typing.Optional[str] = OMIT, is_public: typing.Optional[bool] = OMIT, is_personal: typing.Optional[bool] = OMIT, + is_archived: typing.Optional[bool] = OMIT, color: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> Workspace: @@ -238,6 +244,9 @@ def update( is_personal : typing.Optional[bool] Is workspace personal + is_archived : typing.Optional[bool] + Is workspace archived + color : typing.Optional[str] Workspace color in HEX format @@ -268,6 +277,7 @@ def update( "description": description, "is_public": is_public, "is_personal": is_personal, + "is_archived": is_archived, "color": color, }, request_options=request_options, @@ -332,6 +342,7 @@ async def create( description: typing.Optional[str] = OMIT, is_public: typing.Optional[bool] = OMIT, is_personal: typing.Optional[bool] = OMIT, + is_archived: typing.Optional[bool] = OMIT, color: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> Workspace: @@ -356,6 +367,9 @@ async def create( is_personal : typing.Optional[bool] Is workspace personal + is_archived : typing.Optional[bool] + Is workspace archived + color : typing.Optional[str] Workspace color in HEX format @@ -384,6 +398,7 @@ async def create( "description": description, "is_public": is_public, "is_personal": is_personal, + "is_archived": is_archived, "color": color, }, request_options=request_options, @@ -482,6 +497,7 @@ async def update( description: typing.Optional[str] = OMIT, is_public: typing.Optional[bool] = OMIT, is_personal: typing.Optional[bool] = OMIT, + is_archived: typing.Optional[bool] = OMIT, color: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> Workspace: @@ -505,6 +521,9 @@ async def update( is_personal : typing.Optional[bool] Is workspace personal + is_archived : typing.Optional[bool] + Is workspace archived + color : typing.Optional[str] Workspace color in HEX format @@ -535,6 +554,7 @@ async def update( "description": description, "is_public": is_public, "is_personal": is_personal, + "is_archived": is_archived, "color": color, }, request_options=request_options,