-
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 remote-tracking branch 'upstream/master' into pr-osparc-orphane…
…d-containers-removal
- Loading branch information
Showing
259 changed files
with
6,529 additions
and
2,192 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
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._models import ( | ||
LicensedItemsPurchasesListQueryParams, | ||
LicensedItemsPurchasesPathParams, | ||
) | ||
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-purchases", | ||
response_model=Page[LicensedItemPurchaseGet], | ||
tags=["wallets"], | ||
) | ||
async def list_wallet_licensed_items_purchases( | ||
_path: Annotated[WalletsPathParams, Depends()], | ||
_query: Annotated[as_query(LicensedItemsPurchasesListQueryParams), Depends()], | ||
): | ||
... | ||
|
||
|
||
@router.get( | ||
"/licensed-items-purchases/{licensed_item_purchase_id}", | ||
response_model=Envelope[LicensedItemPurchaseGet], | ||
) | ||
async def get_licensed_item_purchase( | ||
_path: Annotated[LicensedItemsPurchasesPathParams, 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
13 changes: 13 additions & 0 deletions
13
packages/common-library/src/common_library/groups_enums.py
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,13 @@ | ||
import enum | ||
|
||
|
||
class GroupType(enum.Enum): | ||
""" | ||
standard: standard group, e.g. any group that is not a primary group or special group such as the everyone group | ||
primary: primary group, e.g. the primary group is the user own defined group that typically only contain the user (same as in linux) | ||
everyone: the only group for all users | ||
""" | ||
|
||
STANDARD = "standard" | ||
PRIMARY = "primary" | ||
EVERYONE = "everyone" |
2 changes: 1 addition & 1 deletion
2
packages/models-library/src/models_library/api_schemas_catalog/service_access_rights.py
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
56 changes: 56 additions & 0 deletions
56
...library/src/models_library/api_schemas_resource_usage_tracker/licensed_items_purchases.py
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,56 @@ | ||
from datetime import datetime | ||
from decimal import Decimal | ||
from typing import NamedTuple | ||
|
||
from models_library.licensed_items import LicensedItemID | ||
from models_library.products import ProductName | ||
from models_library.resource_tracker import PricingUnitCostId | ||
from models_library.resource_tracker_licensed_items_purchases import ( | ||
LicensedItemPurchaseID, | ||
) | ||
from models_library.users import UserID | ||
from models_library.wallets import WalletID | ||
from pydantic import BaseModel, ConfigDict, PositiveInt | ||
|
||
|
||
class LicensedItemPurchaseGet(BaseModel): | ||
licensed_item_purchase_id: LicensedItemPurchaseID | ||
product_name: ProductName | ||
licensed_item_id: LicensedItemID | ||
wallet_id: WalletID | ||
wallet_name: str | ||
pricing_unit_cost_id: PricingUnitCostId | ||
pricing_unit_cost: Decimal | ||
start_at: datetime | ||
expire_at: datetime | ||
num_of_seats: int | ||
purchased_by_user: UserID | ||
purchased_at: datetime | ||
modified: datetime | ||
|
||
model_config = ConfigDict( | ||
json_schema_extra={ | ||
"examples": [ | ||
{ | ||
"licensed_item_purchase_id": "beb16d18-d57d-44aa-a638-9727fa4a72ef", | ||
"product_name": "osparc", | ||
"licensed_item_id": "303942ef-6d31-4ba8-afbe-dbb1fce2a953", | ||
"wallet_id": 1, | ||
"wallet_name": "My Wallet", | ||
"pricing_unit_cost_id": 1, | ||
"pricing_unit_cost": 10, | ||
"start_at": "2023-01-11 13:11:47.293595", | ||
"expire_at": "2023-01-11 13:11:47.293595", | ||
"num_of_seats": 1, | ||
"purchased_by_user": 1, | ||
"purchased_at": "2023-01-11 13:11:47.293595", | ||
"modified": "2023-01-11 13:11:47.293595", | ||
} | ||
] | ||
} | ||
) | ||
|
||
|
||
class LicensedItemsPurchasesPage(NamedTuple): | ||
items: list[LicensedItemPurchaseGet] | ||
total: PositiveInt |
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
35 changes: 35 additions & 0 deletions
35
packages/models-library/src/models_library/api_schemas_webserver/licensed_items_purchases.py
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,35 @@ | ||
from datetime import datetime | ||
from decimal import Decimal | ||
from typing import NamedTuple | ||
|
||
from models_library.licensed_items import LicensedItemID | ||
from models_library.products import ProductName | ||
from models_library.resource_tracker import PricingUnitCostId | ||
from models_library.resource_tracker_licensed_items_purchases import ( | ||
LicensedItemPurchaseID, | ||
) | ||
from models_library.users import UserID | ||
from models_library.wallets import WalletID | ||
from pydantic import PositiveInt | ||
|
||
from ._base import OutputSchema | ||
|
||
|
||
class LicensedItemPurchaseGet(OutputSchema): | ||
licensed_item_purchase_id: LicensedItemPurchaseID | ||
product_name: ProductName | ||
licensed_item_id: LicensedItemID | ||
wallet_id: WalletID | ||
pricing_unit_cost_id: PricingUnitCostId | ||
pricing_unit_cost: Decimal | ||
start_at: datetime | ||
expire_at: datetime | ||
num_of_seats: int | ||
purchased_by_user: UserID | ||
purchased_at: datetime | ||
modified_at: datetime | ||
|
||
|
||
class LicensedItemPurchaseGetPage(NamedTuple): | ||
items: list[LicensedItemPurchaseGet] | ||
total: PositiveInt |
3 changes: 2 additions & 1 deletion
3
packages/models-library/src/models_library/api_schemas_webserver/socketio.py
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
Oops, something went wrong.