forked from aws-samples/lambda-hexagonal-architecture-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_model.py
More file actions
50 lines (32 loc) · 1.46 KB
/
Copy pathapi_model.py
File metadata and controls
50 lines (32 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field
class GetProductResponse(BaseModel):
id: str = Field(..., title="Id")
name: str = Field(..., title="Name")
description: Optional[str] = Field(title="Description")
createDate: str = Field(..., title="CreateDate")
lastUpdateDate: str = Field(..., title="LastUpdateDate")
class CreateProductRequest(BaseModel):
name: str = Field(..., title="Name")
description: Optional[str] = Field(title="Description")
class CreateProductResponse(BaseModel):
id: str = Field(..., title="Id")
class UpdateProductRequest(BaseModel):
name: Optional[str] = Field(title="Name")
description: Optional[str] = Field(title="Description")
class UpdateProductResponse(BaseModel):
id: str = Field(..., title="Id")
class DeleteProductResponse(BaseModel):
id: str = Field(..., title="Id")
class Product(BaseModel):
id: str = Field(..., title="Id")
name: str = Field(..., title="Name")
description: Optional[str] = Field(title="Description")
createDate: str = Field(..., title="CreateDate")
lastUpdateDate: str = Field(..., title="LastUpdateDate")
class ListProductsResponse(BaseModel):
nextToken: Optional[Dict[str, Any]] = Field(title="LastEvaluatedKey token")
products: List[Product] = Field(..., title="Products")
class AddProductVersionRequest(BaseModel):
name: Optional[str] = Field(title="Name")
version: str = Field(..., title="Version")