aws-lambda-powertools 3.8.1a6__py3-none-any.whl → 3.8.1a7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aws_lambda_powertools/metrics/provider/datadog/datadog.py +4 -1
- aws_lambda_powertools/shared/version.py +1 -1
- aws_lambda_powertools/utilities/data_classes/__init__.py +2 -0
- aws_lambda_powertools/utilities/data_classes/alb_event.py +2 -6
- aws_lambda_powertools/utilities/data_classes/api_gateway_authorizer_event.py +2 -2
- aws_lambda_powertools/utilities/data_classes/api_gateway_proxy_event.py +12 -21
- aws_lambda_powertools/utilities/data_classes/api_gateway_websocket_event.py +128 -0
- aws_lambda_powertools/utilities/data_classes/appsync_authorizer_event.py +7 -7
- aws_lambda_powertools/utilities/data_classes/bedrock_agent_event.py +2 -4
- aws_lambda_powertools/utilities/data_classes/cognito_user_pool_event.py +109 -115
- aws_lambda_powertools/utilities/data_classes/common.py +46 -47
- aws_lambda_powertools/utilities/data_classes/kinesis_firehose_event.py +7 -11
- aws_lambda_powertools/utilities/data_classes/kinesis_stream_event.py +6 -6
- aws_lambda_powertools/utilities/data_classes/s3_event.py +20 -20
- aws_lambda_powertools/utilities/data_classes/ses_event.py +3 -3
- aws_lambda_powertools/utilities/data_classes/vpc_lattice.py +2 -10
- {aws_lambda_powertools-3.8.1a6.dist-info → aws_lambda_powertools-3.8.1a7.dist-info}/METADATA +2 -2
- {aws_lambda_powertools-3.8.1a6.dist-info → aws_lambda_powertools-3.8.1a7.dist-info}/RECORD +20 -19
- {aws_lambda_powertools-3.8.1a6.dist-info → aws_lambda_powertools-3.8.1a7.dist-info}/LICENSE +0 -0
- {aws_lambda_powertools-3.8.1a6.dist-info → aws_lambda_powertools-3.8.1a7.dist-info}/WHEEL +0 -0
@@ -9,12 +9,12 @@ class CallerContext(DictWrapper):
|
|
9
9
|
@property
|
10
10
|
def aws_sdk_version(self) -> str:
|
11
11
|
"""The AWS SDK version number."""
|
12
|
-
return self["
|
12
|
+
return self["awsSdkVersion"]
|
13
13
|
|
14
14
|
@property
|
15
15
|
def client_id(self) -> str:
|
16
16
|
"""The ID of the client associated with the user pool."""
|
17
|
-
return self["
|
17
|
+
return self["clientId"]
|
18
18
|
|
19
19
|
|
20
20
|
class BaseTriggerEvent(DictWrapper):
|
@@ -53,54 +53,54 @@ class BaseTriggerEvent(DictWrapper):
|
|
53
53
|
@property
|
54
54
|
def caller_context(self) -> CallerContext:
|
55
55
|
"""The caller context"""
|
56
|
-
return CallerContext(self
|
56
|
+
return CallerContext(self["callerContext"])
|
57
57
|
|
58
58
|
|
59
59
|
class PreSignUpTriggerEventRequest(DictWrapper):
|
60
60
|
@property
|
61
61
|
def user_attributes(self) -> dict[str, str]:
|
62
62
|
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
|
63
|
-
return self["
|
63
|
+
return self["userAttributes"]
|
64
64
|
|
65
65
|
@property
|
66
66
|
def validation_data(self) -> dict[str, str]:
|
67
67
|
"""One or more name-value pairs containing the validation data in the request to register a user."""
|
68
|
-
return self
|
68
|
+
return self.get("validationData") or {}
|
69
69
|
|
70
70
|
@property
|
71
71
|
def client_metadata(self) -> dict[str, str]:
|
72
72
|
"""One or more key-value pairs that you can provide as custom input to the Lambda function
|
73
73
|
that you specify for the pre sign-up trigger."""
|
74
|
-
return self
|
74
|
+
return self.get("clientMetadata") or {}
|
75
75
|
|
76
76
|
|
77
77
|
class PreSignUpTriggerEventResponse(DictWrapper):
|
78
78
|
@property
|
79
79
|
def auto_confirm_user(self) -> bool:
|
80
|
-
return bool(self["
|
80
|
+
return bool(self["autoConfirmUser"])
|
81
81
|
|
82
82
|
@auto_confirm_user.setter
|
83
83
|
def auto_confirm_user(self, value: bool):
|
84
84
|
"""Set to true to auto-confirm the user, or false otherwise."""
|
85
|
-
self["
|
85
|
+
self._data["autoConfirmUser"] = value
|
86
86
|
|
87
87
|
@property
|
88
88
|
def auto_verify_email(self) -> bool:
|
89
|
-
return bool(self["
|
89
|
+
return bool(self["autoVerifyEmail"])
|
90
90
|
|
91
91
|
@auto_verify_email.setter
|
92
92
|
def auto_verify_email(self, value: bool):
|
93
93
|
"""Set to true to set as verified the email of a user who is signing up, or false otherwise."""
|
94
|
-
self["
|
94
|
+
self._data["autoVerifyEmail"] = value
|
95
95
|
|
96
96
|
@property
|
97
97
|
def auto_verify_phone(self) -> bool:
|
98
|
-
return bool(self["
|
98
|
+
return bool(self["autoVerifyPhone"])
|
99
99
|
|
100
100
|
@auto_verify_phone.setter
|
101
101
|
def auto_verify_phone(self, value: bool):
|
102
102
|
"""Set to true to set as verified the phone number of a user who is signing up, or false otherwise."""
|
103
|
-
self["
|
103
|
+
self._data["autoVerifyPhone"] = value
|
104
104
|
|
105
105
|
|
106
106
|
class PreSignUpTriggerEvent(BaseTriggerEvent):
|
@@ -121,24 +121,24 @@ class PreSignUpTriggerEvent(BaseTriggerEvent):
|
|
121
121
|
|
122
122
|
@property
|
123
123
|
def request(self) -> PreSignUpTriggerEventRequest:
|
124
|
-
return PreSignUpTriggerEventRequest(self
|
124
|
+
return PreSignUpTriggerEventRequest(self["request"])
|
125
125
|
|
126
126
|
@property
|
127
127
|
def response(self) -> PreSignUpTriggerEventResponse:
|
128
|
-
return PreSignUpTriggerEventResponse(self
|
128
|
+
return PreSignUpTriggerEventResponse(self["response"])
|
129
129
|
|
130
130
|
|
131
131
|
class PostConfirmationTriggerEventRequest(DictWrapper):
|
132
132
|
@property
|
133
133
|
def user_attributes(self) -> dict[str, str]:
|
134
134
|
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
|
135
|
-
return self["
|
135
|
+
return self["userAttributes"]
|
136
136
|
|
137
137
|
@property
|
138
138
|
def client_metadata(self) -> dict[str, str]:
|
139
139
|
"""One or more key-value pairs that you can provide as custom input to the Lambda function
|
140
140
|
that you specify for the post confirmation trigger."""
|
141
|
-
return self
|
141
|
+
return self.get("clientMetadata") or {}
|
142
142
|
|
143
143
|
|
144
144
|
class PostConfirmationTriggerEvent(BaseTriggerEvent):
|
@@ -158,41 +158,41 @@ class PostConfirmationTriggerEvent(BaseTriggerEvent):
|
|
158
158
|
|
159
159
|
@property
|
160
160
|
def request(self) -> PostConfirmationTriggerEventRequest:
|
161
|
-
return PostConfirmationTriggerEventRequest(self
|
161
|
+
return PostConfirmationTriggerEventRequest(self["request"])
|
162
162
|
|
163
163
|
|
164
164
|
class UserMigrationTriggerEventRequest(DictWrapper):
|
165
165
|
@property
|
166
166
|
def password(self) -> str:
|
167
|
-
return self["
|
167
|
+
return self["password"]
|
168
168
|
|
169
169
|
@property
|
170
170
|
def validation_data(self) -> dict[str, str]:
|
171
171
|
"""One or more name-value pairs containing the validation data in the request to register a user."""
|
172
|
-
return self
|
172
|
+
return self.get("validationData") or {}
|
173
173
|
|
174
174
|
@property
|
175
175
|
def client_metadata(self) -> dict[str, str]:
|
176
176
|
"""One or more key-value pairs that you can provide as custom input to the Lambda function
|
177
177
|
that you specify for the pre sign-up trigger."""
|
178
|
-
return self
|
178
|
+
return self.get("clientMetadata") or {}
|
179
179
|
|
180
180
|
|
181
181
|
class UserMigrationTriggerEventResponse(DictWrapper):
|
182
182
|
@property
|
183
183
|
def user_attributes(self) -> dict[str, str]:
|
184
|
-
return self["
|
184
|
+
return self["userAttributes"]
|
185
185
|
|
186
186
|
@user_attributes.setter
|
187
187
|
def user_attributes(self, value: dict[str, str]):
|
188
188
|
"""It must contain one or more name-value pairs representing user attributes to be stored in the
|
189
189
|
user profile in your user pool. You can include both standard and custom user attributes.
|
190
190
|
Custom attributes require the custom: prefix to distinguish them from standard attributes."""
|
191
|
-
self["
|
191
|
+
self._data["userAttributes"] = value
|
192
192
|
|
193
193
|
@property
|
194
194
|
def final_user_status(self) -> str | None:
|
195
|
-
return self
|
195
|
+
return self.get("finalUserStatus")
|
196
196
|
|
197
197
|
@final_user_status.setter
|
198
198
|
def final_user_status(self, value: str):
|
@@ -202,31 +202,31 @@ class UserMigrationTriggerEventResponse(DictWrapper):
|
|
202
202
|
If this attribute is set to RESET_REQUIRED, the user is required to change his or her password immediately
|
203
203
|
after migration at the time of sign-in, and your client app needs to handle the PasswordResetRequiredException
|
204
204
|
during the authentication flow."""
|
205
|
-
self["
|
205
|
+
self._data["finalUserStatus"] = value
|
206
206
|
|
207
207
|
@property
|
208
208
|
def message_action(self) -> str | None:
|
209
|
-
return self
|
209
|
+
return self.get("messageAction")
|
210
210
|
|
211
211
|
@message_action.setter
|
212
212
|
def message_action(self, value: str):
|
213
213
|
"""This attribute can be set to "SUPPRESS" to suppress the welcome message usually sent by
|
214
214
|
Amazon Cognito to new users. If this attribute is not returned, the welcome message will be sent."""
|
215
|
-
self["
|
215
|
+
self._data["messageAction"] = value
|
216
216
|
|
217
217
|
@property
|
218
218
|
def desired_delivery_mediums(self) -> list[str]:
|
219
|
-
return self
|
219
|
+
return self.get("desiredDeliveryMediums") or []
|
220
220
|
|
221
221
|
@desired_delivery_mediums.setter
|
222
222
|
def desired_delivery_mediums(self, value: list[str]):
|
223
223
|
"""This attribute can be set to "EMAIL" to send the welcome message by email, or "SMS" to send the
|
224
224
|
welcome message by SMS. If this attribute is not returned, the welcome message will be sent by SMS."""
|
225
|
-
self["
|
225
|
+
self._data["desiredDeliveryMediums"] = value
|
226
226
|
|
227
227
|
@property
|
228
228
|
def force_alias_creation(self) -> bool | None:
|
229
|
-
return self
|
229
|
+
return self.get("forceAliasCreation")
|
230
230
|
|
231
231
|
@force_alias_creation.setter
|
232
232
|
def force_alias_creation(self, value: bool):
|
@@ -239,11 +239,11 @@ class UserMigrationTriggerEventResponse(DictWrapper):
|
|
239
239
|
|
240
240
|
If this attribute is not returned, it is assumed to be "false".
|
241
241
|
"""
|
242
|
-
self["
|
242
|
+
self._data["forceAliasCreation"] = value
|
243
243
|
|
244
244
|
@property
|
245
245
|
def enable_sms_mfa(self) -> bool | None:
|
246
|
-
return self
|
246
|
+
return self.get("enableSMSMFA")
|
247
247
|
|
248
248
|
@enable_sms_mfa.setter
|
249
249
|
def enable_sms_mfa(self, value: bool):
|
@@ -251,7 +251,7 @@ class UserMigrationTriggerEventResponse(DictWrapper):
|
|
251
251
|
authentication (MFA) to sign in. Your user pool must have MFA enabled. Your user's attributes
|
252
252
|
in the request parameters must include a phone number, or else the migration of that user will fail.
|
253
253
|
"""
|
254
|
-
self["
|
254
|
+
self._data["enableSMSMFA"] = value
|
255
255
|
|
256
256
|
|
257
257
|
class UserMigrationTriggerEvent(BaseTriggerEvent):
|
@@ -271,70 +271,70 @@ class UserMigrationTriggerEvent(BaseTriggerEvent):
|
|
271
271
|
|
272
272
|
@property
|
273
273
|
def request(self) -> UserMigrationTriggerEventRequest:
|
274
|
-
return UserMigrationTriggerEventRequest(self
|
274
|
+
return UserMigrationTriggerEventRequest(self["request"])
|
275
275
|
|
276
276
|
@property
|
277
277
|
def response(self) -> UserMigrationTriggerEventResponse:
|
278
|
-
return UserMigrationTriggerEventResponse(self
|
278
|
+
return UserMigrationTriggerEventResponse(self["response"])
|
279
279
|
|
280
280
|
|
281
281
|
class CustomMessageTriggerEventRequest(DictWrapper):
|
282
282
|
@property
|
283
283
|
def code_parameter(self) -> str:
|
284
284
|
"""A string for you to use as the placeholder for the verification code in the custom message."""
|
285
|
-
return self["
|
285
|
+
return self["codeParameter"]
|
286
286
|
|
287
287
|
@property
|
288
288
|
def link_parameter(self) -> str:
|
289
289
|
"""A string for you to use as a placeholder for the verification link in the custom message."""
|
290
|
-
return self["
|
290
|
+
return self["linkParameter"]
|
291
291
|
|
292
292
|
@property
|
293
293
|
def username_parameter(self) -> str:
|
294
294
|
"""The username parameter. It is a required request parameter for the admin create user flow."""
|
295
|
-
return self["
|
295
|
+
return self["usernameParameter"]
|
296
296
|
|
297
297
|
@property
|
298
298
|
def user_attributes(self) -> dict[str, str]:
|
299
299
|
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
|
300
|
-
return self["
|
300
|
+
return self["userAttributes"]
|
301
301
|
|
302
302
|
@property
|
303
303
|
def client_metadata(self) -> dict[str, str]:
|
304
304
|
"""One or more key-value pairs that you can provide as custom input to the Lambda function
|
305
305
|
that you specify for the pre sign-up trigger."""
|
306
|
-
return self
|
306
|
+
return self.get("clientMetadata") or {}
|
307
307
|
|
308
308
|
|
309
309
|
class CustomMessageTriggerEventResponse(DictWrapper):
|
310
310
|
@property
|
311
311
|
def sms_message(self) -> str:
|
312
|
-
return self["
|
312
|
+
return self["smsMessage"]
|
313
313
|
|
314
314
|
@sms_message.setter
|
315
315
|
def sms_message(self, value: str):
|
316
316
|
"""The custom SMS message to be sent to your users.
|
317
317
|
Must include the codeParameter value received in the request."""
|
318
|
-
self["
|
318
|
+
self._data["smsMessage"] = value
|
319
319
|
|
320
320
|
@property
|
321
321
|
def email_message(self) -> str:
|
322
|
-
return self["
|
322
|
+
return self["emailMessage"]
|
323
323
|
|
324
324
|
@email_message.setter
|
325
325
|
def email_message(self, value: str):
|
326
326
|
"""The custom email message to be sent to your users.
|
327
327
|
Must include the codeParameter value received in the request."""
|
328
|
-
self["
|
328
|
+
self._data["emailMessage"] = value
|
329
329
|
|
330
330
|
@property
|
331
331
|
def email_subject(self) -> str:
|
332
|
-
return self["
|
332
|
+
return self["emailSubject"]
|
333
333
|
|
334
334
|
@email_subject.setter
|
335
335
|
def email_subject(self, value: str):
|
336
336
|
"""The subject line for the custom message."""
|
337
|
-
self["
|
337
|
+
self._data["emailSubject"] = value
|
338
338
|
|
339
339
|
|
340
340
|
class CustomMessageTriggerEvent(BaseTriggerEvent):
|
@@ -361,28 +361,28 @@ class CustomMessageTriggerEvent(BaseTriggerEvent):
|
|
361
361
|
|
362
362
|
@property
|
363
363
|
def request(self) -> CustomMessageTriggerEventRequest:
|
364
|
-
return CustomMessageTriggerEventRequest(self
|
364
|
+
return CustomMessageTriggerEventRequest(self["request"])
|
365
365
|
|
366
366
|
@property
|
367
367
|
def response(self) -> CustomMessageTriggerEventResponse:
|
368
|
-
return CustomMessageTriggerEventResponse(self
|
368
|
+
return CustomMessageTriggerEventResponse(self["response"])
|
369
369
|
|
370
370
|
|
371
371
|
class PreAuthenticationTriggerEventRequest(DictWrapper):
|
372
372
|
@property
|
373
373
|
def user_not_found(self) -> bool | None:
|
374
374
|
"""This boolean is populated when PreventUserExistenceErrors is set to ENABLED for your User Pool client."""
|
375
|
-
return self
|
375
|
+
return self.get("userNotFound")
|
376
376
|
|
377
377
|
@property
|
378
378
|
def user_attributes(self) -> dict[str, str]:
|
379
379
|
"""One or more name-value pairs representing user attributes."""
|
380
|
-
return self["
|
380
|
+
return self["userAttributes"]
|
381
381
|
|
382
382
|
@property
|
383
383
|
def validation_data(self) -> dict[str, str]:
|
384
384
|
"""One or more key-value pairs containing the validation data in the user's sign-in request."""
|
385
|
-
return self
|
385
|
+
return self.get("validationData") or {}
|
386
386
|
|
387
387
|
|
388
388
|
class PreAuthenticationTriggerEvent(BaseTriggerEvent):
|
@@ -405,7 +405,7 @@ class PreAuthenticationTriggerEvent(BaseTriggerEvent):
|
|
405
405
|
@property
|
406
406
|
def request(self) -> PreAuthenticationTriggerEventRequest:
|
407
407
|
"""Pre Authentication Request Parameters"""
|
408
|
-
return PreAuthenticationTriggerEventRequest(self
|
408
|
+
return PreAuthenticationTriggerEventRequest(self["request"])
|
409
409
|
|
410
410
|
|
411
411
|
class PostAuthenticationTriggerEventRequest(DictWrapper):
|
@@ -413,18 +413,18 @@ class PostAuthenticationTriggerEventRequest(DictWrapper):
|
|
413
413
|
def new_device_used(self) -> bool:
|
414
414
|
"""This flag indicates if the user has signed in on a new device.
|
415
415
|
It is set only if the remembered devices value of the user pool is set to `Always` or User `Opt-In`."""
|
416
|
-
return self["
|
416
|
+
return self["newDeviceUsed"]
|
417
417
|
|
418
418
|
@property
|
419
419
|
def user_attributes(self) -> dict[str, str]:
|
420
420
|
"""One or more name-value pairs representing user attributes."""
|
421
|
-
return self["
|
421
|
+
return self["userAttributes"]
|
422
422
|
|
423
423
|
@property
|
424
424
|
def client_metadata(self) -> dict[str, str]:
|
425
425
|
"""One or more key-value pairs that you can provide as custom input to the Lambda function
|
426
426
|
that you specify for the post authentication trigger."""
|
427
|
-
return self
|
427
|
+
return self.get("clientMetadata") or {}
|
428
428
|
|
429
429
|
|
430
430
|
class PostAuthenticationTriggerEvent(BaseTriggerEvent):
|
@@ -447,7 +447,7 @@ class PostAuthenticationTriggerEvent(BaseTriggerEvent):
|
|
447
447
|
@property
|
448
448
|
def request(self) -> PostAuthenticationTriggerEventRequest:
|
449
449
|
"""Post Authentication Request Parameters"""
|
450
|
-
return PostAuthenticationTriggerEventRequest(self
|
450
|
+
return PostAuthenticationTriggerEventRequest(self["request"])
|
451
451
|
|
452
452
|
|
453
453
|
class GroupOverrideDetails(DictWrapper):
|
@@ -471,18 +471,18 @@ class PreTokenGenerationTriggerEventRequest(DictWrapper):
|
|
471
471
|
@property
|
472
472
|
def group_configuration(self) -> GroupOverrideDetails:
|
473
473
|
"""The input object containing the current group configuration"""
|
474
|
-
return GroupOverrideDetails(self["
|
474
|
+
return GroupOverrideDetails(self["groupConfiguration"])
|
475
475
|
|
476
476
|
@property
|
477
477
|
def user_attributes(self) -> dict[str, str]:
|
478
478
|
"""One or more name-value pairs representing user attributes."""
|
479
|
-
return self
|
479
|
+
return self.get("userAttributes") or {}
|
480
480
|
|
481
481
|
@property
|
482
482
|
def client_metadata(self) -> dict[str, str]:
|
483
483
|
"""One or more key-value pairs that you can provide as custom input to the Lambda function
|
484
484
|
that you specify for the pre token generation trigger."""
|
485
|
-
return self
|
485
|
+
return self.get("clientMetadata") or {}
|
486
486
|
|
487
487
|
|
488
488
|
class PreTokenGenerationTriggerV2EventRequest(PreTokenGenerationTriggerEventRequest):
|
@@ -492,7 +492,7 @@ class PreTokenGenerationTriggerV2EventRequest(PreTokenGenerationTriggerEventRequ
|
|
492
492
|
the user pool standard and custom scopes that your user requested,
|
493
493
|
and that you authorized your app client to issue.
|
494
494
|
"""
|
495
|
-
return self
|
495
|
+
return self.get("scopes") or []
|
496
496
|
|
497
497
|
|
498
498
|
class ClaimsOverrideDetails(DictWrapper):
|
@@ -669,19 +669,13 @@ class ClaimsAndScopeOverrideDetails(DictWrapper):
|
|
669
669
|
class PreTokenGenerationTriggerEventResponse(DictWrapper):
|
670
670
|
@property
|
671
671
|
def claims_override_details(self) -> ClaimsOverrideDetails:
|
672
|
-
|
673
|
-
if self._data["response"].get("claimsOverrideDetails") is None:
|
674
|
-
self._data["response"]["claimsOverrideDetails"] = {}
|
675
|
-
return ClaimsOverrideDetails(self._data["response"]["claimsOverrideDetails"])
|
672
|
+
return ClaimsOverrideDetails(self.get("claimsOverrideDetails") or {})
|
676
673
|
|
677
674
|
|
678
675
|
class PreTokenGenerationTriggerV2EventResponse(DictWrapper):
|
679
676
|
@property
|
680
677
|
def claims_scope_override_details(self) -> ClaimsAndScopeOverrideDetails:
|
681
|
-
|
682
|
-
if self._data["response"].get("claimsAndScopeOverrideDetails") is None:
|
683
|
-
self._data["response"]["claimsAndScopeOverrideDetails"] = {}
|
684
|
-
return ClaimsAndScopeOverrideDetails(self._data["response"]["claimsAndScopeOverrideDetails"])
|
678
|
+
return ClaimsAndScopeOverrideDetails(self.get("claimsAndScopeOverrideDetails") or {})
|
685
679
|
|
686
680
|
|
687
681
|
class PreTokenGenerationTriggerEvent(BaseTriggerEvent):
|
@@ -708,12 +702,12 @@ class PreTokenGenerationTriggerEvent(BaseTriggerEvent):
|
|
708
702
|
@property
|
709
703
|
def request(self) -> PreTokenGenerationTriggerEventRequest:
|
710
704
|
"""Pre Token Generation Request Parameters"""
|
711
|
-
return PreTokenGenerationTriggerEventRequest(self
|
705
|
+
return PreTokenGenerationTriggerEventRequest(self["request"])
|
712
706
|
|
713
707
|
@property
|
714
708
|
def response(self) -> PreTokenGenerationTriggerEventResponse:
|
715
709
|
"""Pre Token Generation Response Parameters"""
|
716
|
-
return PreTokenGenerationTriggerEventResponse(self
|
710
|
+
return PreTokenGenerationTriggerEventResponse(self["response"])
|
717
711
|
|
718
712
|
|
719
713
|
class PreTokenGenerationV2TriggerEvent(BaseTriggerEvent):
|
@@ -740,12 +734,12 @@ class PreTokenGenerationV2TriggerEvent(BaseTriggerEvent):
|
|
740
734
|
@property
|
741
735
|
def request(self) -> PreTokenGenerationTriggerV2EventRequest:
|
742
736
|
"""Pre Token Generation Request V2 Parameters"""
|
743
|
-
return PreTokenGenerationTriggerV2EventRequest(self
|
737
|
+
return PreTokenGenerationTriggerV2EventRequest(self["request"])
|
744
738
|
|
745
739
|
@property
|
746
740
|
def response(self) -> PreTokenGenerationTriggerV2EventResponse:
|
747
741
|
"""Pre Token Generation Response V2 Parameters"""
|
748
|
-
return PreTokenGenerationTriggerV2EventResponse(self
|
742
|
+
return PreTokenGenerationTriggerV2EventResponse(self["response"])
|
749
743
|
|
750
744
|
|
751
745
|
class ChallengeResult(DictWrapper):
|
@@ -772,55 +766,55 @@ class DefineAuthChallengeTriggerEventRequest(DictWrapper):
|
|
772
766
|
@property
|
773
767
|
def user_attributes(self) -> dict[str, str]:
|
774
768
|
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
|
775
|
-
return self["
|
769
|
+
return self["userAttributes"]
|
776
770
|
|
777
771
|
@property
|
778
772
|
def user_not_found(self) -> bool | None:
|
779
773
|
"""A Boolean that is populated when PreventUserExistenceErrors is set to ENABLED for your user pool client.
|
780
774
|
A value of true means that the user id (username, email address, etc.) did not match any existing users."""
|
781
|
-
return self
|
775
|
+
return self.get("userNotFound")
|
782
776
|
|
783
777
|
@property
|
784
778
|
def session(self) -> list[ChallengeResult]:
|
785
779
|
"""An array of ChallengeResult elements, each of which contains the following elements:"""
|
786
|
-
return [ChallengeResult(result) for result in self["
|
780
|
+
return [ChallengeResult(result) for result in self["session"]]
|
787
781
|
|
788
782
|
@property
|
789
783
|
def client_metadata(self) -> dict[str, str]:
|
790
784
|
"""One or more key-value pairs that you can provide as custom input to the Lambda function that you specify
|
791
785
|
for the defined auth challenge trigger."""
|
792
|
-
return self
|
786
|
+
return self.get("clientMetadata") or {}
|
793
787
|
|
794
788
|
|
795
789
|
class DefineAuthChallengeTriggerEventResponse(DictWrapper):
|
796
790
|
@property
|
797
791
|
def challenge_name(self) -> str:
|
798
|
-
return self["
|
792
|
+
return self["challengeName"]
|
799
793
|
|
800
794
|
@challenge_name.setter
|
801
795
|
def challenge_name(self, value: str):
|
802
796
|
"""A string containing the name of the next challenge.
|
803
797
|
If you want to present a new challenge to your user, specify the challenge name here."""
|
804
|
-
self["
|
798
|
+
self._data["challengeName"] = value
|
805
799
|
|
806
800
|
@property
|
807
801
|
def fail_authentication(self) -> bool:
|
808
|
-
return bool(self["
|
802
|
+
return bool(self["failAuthentication"])
|
809
803
|
|
810
804
|
@fail_authentication.setter
|
811
805
|
def fail_authentication(self, value: bool):
|
812
806
|
"""Set to true if you want to terminate the current authentication process, or false otherwise."""
|
813
|
-
self["
|
807
|
+
self._data["failAuthentication"] = value
|
814
808
|
|
815
809
|
@property
|
816
810
|
def issue_tokens(self) -> bool:
|
817
|
-
return bool(self["
|
811
|
+
return bool(self["issueTokens"])
|
818
812
|
|
819
813
|
@issue_tokens.setter
|
820
814
|
def issue_tokens(self, value: bool):
|
821
815
|
"""Set to true if you determine that the user has been sufficiently authenticated by
|
822
816
|
completing the challenges, or false otherwise."""
|
823
|
-
self["
|
817
|
+
self._data["issueTokens"] = value
|
824
818
|
|
825
819
|
|
826
820
|
class DefineAuthChallengeTriggerEvent(BaseTriggerEvent):
|
@@ -842,57 +836,57 @@ class DefineAuthChallengeTriggerEvent(BaseTriggerEvent):
|
|
842
836
|
@property
|
843
837
|
def request(self) -> DefineAuthChallengeTriggerEventRequest:
|
844
838
|
"""Define Auth Challenge Request Parameters"""
|
845
|
-
return DefineAuthChallengeTriggerEventRequest(self
|
839
|
+
return DefineAuthChallengeTriggerEventRequest(self["request"])
|
846
840
|
|
847
841
|
@property
|
848
842
|
def response(self) -> DefineAuthChallengeTriggerEventResponse:
|
849
843
|
"""Define Auth Challenge Response Parameters"""
|
850
|
-
return DefineAuthChallengeTriggerEventResponse(self
|
844
|
+
return DefineAuthChallengeTriggerEventResponse(self["response"])
|
851
845
|
|
852
846
|
|
853
847
|
class CreateAuthChallengeTriggerEventRequest(DictWrapper):
|
854
848
|
@property
|
855
849
|
def user_attributes(self) -> dict[str, str]:
|
856
850
|
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
|
857
|
-
return self["
|
851
|
+
return self["userAttributes"]
|
858
852
|
|
859
853
|
@property
|
860
854
|
def user_not_found(self) -> bool | None:
|
861
855
|
"""This boolean is populated when PreventUserExistenceErrors is set to ENABLED for your User Pool client."""
|
862
|
-
return self
|
856
|
+
return self.get("userNotFound")
|
863
857
|
|
864
858
|
@property
|
865
859
|
def challenge_name(self) -> str:
|
866
860
|
"""The name of the new challenge."""
|
867
|
-
return self["
|
861
|
+
return self["challengeName"]
|
868
862
|
|
869
863
|
@property
|
870
864
|
def session(self) -> list[ChallengeResult]:
|
871
865
|
"""An array of ChallengeResult elements, each of which contains the following elements:"""
|
872
|
-
return [ChallengeResult(result) for result in self["
|
866
|
+
return [ChallengeResult(result) for result in self["session"]]
|
873
867
|
|
874
868
|
@property
|
875
869
|
def client_metadata(self) -> dict[str, str]:
|
876
870
|
"""One or more key-value pairs that you can provide as custom input to the Lambda function that you
|
877
871
|
specify for the creation auth challenge trigger."""
|
878
|
-
return self
|
872
|
+
return self.get("clientMetadata") or {}
|
879
873
|
|
880
874
|
|
881
875
|
class CreateAuthChallengeTriggerEventResponse(DictWrapper):
|
882
876
|
@property
|
883
877
|
def public_challenge_parameters(self) -> dict[str, str]:
|
884
|
-
return self["
|
878
|
+
return self["publicChallengeParameters"]
|
885
879
|
|
886
880
|
@public_challenge_parameters.setter
|
887
881
|
def public_challenge_parameters(self, value: dict[str, str]):
|
888
882
|
"""One or more key-value pairs for the client app to use in the challenge to be presented to the user.
|
889
883
|
This parameter should contain all the necessary information to accurately present the challenge to
|
890
884
|
the user."""
|
891
|
-
self["
|
885
|
+
self._data["publicChallengeParameters"] = value
|
892
886
|
|
893
887
|
@property
|
894
888
|
def private_challenge_parameters(self) -> dict[str, str]:
|
895
|
-
return self["
|
889
|
+
return self["privateChallengeParameters"]
|
896
890
|
|
897
891
|
@private_challenge_parameters.setter
|
898
892
|
def private_challenge_parameters(self, value: dict[str, str]):
|
@@ -901,16 +895,16 @@ class CreateAuthChallengeTriggerEventResponse(DictWrapper):
|
|
901
895
|
response to the challenge. In other words, the publicChallengeParameters parameter contains the
|
902
896
|
question that is presented to the user and privateChallengeParameters contains the valid answers
|
903
897
|
for the question."""
|
904
|
-
self["
|
898
|
+
self._data["privateChallengeParameters"] = value
|
905
899
|
|
906
900
|
@property
|
907
901
|
def challenge_metadata(self) -> str:
|
908
|
-
return self["
|
902
|
+
return self["challengeMetadata"]
|
909
903
|
|
910
904
|
@challenge_metadata.setter
|
911
905
|
def challenge_metadata(self, value: str):
|
912
906
|
"""Your name for the custom challenge, if this is a custom challenge."""
|
913
|
-
self["
|
907
|
+
self._data["challengeMetadata"] = value
|
914
908
|
|
915
909
|
|
916
910
|
class CreateAuthChallengeTriggerEvent(BaseTriggerEvent):
|
@@ -934,52 +928,52 @@ class CreateAuthChallengeTriggerEvent(BaseTriggerEvent):
|
|
934
928
|
@property
|
935
929
|
def request(self) -> CreateAuthChallengeTriggerEventRequest:
|
936
930
|
"""Create Auth Challenge Request Parameters"""
|
937
|
-
return CreateAuthChallengeTriggerEventRequest(self
|
931
|
+
return CreateAuthChallengeTriggerEventRequest(self["request"])
|
938
932
|
|
939
933
|
@property
|
940
934
|
def response(self) -> CreateAuthChallengeTriggerEventResponse:
|
941
935
|
"""Create Auth Challenge Response Parameters"""
|
942
|
-
return CreateAuthChallengeTriggerEventResponse(self
|
936
|
+
return CreateAuthChallengeTriggerEventResponse(self["response"])
|
943
937
|
|
944
938
|
|
945
939
|
class VerifyAuthChallengeResponseTriggerEventRequest(DictWrapper):
|
946
940
|
@property
|
947
941
|
def user_attributes(self) -> dict[str, str]:
|
948
942
|
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
|
949
|
-
return self["
|
943
|
+
return self["userAttributes"]
|
950
944
|
|
951
945
|
@property
|
952
946
|
def private_challenge_parameters(self) -> dict[str, str]:
|
953
947
|
"""This parameter comes from the Create Auth Challenge trigger, and is
|
954
948
|
compared against a user’s challengeAnswer to determine whether the user passed the challenge."""
|
955
|
-
return self["
|
949
|
+
return self["privateChallengeParameters"]
|
956
950
|
|
957
951
|
@property
|
958
952
|
def challenge_answer(self) -> Any:
|
959
953
|
"""The answer from the user's response to the challenge."""
|
960
|
-
return self["
|
954
|
+
return self["challengeAnswer"]
|
961
955
|
|
962
956
|
@property
|
963
957
|
def client_metadata(self) -> dict[str, str]:
|
964
958
|
"""One or more key-value pairs that you can provide as custom input to the Lambda function that
|
965
959
|
you specify for the "Verify Auth Challenge" trigger."""
|
966
|
-
return self
|
960
|
+
return self.get("clientMetadata") or {}
|
967
961
|
|
968
962
|
@property
|
969
963
|
def user_not_found(self) -> bool | None:
|
970
964
|
"""This boolean is populated when PreventUserExistenceErrors is set to ENABLED for your User Pool client."""
|
971
|
-
return self
|
965
|
+
return self.get("userNotFound")
|
972
966
|
|
973
967
|
|
974
968
|
class VerifyAuthChallengeResponseTriggerEventResponse(DictWrapper):
|
975
969
|
@property
|
976
970
|
def answer_correct(self) -> bool:
|
977
|
-
return bool(self["
|
971
|
+
return bool(self["answerCorrect"])
|
978
972
|
|
979
973
|
@answer_correct.setter
|
980
974
|
def answer_correct(self, value: bool):
|
981
975
|
"""Set to true if the user has successfully completed the challenge, or false otherwise."""
|
982
|
-
self["
|
976
|
+
self._data["answerCorrect"] = value
|
983
977
|
|
984
978
|
|
985
979
|
class VerifyAuthChallengeResponseTriggerEvent(BaseTriggerEvent):
|
@@ -1003,12 +997,12 @@ class VerifyAuthChallengeResponseTriggerEvent(BaseTriggerEvent):
|
|
1003
997
|
@property
|
1004
998
|
def request(self) -> VerifyAuthChallengeResponseTriggerEventRequest:
|
1005
999
|
"""Verify Auth Challenge Request Parameters"""
|
1006
|
-
return VerifyAuthChallengeResponseTriggerEventRequest(self
|
1000
|
+
return VerifyAuthChallengeResponseTriggerEventRequest(self["request"])
|
1007
1001
|
|
1008
1002
|
@property
|
1009
1003
|
def response(self) -> VerifyAuthChallengeResponseTriggerEventResponse:
|
1010
1004
|
"""Verify Auth Challenge Response Parameters"""
|
1011
|
-
return VerifyAuthChallengeResponseTriggerEventResponse(self
|
1005
|
+
return VerifyAuthChallengeResponseTriggerEventResponse(self["response"])
|
1012
1006
|
|
1013
1007
|
|
1014
1008
|
class CustomEmailSenderTriggerEventRequest(DictWrapper):
|
@@ -1017,17 +1011,17 @@ class CustomEmailSenderTriggerEventRequest(DictWrapper):
|
|
1017
1011
|
"""The request version. For a custom email sender event, the value of this string
|
1018
1012
|
is always customEmailSenderRequestV1.
|
1019
1013
|
"""
|
1020
|
-
return self["
|
1014
|
+
return self["type"]
|
1021
1015
|
|
1022
1016
|
@property
|
1023
1017
|
def code(self) -> str:
|
1024
1018
|
"""The encrypted code that your function can decrypt and send to your user."""
|
1025
|
-
return self["
|
1019
|
+
return self["code"]
|
1026
1020
|
|
1027
1021
|
@property
|
1028
1022
|
def user_attributes(self) -> dict[str, str]:
|
1029
1023
|
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
|
1030
|
-
return self["
|
1024
|
+
return self["userAttributes"]
|
1031
1025
|
|
1032
1026
|
@property
|
1033
1027
|
def client_metadata(self) -> dict[str, str]:
|
@@ -1038,14 +1032,14 @@ class CustomEmailSenderTriggerEventRequest(DictWrapper):
|
|
1038
1032
|
ClientMetadata parameter in AdminInitiateAuth and InitiateAuth API operations
|
1039
1033
|
in the request that it passes to the post authentication function.
|
1040
1034
|
"""
|
1041
|
-
return self
|
1035
|
+
return self.get("clientMetadata") or {}
|
1042
1036
|
|
1043
1037
|
|
1044
1038
|
class CustomEmailSenderTriggerEvent(BaseTriggerEvent):
|
1045
1039
|
@property
|
1046
1040
|
def request(self) -> CustomEmailSenderTriggerEventRequest:
|
1047
1041
|
"""Custom Email Sender Request Parameters"""
|
1048
|
-
return CustomEmailSenderTriggerEventRequest(self
|
1042
|
+
return CustomEmailSenderTriggerEventRequest(self["request"])
|
1049
1043
|
|
1050
1044
|
|
1051
1045
|
class CustomSMSSenderTriggerEventRequest(DictWrapper):
|
@@ -1054,17 +1048,17 @@ class CustomSMSSenderTriggerEventRequest(DictWrapper):
|
|
1054
1048
|
"""The request version. For a custom SMS sender event, the value of this string is always
|
1055
1049
|
customSMSSenderRequestV1.
|
1056
1050
|
"""
|
1057
|
-
return self["
|
1051
|
+
return self["type"]
|
1058
1052
|
|
1059
1053
|
@property
|
1060
1054
|
def code(self) -> str:
|
1061
1055
|
"""The encrypted code that your function can decrypt and send to your user."""
|
1062
|
-
return self["
|
1056
|
+
return self["code"]
|
1063
1057
|
|
1064
1058
|
@property
|
1065
1059
|
def user_attributes(self) -> dict[str, str]:
|
1066
1060
|
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
|
1067
|
-
return self
|
1061
|
+
return self.get("userAttributes") or {}
|
1068
1062
|
|
1069
1063
|
@property
|
1070
1064
|
def client_metadata(self) -> dict[str, str]:
|
@@ -1075,11 +1069,11 @@ class CustomSMSSenderTriggerEventRequest(DictWrapper):
|
|
1075
1069
|
ClientMetadata parameter in AdminInitiateAuth and InitiateAuth API operations
|
1076
1070
|
in the request that it passes to the post authentication function.
|
1077
1071
|
"""
|
1078
|
-
return self
|
1072
|
+
return self.get("clientMetadata") or {}
|
1079
1073
|
|
1080
1074
|
|
1081
1075
|
class CustomSMSSenderTriggerEvent(BaseTriggerEvent):
|
1082
1076
|
@property
|
1083
1077
|
def request(self) -> CustomSMSSenderTriggerEventRequest:
|
1084
1078
|
"""Custom SMS Sender Request Parameters"""
|
1085
|
-
return CustomSMSSenderTriggerEventRequest(self
|
1079
|
+
return CustomSMSSenderTriggerEventRequest(self["request"])
|