77# pylint: disable=too-many-arguments
88
99
10- from fastapi import APIRouter , status
10+ from enum import Enum
11+ from typing import Annotated
12+
13+ from fastapi import APIRouter , Depends , status
1114from models_library .api_schemas_webserver .workspaces import (
1215 CreateWorkspaceBodyParams ,
1316 PutWorkspaceBodyParams ,
1417 WorkspaceGet ,
1518)
1619from models_library .generics import Envelope
17- from models_library .users import GroupID
1820from models_library .workspaces import WorkspaceID
1921from simcore_service_webserver ._meta import API_VTAG
2022from simcore_service_webserver .workspaces ._groups_api import WorkspaceGroupGet
2123from simcore_service_webserver .workspaces ._groups_handlers import (
2224 _WorkspacesGroupsBodyParams ,
25+ _WorkspacesGroupsPathParams ,
2326)
2427
2528router = APIRouter (
3740 response_model = Envelope [WorkspaceGet ],
3841 status_code = status .HTTP_201_CREATED ,
3942)
40- async def create_workspace (body : CreateWorkspaceBodyParams ):
43+ async def create_workspace (_body : CreateWorkspaceBodyParams ):
4144 ...
4245
4346
@@ -61,7 +64,7 @@ async def get_workspace(workspace_id: WorkspaceID):
6164 "/workspaces/{workspace_id}" ,
6265 response_model = Envelope [WorkspaceGet ],
6366)
64- async def replace_workspace (workspace_id : WorkspaceID , body : PutWorkspaceBodyParams ):
67+ async def replace_workspace (workspace_id : WorkspaceID , _body : PutWorkspaceBodyParams ):
6568 ...
6669
6770
@@ -74,22 +77,26 @@ async def delete_workspace(workspace_id: WorkspaceID):
7477
7578
7679### Workspaces groups
80+ _extra_tags : list [str | Enum ] = ["groups" ]
7781
7882
7983@router .post (
8084 "/workspaces/{workspace_id}/groups/{group_id}" ,
8185 response_model = Envelope [WorkspaceGroupGet ],
8286 status_code = status .HTTP_201_CREATED ,
87+ tags = _extra_tags ,
8388)
8489async def create_workspace_group (
85- workspace_id : WorkspaceID , group_id : GroupID , body : _WorkspacesGroupsBodyParams
90+ _path_parms : Annotated [_WorkspacesGroupsPathParams , Depends ()],
91+ _body : _WorkspacesGroupsBodyParams ,
8692):
8793 ...
8894
8995
9096@router .get (
9197 "/workspaces/{workspace_id}/groups" ,
9298 response_model = Envelope [list [WorkspaceGroupGet ]],
99+ tags = _extra_tags ,
93100)
94101async def list_workspace_groups (workspace_id : WorkspaceID ):
95102 ...
@@ -98,16 +105,21 @@ async def list_workspace_groups(workspace_id: WorkspaceID):
98105@router .put (
99106 "/workspaces/{workspace_id}/groups/{group_id}" ,
100107 response_model = Envelope [WorkspaceGroupGet ],
108+ tags = _extra_tags ,
101109)
102110async def replace_workspace_group (
103- workspace_id : WorkspaceID , group_id : GroupID , body : _WorkspacesGroupsBodyParams
111+ _path_parms : Annotated [_WorkspacesGroupsPathParams , Depends ()],
112+ _body : _WorkspacesGroupsBodyParams ,
104113):
105114 ...
106115
107116
108117@router .delete (
109118 "/workspaces/{workspace_id}/groups/{group_id}" ,
110119 status_code = status .HTTP_204_NO_CONTENT ,
120+ tags = _extra_tags ,
111121)
112- async def delete_workspace_group (workspace_id : WorkspaceID , group_id : GroupID ):
122+ async def delete_workspace_group (
123+ _path_parms : Annotated [_WorkspacesGroupsPathParams , Depends ()]
124+ ):
113125 ...
0 commit comments