forked from aws-powertools/powertools-lambda-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapigwv2.py
71 lines (55 loc) · 1.85 KB
/
apigwv2.py
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from datetime import datetime
from typing import Any, Dict, List, Optional, Type, Union
from pydantic import BaseModel, Field
from pydantic.networks import IPvAnyNetwork
from aws_lambda_powertools.utilities.parser.types import Literal
class RequestContextV2AuthorizerIamCognito(BaseModel):
amr: List[str]
identityId: str
identityPoolId: str
class RequestContextV2AuthorizerIam(BaseModel):
accessKey: Optional[str]
accountId: Optional[str]
callerId: Optional[str]
principalOrgId: Optional[str]
userArn: Optional[str]
userId: Optional[str]
cognitoIdentity: Optional[RequestContextV2AuthorizerIamCognito]
class RequestContextV2AuthorizerJwt(BaseModel):
claims: Dict[str, Any]
scopes: List[str]
class RequestContextV2Authorizer(BaseModel):
jwt: Optional[RequestContextV2AuthorizerJwt]
iam: Optional[RequestContextV2AuthorizerIam]
lambda_value: Optional[Dict[str, Any]] = Field(None, alias="lambda")
class RequestContextV2Http(BaseModel):
method: Literal["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]
path: str
protocol: str
sourceIp: IPvAnyNetwork
userAgent: str
class RequestContextV2(BaseModel):
accountId: str
apiId: str
authorizer: Optional[RequestContextV2Authorizer]
domainName: str
domainPrefix: str
requestId: str
routeKey: str
stage: str
time: str
timeEpoch: datetime
http: RequestContextV2Http
class APIGatewayProxyEventV2Model(BaseModel):
version: str
routeKey: str
rawPath: str
rawQueryString: str
cookies: Optional[List[str]]
headers: Dict[str, str]
queryStringParameters: Optional[Dict[str, str]]
pathParameters: Optional[Dict[str, str]]
stageVariables: Optional[Dict[str, str]]
requestContext: RequestContextV2
body: Optional[Union[str, Type[BaseModel]]]
isBase64Encoded: bool