From 26f9c57c2c3582712079f97a1fecdf41094312f4 Mon Sep 17 00:00:00 2001 From: matusdrobuliak66 Date: Wed, 11 Dec 2024 06:46:57 +0100 Subject: [PATCH] open api specs --- .../api/v0/openapi.yaml | 60 +++++++++++++++++++ .../licenses/_licensed_items_api.py | 4 +- 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml index 62e9ebe076e..fe6f65828b9 100644 --- a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml +++ b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml @@ -3031,6 +3031,18 @@ paths: schema: $ref: '#/components/schemas/EnvelopedError' description: Forbidden + '402': + content: + application/json: + schema: + $ref: '#/components/schemas/EnvelopedError' + description: Payment Required + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/EnvelopedError' + description: Bad Request /v0/catalog/licensed-items/{licensed_item_id}: get: tags: @@ -3065,6 +3077,18 @@ paths: schema: $ref: '#/components/schemas/EnvelopedError' description: Forbidden + '402': + content: + application/json: + schema: + $ref: '#/components/schemas/EnvelopedError' + description: Payment Required + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/EnvelopedError' + description: Bad Request /v0/catalog/licensed-items/{licensed_item_id}:purchase: post: tags: @@ -3101,6 +3125,18 @@ paths: schema: $ref: '#/components/schemas/EnvelopedError' description: Forbidden + '402': + content: + application/json: + schema: + $ref: '#/components/schemas/EnvelopedError' + description: Payment Required + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/EnvelopedError' + description: Bad Request /v0/wallets/{wallet_id}/licensed-items-purchases: get: tags: @@ -3159,6 +3195,18 @@ paths: schema: $ref: '#/components/schemas/EnvelopedError' description: Forbidden + '402': + content: + application/json: + schema: + $ref: '#/components/schemas/EnvelopedError' + description: Payment Required + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/EnvelopedError' + description: Bad Request /v0/licensed-items-purchases/{licensed_item_purchase_id}: get: tags: @@ -3192,6 +3240,18 @@ paths: schema: $ref: '#/components/schemas/EnvelopedError' description: Forbidden + '402': + content: + application/json: + schema: + $ref: '#/components/schemas/EnvelopedError' + description: Payment Required + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/EnvelopedError' + description: Bad Request /v0/projects/{project_uuid}/checkpoint/{ref_id}/iterations: get: tags: diff --git a/services/web/server/src/simcore_service_webserver/licenses/_licensed_items_api.py b/services/web/server/src/simcore_service_webserver/licenses/_licensed_items_api.py index 1e196de47d8..6feacf24b1d 100644 --- a/services/web/server/src/simcore_service_webserver/licenses/_licensed_items_api.py +++ b/services/web/server/src/simcore_service_webserver/licenses/_licensed_items_api.py @@ -25,7 +25,7 @@ from ..users.api import get_user from ..wallets.api import get_wallet_with_available_credits_by_user_and_wallet from ..wallets.errors import WalletNotEnoughCreditsError -from . import _licensed_items_api, _licensed_items_db +from . import _licensed_items_db from ._models import LicensedItemsBodyParams from .errors import LicensedItemPricingPlanMatchError @@ -92,7 +92,7 @@ async def purchase_licensed_item( app, user_id=user_id, wallet_id=body_params.wallet_id, product_name=product_name ) - licensed_item = await _licensed_items_api.get_licensed_item( + licensed_item = await get_licensed_item( app, licensed_item_id=licensed_item_id, product_name=product_name )