Skip to content

Commit d889cfe

Browse files
committed
drops unused entrypoint
1 parent 5029084 commit d889cfe

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':
@@ -8362,6 +8326,33 @@ components:
83628326
required:
83638327
- priceDollars
83648328
title: CreateWalletPayment
8329+
CreditPriceGet:
8330+
properties:
8331+
productName:
8332+
type: string
8333+
title: Productname
8334+
usdPerCredit:
8335+
anyOf:
8336+
- type: number
8337+
minimum: 0.0
8338+
- type: 'null'
8339+
title: Usdpercredit
8340+
description: Price of a credit in USD. If None, then this product's price
8341+
is UNDEFINED
8342+
minPaymentAmountUsd:
8343+
anyOf:
8344+
- type: integer
8345+
minimum: 0
8346+
- type: 'null'
8347+
title: Minpaymentamountusd
8348+
description: Minimum amount (included) in USD that can be paid for this
8349+
productCan be None if this product's price is UNDEFINED
8350+
type: object
8351+
required:
8352+
- productName
8353+
- usdPerCredit
8354+
- minPaymentAmountUsd
8355+
title: CreditPriceGet
83658356
DatCoreFileLink:
83668357
properties:
83678358
store:
@@ -8566,6 +8557,19 @@ components:
85668557
title: Error
85678558
type: object
85688559
title: Envelope[ComputationGet]
8560+
Envelope_CreditPriceGet_:
8561+
properties:
8562+
data:
8563+
anyOf:
8564+
- $ref: '#/components/schemas/CreditPriceGet'
8565+
- type: 'null'
8566+
error:
8567+
anyOf:
8568+
- {}
8569+
- type: 'null'
8570+
title: Error
8571+
type: object
8572+
title: Envelope[CreditPriceGet]
85698573
Envelope_FileMetaDataGet_:
85708574
properties:
85718575
data:
@@ -8644,19 +8648,6 @@ components:
86448648
title: Error
86458649
type: object
86468650
title: Envelope[FolderGet]
8647-
Envelope_GetCreditPrice_:
8648-
properties:
8649-
data:
8650-
anyOf:
8651-
- $ref: '#/components/schemas/GetCreditPrice'
8652-
- type: 'null'
8653-
error:
8654-
anyOf:
8655-
- {}
8656-
- type: 'null'
8657-
title: Error
8658-
type: object
8659-
title: Envelope[GetCreditPrice]
86608651
Envelope_GetProjectInactivityResponse_:
86618652
properties:
86628653
data:
@@ -10465,73 +10456,6 @@ components:
1046510456
required:
1046610457
- name
1046710458
title: FolderReplaceBodyParams
10468-
GenerateInvitation:
10469-
properties:
10470-
guest:
10471-
type: string
10472-
format: email
10473-
title: Guest
10474-
trialAccountDays:
10475-
anyOf:
10476-
- type: integer
10477-
exclusiveMinimum: true
10478-
minimum: 0
10479-
- type: 'null'
10480-
title: Trialaccountdays
10481-
extraCreditsInUsd:
10482-
anyOf:
10483-
- type: integer
10484-
exclusiveMaximum: true
10485-
minimum: 0
10486-
maximum: 500
10487-
- type: 'null'
10488-
title: Extracreditsinusd
10489-
type: object
10490-
required:
10491-
- guest
10492-
title: GenerateInvitation
10493-
GetCreditPrice:
10494-
properties:
10495-
productName:
10496-
type: string
10497-
title: Productname
10498-
usdPerCredit:
10499-
anyOf:
10500-
- type: number
10501-
minimum: 0.0
10502-
- type: 'null'
10503-
title: Usdpercredit
10504-
description: Price of a credit in USD. If None, then this product's price
10505-
is UNDEFINED
10506-
minPaymentAmountUsd:
10507-
anyOf:
10508-
- type: integer
10509-
minimum: 0
10510-
- type: 'null'
10511-
title: Minpaymentamountusd
10512-
description: Minimum amount (included) in USD that can be paid for this
10513-
productCan be None if this product's price is UNDEFINED
10514-
type: object
10515-
required:
10516-
- productName
10517-
- usdPerCredit
10518-
- minPaymentAmountUsd
10519-
title: GetCreditPrice
10520-
GetProductTemplate:
10521-
properties:
10522-
id:
10523-
type: string
10524-
maxLength: 100
10525-
minLength: 1
10526-
title: Id
10527-
content:
10528-
type: string
10529-
title: Content
10530-
type: object
10531-
required:
10532-
- id
10533-
- content
10534-
title: GetProductTemplate
1053510459
GetProjectInactivityResponse:
1053610460
properties:
1053710461
is_inactive:
@@ -10874,6 +10798,31 @@ components:
1087410798
required:
1087510799
- invitation
1087610800
title: InvitationCheck
10801+
InvitationGenerate:
10802+
properties:
10803+
guest:
10804+
type: string
10805+
format: email
10806+
title: Guest
10807+
trialAccountDays:
10808+
anyOf:
10809+
- type: integer
10810+
exclusiveMinimum: true
10811+
minimum: 0
10812+
- type: 'null'
10813+
title: Trialaccountdays
10814+
extraCreditsInUsd:
10815+
anyOf:
10816+
- type: integer
10817+
exclusiveMaximum: true
10818+
minimum: 0
10819+
maximum: 500
10820+
- type: 'null'
10821+
title: Extracreditsinusd
10822+
type: object
10823+
required:
10824+
- guest
10825+
title: InvitationGenerate
1087710826
InvitationGenerated:
1087810827
properties:
1087910828
productName:
@@ -12893,7 +12842,7 @@ components:
1289312842
title: Creditsperusd
1289412843
templates:
1289512844
items:
12896-
$ref: '#/components/schemas/GetProductTemplate'
12845+
$ref: '#/components/schemas/ProductTemplateGet'
1289712846
type: array
1289812847
title: Templates
1289912848
description: List of templates available to this product for communications
@@ -12907,6 +12856,21 @@ components:
1290712856
- isPaymentEnabled
1290812857
- creditsPerUsd
1290912858
title: ProductGet
12859+
ProductTemplateGet:
12860+
properties:
12861+
id:
12862+
type: string
12863+
maxLength: 100
12864+
minLength: 1
12865+
title: Id
12866+
content:
12867+
type: string
12868+
title: Content
12869+
type: object
12870+
required:
12871+
- id
12872+
- content
12873+
title: ProductTemplateGet
1291012874
ProductUIGet:
1291112875
properties:
1291212876
productName:
@@ -15132,15 +15096,6 @@ components:
1513215096
- default
1513315097
- specificInfo
1513415098
title: UpdatePricingUnitBodyParams
15135-
UpdateProductTemplate:
15136-
properties:
15137-
content:
15138-
type: string
15139-
title: Content
15140-
type: object
15141-
required:
15142-
- content
15143-
title: UpdateProductTemplate
1514415099
UploadedPart:
1514515100
properties:
1514615101
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)