77from typing import Annotated
88
99from fastapi import APIRouter , Depends , status
10+ from models_library .api_schemas_webserver .projects_access_rights import (
11+ ProjectsGroupsBodyParams ,
12+ ProjectsGroupsPathParams ,
13+ ProjectShare ,
14+ ProjectShareAccepted ,
15+ )
1016from models_library .generics import Envelope
1117from simcore_service_webserver ._meta import API_VTAG
1218from simcore_service_webserver .projects ._controller ._rest_schemas import (
1319 ProjectPathParams ,
1420)
15- from simcore_service_webserver .projects ._controller .groups_rest import (
16- _ProjectsGroupsBodyParams ,
17- _ProjectsGroupsPathParams ,
18- )
1921from simcore_service_webserver .projects ._groups_service import ProjectGroupGet
2022
2123router = APIRouter (
2426)
2527
2628
29+ @router .post (
30+ "/projects/{project_id}:share" ,
31+ response_model = Envelope [ProjectShareAccepted ],
32+ status_code = status .HTTP_202_ACCEPTED ,
33+ responses = {
34+ status .HTTP_202_ACCEPTED : {
35+ "description" : "The request to share the project has been accepted, but the actual sharing process has to be confirmd."
36+ }
37+ },
38+ )
39+ async def share_project (
40+ _path : Annotated [ProjectPathParams , Depends ()],
41+ _body : ProjectShare ,
42+ ): ...
43+
44+
2745@router .post (
2846 "/projects/{project_id}/groups/{group_id}" ,
2947 response_model = Envelope [ProjectGroupGet ],
3048 status_code = status .HTTP_201_CREATED ,
3149)
3250async def create_project_group (
33- _path : Annotated [_ProjectsGroupsPathParams , Depends ()],
34- _body : _ProjectsGroupsBodyParams ,
51+ _path : Annotated [ProjectsGroupsPathParams , Depends ()],
52+ _body : ProjectsGroupsBodyParams ,
3553): ...
3654
3755
@@ -47,8 +65,8 @@ async def list_project_groups(_path: Annotated[ProjectPathParams, Depends()]): .
4765 response_model = Envelope [ProjectGroupGet ],
4866)
4967async def replace_project_group (
50- _path : Annotated [_ProjectsGroupsPathParams , Depends ()],
51- _body : _ProjectsGroupsBodyParams ,
68+ _path : Annotated [ProjectsGroupsPathParams , Depends ()],
69+ _body : ProjectsGroupsBodyParams ,
5270): ...
5371
5472
@@ -57,5 +75,5 @@ async def replace_project_group(
5775 status_code = status .HTTP_204_NO_CONTENT ,
5876)
5977async def delete_project_group (
60- _path : Annotated [_ProjectsGroupsPathParams , Depends ()],
78+ _path : Annotated [ProjectsGroupsPathParams , Depends ()],
6179): ...
0 commit comments