-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/drop-on-folder
- Loading branch information
Showing
64 changed files
with
1,954 additions
and
541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
""" Helper script to generate OAS automatically | ||
""" | ||
|
||
# pylint: disable=redefined-outer-name | ||
# pylint: disable=unused-argument | ||
# pylint: disable=unused-variable | ||
# pylint: disable=too-many-arguments | ||
|
||
from typing import Annotated | ||
|
||
from _common import as_query | ||
from fastapi import APIRouter, Depends | ||
from models_library.api_schemas_webserver.licensed_items_purchases import ( | ||
LicensedItemPurchaseGet, | ||
) | ||
from models_library.generics import Envelope | ||
from models_library.rest_error import EnvelopedError | ||
from models_library.rest_pagination import Page | ||
from simcore_service_webserver._meta import API_VTAG | ||
from simcore_service_webserver.licenses._exceptions_handlers import _TO_HTTP_ERROR_MAP | ||
from simcore_service_webserver.licenses._licensed_items_checkouts_models import ( | ||
LicensedItemCheckoutPathParams, | ||
LicensedItemsCheckoutsListQueryParams, | ||
) | ||
from simcore_service_webserver.wallets._handlers import WalletsPathParams | ||
|
||
router = APIRouter( | ||
prefix=f"/{API_VTAG}", | ||
tags=[ | ||
"licenses", | ||
], | ||
responses={ | ||
i.status_code: {"model": EnvelopedError} for i in _TO_HTTP_ERROR_MAP.values() | ||
}, | ||
) | ||
|
||
|
||
@router.get( | ||
"/wallets/{wallet_id}/licensed-items-checkouts", | ||
response_model=Page[LicensedItemPurchaseGet], | ||
tags=["wallets"], | ||
) | ||
async def list_licensed_item_checkouts_for_wallet( | ||
_path: Annotated[WalletsPathParams, Depends()], | ||
_query: Annotated[as_query(LicensedItemsCheckoutsListQueryParams), Depends()], | ||
): | ||
... | ||
|
||
|
||
@router.get( | ||
"/licensed-items-checkouts/{licensed_item_checkout_id}", | ||
response_model=Envelope[LicensedItemPurchaseGet], | ||
) | ||
async def get_licensed_item_checkout( | ||
_path: Annotated[LicensedItemCheckoutPathParams, Depends()], | ||
): | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
) | ||
from ..users import UserID, UserNameID | ||
from ..utils.common_validators import create__check_only_one_is_set__root_validator | ||
from ._base import InputSchema, OutputSchema | ||
from ._base import InputSchema, OutputSchema, OutputSchemaWithoutCamelCase | ||
|
||
S = TypeVar("S", bound=BaseModel) | ||
|
||
|
@@ -248,8 +248,7 @@ def from_model( | |
) | ||
|
||
|
||
class GroupUserGet(BaseModel): | ||
# OutputSchema | ||
class GroupUserGet(OutputSchemaWithoutCamelCase): | ||
|
||
# Identifiers | ||
id: Annotated[UserID | None, Field(description="the user's id")] = None | ||
|
@@ -275,7 +274,14 @@ class GroupUserGet(BaseModel): | |
] = None | ||
|
||
# Access Rights | ||
access_rights: GroupAccessRights = Field(..., alias="accessRights") | ||
access_rights: Annotated[ | ||
GroupAccessRights | None, | ||
Field( | ||
alias="accessRights", | ||
description="If group is standard, these are these are the access rights of the user to it." | ||
"None if primary group.", | ||
), | ||
] = None | ||
|
||
model_config = ConfigDict( | ||
populate_by_name=True, | ||
|
@@ -293,7 +299,23 @@ class GroupUserGet(BaseModel): | |
"write": False, | ||
"delete": False, | ||
}, | ||
} | ||
}, | ||
"examples": [ | ||
# unique member on a primary group with two different primacy settings | ||
{ | ||
"id": "16", | ||
"userName": "mrprivate", | ||
"gid": "55", | ||
}, | ||
{ | ||
"id": "56", | ||
"userName": "mrpublic", | ||
"login": "[email protected]", | ||
"first_name": "Mr", | ||
"last_name": "Public", | ||
"gid": "42", | ||
}, | ||
], | ||
}, | ||
) | ||
|
||
|
Oops, something went wrong.