File tree Expand file tree Collapse file tree 6 files changed +70
-23
lines changed
aws_lambda_powertools/utilities/typing Expand file tree Collapse file tree 6 files changed +70
-23
lines changed Original file line number Diff line number Diff line change 66> This is copied from: https://gist.github.com/alexcasalboni/a545b68ee164b165a74a20a5fee9d133
77"""
88
9- from .lambda_client_context import LambdaClientContext
10- from .lambda_client_context_mobile_client import LambdaClientContextMobileClient
11- from .lambda_cognito_identity import LambdaCognitoIdentity
9+ from .event import LambdaEvent
1210from .lambda_context import LambdaContext
13- from .lambda_dict import LambdaDict
1411
1512__all__ = [
16- "LambdaDict" ,
17- "LambdaClientContext" ,
18- "LambdaClientContextMobileClient" ,
19- "LambdaCognitoIdentity" ,
13+ "LambdaEvent" ,
2014 "LambdaContext" ,
2115]
Original file line number Diff line number Diff line change 22
33from typing import Any , Dict
44
5- LambdaDict = Dict [str , Any ]
5+ LambdaEvent = Dict [str , Any ]
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
2- from aws_lambda_powertools .utilities .typing import LambdaClientContextMobileClient , LambdaDict
2+ from aws_lambda_powertools .utilities .typing import LambdaEvent
3+ from aws_lambda_powertools .utilities .typing .lambda_client_context_mobile_client import LambdaClientContextMobileClient
34
45
56class LambdaClientContext (object ):
6- client : LambdaClientContextMobileClient
7- custom : LambdaDict
8- env : LambdaDict
7+ _client : LambdaClientContextMobileClient
8+ _custom : LambdaEvent
9+ _env : LambdaEvent
10+
11+ @property
12+ def client (self ) -> LambdaClientContextMobileClient :
13+ """Client context that's provided to Lambda by the client application."""
14+ return self ._client
15+
16+ @property
17+ def custom (self ) -> LambdaEvent :
18+ """A dict of custom values set by the mobile client application."""
19+ return self ._custom
20+
21+ @property
22+ def env (self ) -> LambdaEvent :
23+ """A dict of environment information provided by the AWS SDK."""
24+ return self ._env
Original file line number Diff line number Diff line change 22
33
44class LambdaClientContextMobileClient (object ):
5- installation_id : str
6- app_title : str
7- app_version_name : str
8- app_version_code : str
9- app_package_name : str
5+ """Mobile Client context that's provided to Lambda by the client application."""
6+
7+ _installation_id : str
8+ _app_title : str
9+ _app_version_name : str
10+ _app_version_code : str
11+ _app_package_name : str
12+
13+ @property
14+ def installation_id (self ) -> str :
15+ return self ._installation_id
16+
17+ @property
18+ def app_title (self ) -> str :
19+ return self ._app_title
20+
21+ @property
22+ def app_version_name (self ) -> str :
23+ return self ._app_version_name
24+
25+ @property
26+ def app_version_code (self ) -> str :
27+ return self ._app_version_code
28+
29+ @property
30+ def app_package_name (self ) -> str :
31+ return self ._app_package_name
Original file line number Diff line number Diff line change 22
33
44class LambdaCognitoIdentity (object ):
5- cognito_identity_id : str
6- cognito_identity_pool_id : str
5+ """
6+ Information about the Amazon Cognito identity that authorized the request.
7+ """
8+
9+ _cognito_identity_id : str
10+ _cognito_identity_pool_id : str
11+
12+ @property
13+ def cognito_identity_id (self ) -> str :
14+ """The authenticated Amazon Cognito identity."""
15+ return self ._cognito_identity_id
16+
17+ @property
18+ def cognito_identity_pool_id (self ) -> str :
19+ """The Amazon Cognito identity pool that authorized the invocation."""
20+ return self ._cognito_identity_pool_id
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
2- from aws_lambda_powertools .utilities .typing import LambdaClientContext , LambdaCognitoIdentity
2+ from aws_lambda_powertools .utilities .typing .lambda_client_context import LambdaClientContext
3+ from aws_lambda_powertools .utilities .typing .lambda_cognito_identity import LambdaCognitoIdentity
34
45
56class LambdaContext (object ):
@@ -9,9 +10,9 @@ class LambdaContext(object):
910 -------
1011 **A Lambda function using LambdaContext**
1112
12- >>> from aws_lambda_powertools.utilities.typing import LambdaDict , LambdaContext
13+ >>> from aws_lambda_powertools.utilities.typing import LambdaEvent , LambdaContext
1314 >>>
14- >>> def handler(event: LambdaDict , context: LambdaContext) -> LambdaDict :
15+ >>> def handler(event: LambdaEvent , context: LambdaContext) -> LambdaEvent :
1516 >>> # Insert business logic
1617 >>> return event
1718
You can’t perform that action at this time.
0 commit comments