Skip to content

Commit a173d26

Browse files
committed
drops unused entrypoint
1 parent 3b2d9fb commit a173d26

File tree

7 files changed

+86
-216
lines changed

7 files changed

+86
-216
lines changed

api/specs/web-server/_products.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,17 @@
77

88
from typing import Annotated
99

10-
from fastapi import APIRouter, Depends, status
10+
from fastapi import APIRouter, Depends
1111
from models_library.api_schemas_webserver.product import (
1212
CreditPriceGet,
1313
InvitationGenerate,
1414
InvitationGenerated,
1515
ProductGet,
16-
ProductTemplateReplace,
1716
ProductUIGet,
1817
)
1918
from models_library.generics import Envelope
2019
from simcore_service_webserver._meta import API_VTAG
21-
from simcore_service_webserver.products._rest_schemas import (
22-
ProductsRequestParams,
23-
ProductTemplateParams,
24-
)
20+
from simcore_service_webserver.products._rest_schemas import ProductsRequestParams
2521

2622
router = APIRouter(
2723
prefix=f"/{API_VTAG}",
@@ -59,19 +55,6 @@ async def get_current_product_ui():
5955
...
6056

6157

62-
@router.put(
63-
"/products/{product_name}/templates/{template_id}",
64-
status_code=status.HTTP_204_NO_CONTENT,
65-
tags=[
66-
"po",
67-
],
68-
)
69-
async def replace_product_template(
70-
_params: Annotated[ProductTemplateParams, Depends()], _body: ProductTemplateReplace
71-
):
72-
...
73-
74-
7558
@router.post(
7659
"/invitation:generate",
7760
response_model=Envelope[InvitationGenerated],

packages/models-library/src/models_library/api_schemas_webserver/product.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ class ProductTemplateGet(OutputSchema):
7070
content: str
7171

7272

73-
class ProductTemplateReplace(InputSchema):
74-
content: str
75-
76-
7773
class ProductGet(OutputSchema):
7874
name: ProductName
7975
display_name: str

services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml

Lines changed: 83 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ paths:
11071107
content:
11081108
application/json:
11091109
schema:
1110-
$ref: '#/components/schemas/Envelope_GetCreditPrice_'
1110+
$ref: '#/components/schemas/Envelope_CreditPriceGet_'
11111111
/v0/products/{product_name}:
11121112
get:
11131113
tags:
@@ -1149,42 +1149,6 @@ paths:
11491149
application/json:
11501150
schema:
11511151
$ref: '#/components/schemas/Envelope_ProductUIGet_'
1152-
/v0/products/{product_name}/templates/{template_id}:
1153-
put:
1154-
tags:
1155-
- products
1156-
- po
1157-
summary: Update Product Template
1158-
operationId: replace_product_template
1159-
parameters:
1160-
- name: product_name
1161-
in: path
1162-
required: true
1163-
schema:
1164-
anyOf:
1165-
- type: string
1166-
minLength: 1
1167-
maxLength: 100
1168-
- const: current
1169-
type: string
1170-
title: Product Name
1171-
- name: template_id
1172-
in: path
1173-
required: true
1174-
schema:
1175-
type: string
1176-
minLength: 1
1177-
maxLength: 100
1178-
title: Template Id
1179-
requestBody:
1180-
required: true
1181-
content:
1182-
application/json:
1183-
schema:
1184-
$ref: '#/components/schemas/UpdateProductTemplate'
1185-
responses:
1186-
'204':
1187-
description: Successful Response
11881152
/v0/invitation:generate:
11891153
post:
11901154
tags:
@@ -1196,7 +1160,7 @@ paths:
11961160
content:
11971161
application/json:
11981162
schema:
1199-
$ref: '#/components/schemas/GenerateInvitation'
1163+
$ref: '#/components/schemas/InvitationGenerate'
12001164
required: true
12011165
responses:
12021166
'200':
@@ -8451,6 +8415,33 @@ components:
84518415
required:
84528416
- items
84538417
title: CursorPage[FileMetaDataGet]
8418+
CreditPriceGet:
8419+
properties:
8420+
productName:
8421+
type: string
8422+
title: Productname
8423+
usdPerCredit:
8424+
anyOf:
8425+
- type: number
8426+
minimum: 0.0
8427+
- type: 'null'
8428+
title: Usdpercredit
8429+
description: Price of a credit in USD. If None, then this product's price
8430+
is UNDEFINED
8431+
minPaymentAmountUsd:
8432+
anyOf:
8433+
- type: integer
8434+
minimum: 0
8435+
- type: 'null'
8436+
title: Minpaymentamountusd
8437+
description: Minimum amount (included) in USD that can be paid for this
8438+
productCan be None if this product's price is UNDEFINED
8439+
type: object
8440+
required:
8441+
- productName
8442+
- usdPerCredit
8443+
- minPaymentAmountUsd
8444+
title: CreditPriceGet
84548445
DatCoreFileLink:
84558446
properties:
84568447
store:
@@ -8655,6 +8646,19 @@ components:
86558646
title: Error
86568647
type: object
86578648
title: Envelope[ComputationGet]
8649+
Envelope_CreditPriceGet_:
8650+
properties:
8651+
data:
8652+
anyOf:
8653+
- $ref: '#/components/schemas/CreditPriceGet'
8654+
- type: 'null'
8655+
error:
8656+
anyOf:
8657+
- {}
8658+
- type: 'null'
8659+
title: Error
8660+
type: object
8661+
title: Envelope[CreditPriceGet]
86588662
Envelope_FileMetaDataGet_:
86598663
properties:
86608664
data:
@@ -8733,19 +8737,6 @@ components:
87338737
title: Error
87348738
type: object
87358739
title: Envelope[FolderGet]
8736-
Envelope_GetCreditPrice_:
8737-
properties:
8738-
data:
8739-
anyOf:
8740-
- $ref: '#/components/schemas/GetCreditPrice'
8741-
- type: 'null'
8742-
error:
8743-
anyOf:
8744-
- {}
8745-
- type: 'null'
8746-
title: Error
8747-
type: object
8748-
title: Envelope[GetCreditPrice]
87498740
Envelope_GetProjectInactivityResponse_:
87508741
properties:
87518742
data:
@@ -10554,73 +10545,6 @@ components:
1055410545
required:
1055510546
- name
1055610547
title: FolderReplaceBodyParams
10557-
GenerateInvitation:
10558-
properties:
10559-
guest:
10560-
type: string
10561-
format: email
10562-
title: Guest
10563-
trialAccountDays:
10564-
anyOf:
10565-
- type: integer
10566-
exclusiveMinimum: true
10567-
minimum: 0
10568-
- type: 'null'
10569-
title: Trialaccountdays
10570-
extraCreditsInUsd:
10571-
anyOf:
10572-
- type: integer
10573-
exclusiveMaximum: true
10574-
minimum: 0
10575-
maximum: 500
10576-
- type: 'null'
10577-
title: Extracreditsinusd
10578-
type: object
10579-
required:
10580-
- guest
10581-
title: GenerateInvitation
10582-
GetCreditPrice:
10583-
properties:
10584-
productName:
10585-
type: string
10586-
title: Productname
10587-
usdPerCredit:
10588-
anyOf:
10589-
- type: number
10590-
minimum: 0.0
10591-
- type: 'null'
10592-
title: Usdpercredit
10593-
description: Price of a credit in USD. If None, then this product's price
10594-
is UNDEFINED
10595-
minPaymentAmountUsd:
10596-
anyOf:
10597-
- type: integer
10598-
minimum: 0
10599-
- type: 'null'
10600-
title: Minpaymentamountusd
10601-
description: Minimum amount (included) in USD that can be paid for this
10602-
productCan be None if this product's price is UNDEFINED
10603-
type: object
10604-
required:
10605-
- productName
10606-
- usdPerCredit
10607-
- minPaymentAmountUsd
10608-
title: GetCreditPrice
10609-
GetProductTemplate:
10610-
properties:
10611-
id:
10612-
type: string
10613-
maxLength: 100
10614-
minLength: 1
10615-
title: Id
10616-
content:
10617-
type: string
10618-
title: Content
10619-
type: object
10620-
required:
10621-
- id
10622-
- content
10623-
title: GetProductTemplate
1062410548
GetProjectInactivityResponse:
1062510549
properties:
1062610550
is_inactive:
@@ -10963,6 +10887,31 @@ components:
1096310887
required:
1096410888
- invitation
1096510889
title: InvitationCheck
10890+
InvitationGenerate:
10891+
properties:
10892+
guest:
10893+
type: string
10894+
format: email
10895+
title: Guest
10896+
trialAccountDays:
10897+
anyOf:
10898+
- type: integer
10899+
exclusiveMinimum: true
10900+
minimum: 0
10901+
- type: 'null'
10902+
title: Trialaccountdays
10903+
extraCreditsInUsd:
10904+
anyOf:
10905+
- type: integer
10906+
exclusiveMaximum: true
10907+
minimum: 0
10908+
maximum: 500
10909+
- type: 'null'
10910+
title: Extracreditsinusd
10911+
type: object
10912+
required:
10913+
- guest
10914+
title: InvitationGenerate
1096610915
InvitationGenerated:
1096710916
properties:
1096810917
productName:
@@ -12982,7 +12931,7 @@ components:
1298212931
title: Creditsperusd
1298312932
templates:
1298412933
items:
12985-
$ref: '#/components/schemas/GetProductTemplate'
12934+
$ref: '#/components/schemas/ProductTemplateGet'
1298612935
type: array
1298712936
title: Templates
1298812937
description: List of templates available to this product for communications
@@ -12996,6 +12945,21 @@ components:
1299612945
- isPaymentEnabled
1299712946
- creditsPerUsd
1299812947
title: ProductGet
12948+
ProductTemplateGet:
12949+
properties:
12950+
id:
12951+
type: string
12952+
maxLength: 100
12953+
minLength: 1
12954+
title: Id
12955+
content:
12956+
type: string
12957+
title: Content
12958+
type: object
12959+
required:
12960+
- id
12961+
- content
12962+
title: ProductTemplateGet
1299912963
ProductUIGet:
1300012964
properties:
1300112965
productName:
@@ -15221,15 +15185,6 @@ components:
1522115185
- default
1522215186
- specificInfo
1522315187
title: UpdatePricingUnitBodyParams
15224-
UpdateProductTemplate:
15225-
properties:
15226-
content:
15227-
type: string
15228-
title: Content
15229-
type: object
15230-
required:
15231-
- content
15232-
title: UpdateProductTemplate
1523315188
UploadedPart:
1523415189
properties:
1523515190
number:

services/web/server/src/simcore_service_webserver/products/_rest.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414
from ..security.decorators import permission_required
1515
from ..utils_aiohttp import envelope_json_response
1616
from . import _service, products_web
17-
from ._rest_schemas import (
18-
ProductsRequestContext,
19-
ProductsRequestParams,
20-
ProductTemplateParams,
21-
)
17+
from ._rest_schemas import ProductsRequestContext, ProductsRequestParams
2218
from .models import Product
2319

2420
routes = web.RouteTableDef()
@@ -82,21 +78,3 @@ async def _get_current_product_ui(request: web.Request):
8278

8379
data = ProductUIGet(product_name=product_name, ui=ui)
8480
return envelope_json_response(data)
85-
86-
87-
@routes.put(
88-
f"/{VTAG}/products/{{product_name}}/templates/{{template_id}}",
89-
name="replace_product_template",
90-
)
91-
@login_required
92-
@permission_required("product.details.*")
93-
async def replace_product_template(request: web.Request):
94-
req_ctx = ProductsRequestContext.model_validate(request)
95-
path_params = parse_request_path_parameters_as(ProductTemplateParams, request)
96-
97-
assert req_ctx # nosec
98-
assert path_params # nosec
99-
100-
# FIXME: implement this
101-
102-
raise NotImplementedError

services/web/server/src/simcore_service_webserver/products/_rest_schemas.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,3 @@ class ProductsRequestContext(RequestParameters):
2424

2525
class ProductsRequestParams(StrictRequestParameters):
2626
product_name: IDStr | Literal["current"]
27-
28-
29-
class ProductTemplateParams(ProductsRequestParams):
30-
template_id: IDStr

0 commit comments

Comments
 (0)