aws-lambda-powertools 3.8.1a6__py3-none-any.whl → 3.8.1a8__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 +116 -169
- 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.1a8.dist-info}/METADATA +2 -2
- {aws_lambda_powertools-3.8.1a6.dist-info → aws_lambda_powertools-3.8.1a8.dist-info}/RECORD +20 -19
- {aws_lambda_powertools-3.8.1a6.dist-info → aws_lambda_powertools-3.8.1a8.dist-info}/LICENSE +0 -0
- {aws_lambda_powertools-3.8.1a6.dist-info → aws_lambda_powertools-3.8.1a8.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,10 +492,10 @@ 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
|
-
class
|
498
|
+
class ClaimsOverrideBase(DictWrapper):
|
499
499
|
@property
|
500
500
|
def claims_to_add_or_override(self) -> dict[str, str]:
|
501
501
|
return self.get("claimsToAddOrOverride") or {}
|
@@ -515,6 +515,8 @@ class ClaimsOverrideDetails(DictWrapper):
|
|
515
515
|
"""A list that contains claims to be suppressed from the identity token."""
|
516
516
|
self._data["claimsToSuppress"] = value
|
517
517
|
|
518
|
+
|
519
|
+
class GroupConfigurationBase(DictWrapper):
|
518
520
|
@property
|
519
521
|
def group_configuration(self) -> GroupOverrideDetails | None:
|
520
522
|
group_override_details = self.get("groupOverrideDetails")
|
@@ -549,26 +551,11 @@ class ClaimsOverrideDetails(DictWrapper):
|
|
549
551
|
self["groupOverrideDetails"]["preferredRole"] = value
|
550
552
|
|
551
553
|
|
552
|
-
class
|
553
|
-
|
554
|
-
def claims_to_add_or_override(self) -> dict[str, str]:
|
555
|
-
return self.get("claimsToAddOrOverride") or {}
|
554
|
+
class ClaimsOverrideDetails(ClaimsOverrideBase, GroupConfigurationBase):
|
555
|
+
pass
|
556
556
|
|
557
|
-
@claims_to_add_or_override.setter
|
558
|
-
def claims_to_add_or_override(self, value: dict[str, str]):
|
559
|
-
"""A map of one or more key-value pairs of claims to add or override.
|
560
|
-
For group related claims, use groupOverrideDetails instead."""
|
561
|
-
self._data["claimsToAddOrOverride"] = value
|
562
|
-
|
563
|
-
@property
|
564
|
-
def claims_to_suppress(self) -> list[str]:
|
565
|
-
return self.get("claimsToSuppress") or []
|
566
|
-
|
567
|
-
@claims_to_suppress.setter
|
568
|
-
def claims_to_suppress(self, value: list[str]):
|
569
|
-
"""A list that contains claims to be suppressed from the identity token."""
|
570
|
-
self._data["claimsToSuppress"] = value
|
571
557
|
|
558
|
+
class TokenClaimsAndScopeOverrideDetails(ClaimsOverrideBase):
|
572
559
|
@property
|
573
560
|
def scopes_to_add(self) -> list[str]:
|
574
561
|
return self.get("scopesToAdd") or []
|
@@ -586,8 +573,7 @@ class TokenClaimsAndScopeOverrideDetails(DictWrapper):
|
|
586
573
|
self._data["scopesToSuppress"] = value
|
587
574
|
|
588
575
|
|
589
|
-
class ClaimsAndScopeOverrideDetails(
|
590
|
-
|
576
|
+
class ClaimsAndScopeOverrideDetails(GroupConfigurationBase):
|
591
577
|
@property
|
592
578
|
def id_token_generation(self) -> TokenClaimsAndScopeOverrideDetails | None:
|
593
579
|
id_token_generation_details = self._data.get("idTokenGeneration")
|
@@ -632,56 +618,17 @@ class ClaimsAndScopeOverrideDetails(DictWrapper):
|
|
632
618
|
"""
|
633
619
|
self._data["accessTokenGeneration"] = value
|
634
620
|
|
635
|
-
@property
|
636
|
-
def group_configuration(self) -> GroupOverrideDetails | None:
|
637
|
-
group_override_details = self.get("groupOverrideDetails")
|
638
|
-
return None if group_override_details is None else GroupOverrideDetails(group_override_details)
|
639
|
-
|
640
|
-
@group_configuration.setter
|
641
|
-
def group_configuration(self, value: dict[str, Any]):
|
642
|
-
"""The output object containing the current group configuration.
|
643
|
-
|
644
|
-
It includes groupsToOverride, iamRolesToOverride, and preferredRole.
|
645
|
-
|
646
|
-
The groupOverrideDetails object is replaced with the one you provide. If you provide an empty or null
|
647
|
-
object in the response, then the groups are suppressed. To leave the existing group configuration
|
648
|
-
as is, copy the value of the request's groupConfiguration object to the groupOverrideDetails object
|
649
|
-
in the response, and pass it back to the service.
|
650
|
-
"""
|
651
|
-
self._data["groupOverrideDetails"] = value
|
652
|
-
|
653
|
-
def set_group_configuration_groups_to_override(self, value: list[str]):
|
654
|
-
"""A list of the group names that are associated with the user that the identity token is issued for."""
|
655
|
-
self._data.setdefault("groupOverrideDetails", {})
|
656
|
-
self["groupOverrideDetails"]["groupsToOverride"] = value
|
657
|
-
|
658
|
-
def set_group_configuration_iam_roles_to_override(self, value: list[str]):
|
659
|
-
"""A list of the current IAM roles associated with these groups."""
|
660
|
-
self._data.setdefault("groupOverrideDetails", {})
|
661
|
-
self["groupOverrideDetails"]["iamRolesToOverride"] = value
|
662
|
-
|
663
|
-
def set_group_configuration_preferred_role(self, value: str):
|
664
|
-
"""A string indicating the preferred IAM role."""
|
665
|
-
self._data.setdefault("groupOverrideDetails", {})
|
666
|
-
self["groupOverrideDetails"]["preferredRole"] = value
|
667
|
-
|
668
621
|
|
669
622
|
class PreTokenGenerationTriggerEventResponse(DictWrapper):
|
670
623
|
@property
|
671
624
|
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"])
|
625
|
+
return ClaimsOverrideDetails(self.get("claimsOverrideDetails") or {})
|
676
626
|
|
677
627
|
|
678
628
|
class PreTokenGenerationTriggerV2EventResponse(DictWrapper):
|
679
629
|
@property
|
680
630
|
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"])
|
631
|
+
return ClaimsAndScopeOverrideDetails(self.get("claimsAndScopeOverrideDetails") or {})
|
685
632
|
|
686
633
|
|
687
634
|
class PreTokenGenerationTriggerEvent(BaseTriggerEvent):
|
@@ -708,12 +655,12 @@ class PreTokenGenerationTriggerEvent(BaseTriggerEvent):
|
|
708
655
|
@property
|
709
656
|
def request(self) -> PreTokenGenerationTriggerEventRequest:
|
710
657
|
"""Pre Token Generation Request Parameters"""
|
711
|
-
return PreTokenGenerationTriggerEventRequest(self
|
658
|
+
return PreTokenGenerationTriggerEventRequest(self["request"])
|
712
659
|
|
713
660
|
@property
|
714
661
|
def response(self) -> PreTokenGenerationTriggerEventResponse:
|
715
662
|
"""Pre Token Generation Response Parameters"""
|
716
|
-
return PreTokenGenerationTriggerEventResponse(self
|
663
|
+
return PreTokenGenerationTriggerEventResponse(self["response"])
|
717
664
|
|
718
665
|
|
719
666
|
class PreTokenGenerationV2TriggerEvent(BaseTriggerEvent):
|
@@ -740,12 +687,12 @@ class PreTokenGenerationV2TriggerEvent(BaseTriggerEvent):
|
|
740
687
|
@property
|
741
688
|
def request(self) -> PreTokenGenerationTriggerV2EventRequest:
|
742
689
|
"""Pre Token Generation Request V2 Parameters"""
|
743
|
-
return PreTokenGenerationTriggerV2EventRequest(self
|
690
|
+
return PreTokenGenerationTriggerV2EventRequest(self["request"])
|
744
691
|
|
745
692
|
@property
|
746
693
|
def response(self) -> PreTokenGenerationTriggerV2EventResponse:
|
747
694
|
"""Pre Token Generation Response V2 Parameters"""
|
748
|
-
return PreTokenGenerationTriggerV2EventResponse(self
|
695
|
+
return PreTokenGenerationTriggerV2EventResponse(self["response"])
|
749
696
|
|
750
697
|
|
751
698
|
class ChallengeResult(DictWrapper):
|
@@ -772,55 +719,55 @@ class DefineAuthChallengeTriggerEventRequest(DictWrapper):
|
|
772
719
|
@property
|
773
720
|
def user_attributes(self) -> dict[str, str]:
|
774
721
|
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
|
775
|
-
return self["
|
722
|
+
return self["userAttributes"]
|
776
723
|
|
777
724
|
@property
|
778
725
|
def user_not_found(self) -> bool | None:
|
779
726
|
"""A Boolean that is populated when PreventUserExistenceErrors is set to ENABLED for your user pool client.
|
780
727
|
A value of true means that the user id (username, email address, etc.) did not match any existing users."""
|
781
|
-
return self
|
728
|
+
return self.get("userNotFound")
|
782
729
|
|
783
730
|
@property
|
784
731
|
def session(self) -> list[ChallengeResult]:
|
785
732
|
"""An array of ChallengeResult elements, each of which contains the following elements:"""
|
786
|
-
return [ChallengeResult(result) for result in self["
|
733
|
+
return [ChallengeResult(result) for result in self["session"]]
|
787
734
|
|
788
735
|
@property
|
789
736
|
def client_metadata(self) -> dict[str, str]:
|
790
737
|
"""One or more key-value pairs that you can provide as custom input to the Lambda function that you specify
|
791
738
|
for the defined auth challenge trigger."""
|
792
|
-
return self
|
739
|
+
return self.get("clientMetadata") or {}
|
793
740
|
|
794
741
|
|
795
742
|
class DefineAuthChallengeTriggerEventResponse(DictWrapper):
|
796
743
|
@property
|
797
744
|
def challenge_name(self) -> str:
|
798
|
-
return self["
|
745
|
+
return self["challengeName"]
|
799
746
|
|
800
747
|
@challenge_name.setter
|
801
748
|
def challenge_name(self, value: str):
|
802
749
|
"""A string containing the name of the next challenge.
|
803
750
|
If you want to present a new challenge to your user, specify the challenge name here."""
|
804
|
-
self["
|
751
|
+
self._data["challengeName"] = value
|
805
752
|
|
806
753
|
@property
|
807
754
|
def fail_authentication(self) -> bool:
|
808
|
-
return bool(self["
|
755
|
+
return bool(self["failAuthentication"])
|
809
756
|
|
810
757
|
@fail_authentication.setter
|
811
758
|
def fail_authentication(self, value: bool):
|
812
759
|
"""Set to true if you want to terminate the current authentication process, or false otherwise."""
|
813
|
-
self["
|
760
|
+
self._data["failAuthentication"] = value
|
814
761
|
|
815
762
|
@property
|
816
763
|
def issue_tokens(self) -> bool:
|
817
|
-
return bool(self["
|
764
|
+
return bool(self["issueTokens"])
|
818
765
|
|
819
766
|
@issue_tokens.setter
|
820
767
|
def issue_tokens(self, value: bool):
|
821
768
|
"""Set to true if you determine that the user has been sufficiently authenticated by
|
822
769
|
completing the challenges, or false otherwise."""
|
823
|
-
self["
|
770
|
+
self._data["issueTokens"] = value
|
824
771
|
|
825
772
|
|
826
773
|
class DefineAuthChallengeTriggerEvent(BaseTriggerEvent):
|
@@ -842,57 +789,57 @@ class DefineAuthChallengeTriggerEvent(BaseTriggerEvent):
|
|
842
789
|
@property
|
843
790
|
def request(self) -> DefineAuthChallengeTriggerEventRequest:
|
844
791
|
"""Define Auth Challenge Request Parameters"""
|
845
|
-
return DefineAuthChallengeTriggerEventRequest(self
|
792
|
+
return DefineAuthChallengeTriggerEventRequest(self["request"])
|
846
793
|
|
847
794
|
@property
|
848
795
|
def response(self) -> DefineAuthChallengeTriggerEventResponse:
|
849
796
|
"""Define Auth Challenge Response Parameters"""
|
850
|
-
return DefineAuthChallengeTriggerEventResponse(self
|
797
|
+
return DefineAuthChallengeTriggerEventResponse(self["response"])
|
851
798
|
|
852
799
|
|
853
800
|
class CreateAuthChallengeTriggerEventRequest(DictWrapper):
|
854
801
|
@property
|
855
802
|
def user_attributes(self) -> dict[str, str]:
|
856
803
|
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
|
857
|
-
return self["
|
804
|
+
return self["userAttributes"]
|
858
805
|
|
859
806
|
@property
|
860
807
|
def user_not_found(self) -> bool | None:
|
861
808
|
"""This boolean is populated when PreventUserExistenceErrors is set to ENABLED for your User Pool client."""
|
862
|
-
return self
|
809
|
+
return self.get("userNotFound")
|
863
810
|
|
864
811
|
@property
|
865
812
|
def challenge_name(self) -> str:
|
866
813
|
"""The name of the new challenge."""
|
867
|
-
return self["
|
814
|
+
return self["challengeName"]
|
868
815
|
|
869
816
|
@property
|
870
817
|
def session(self) -> list[ChallengeResult]:
|
871
818
|
"""An array of ChallengeResult elements, each of which contains the following elements:"""
|
872
|
-
return [ChallengeResult(result) for result in self["
|
819
|
+
return [ChallengeResult(result) for result in self["session"]]
|
873
820
|
|
874
821
|
@property
|
875
822
|
def client_metadata(self) -> dict[str, str]:
|
876
823
|
"""One or more key-value pairs that you can provide as custom input to the Lambda function that you
|
877
824
|
specify for the creation auth challenge trigger."""
|
878
|
-
return self
|
825
|
+
return self.get("clientMetadata") or {}
|
879
826
|
|
880
827
|
|
881
828
|
class CreateAuthChallengeTriggerEventResponse(DictWrapper):
|
882
829
|
@property
|
883
830
|
def public_challenge_parameters(self) -> dict[str, str]:
|
884
|
-
return self["
|
831
|
+
return self["publicChallengeParameters"]
|
885
832
|
|
886
833
|
@public_challenge_parameters.setter
|
887
834
|
def public_challenge_parameters(self, value: dict[str, str]):
|
888
835
|
"""One or more key-value pairs for the client app to use in the challenge to be presented to the user.
|
889
836
|
This parameter should contain all the necessary information to accurately present the challenge to
|
890
837
|
the user."""
|
891
|
-
self["
|
838
|
+
self._data["publicChallengeParameters"] = value
|
892
839
|
|
893
840
|
@property
|
894
841
|
def private_challenge_parameters(self) -> dict[str, str]:
|
895
|
-
return self["
|
842
|
+
return self["privateChallengeParameters"]
|
896
843
|
|
897
844
|
@private_challenge_parameters.setter
|
898
845
|
def private_challenge_parameters(self, value: dict[str, str]):
|
@@ -901,16 +848,16 @@ class CreateAuthChallengeTriggerEventResponse(DictWrapper):
|
|
901
848
|
response to the challenge. In other words, the publicChallengeParameters parameter contains the
|
902
849
|
question that is presented to the user and privateChallengeParameters contains the valid answers
|
903
850
|
for the question."""
|
904
|
-
self["
|
851
|
+
self._data["privateChallengeParameters"] = value
|
905
852
|
|
906
853
|
@property
|
907
854
|
def challenge_metadata(self) -> str:
|
908
|
-
return self["
|
855
|
+
return self["challengeMetadata"]
|
909
856
|
|
910
857
|
@challenge_metadata.setter
|
911
858
|
def challenge_metadata(self, value: str):
|
912
859
|
"""Your name for the custom challenge, if this is a custom challenge."""
|
913
|
-
self["
|
860
|
+
self._data["challengeMetadata"] = value
|
914
861
|
|
915
862
|
|
916
863
|
class CreateAuthChallengeTriggerEvent(BaseTriggerEvent):
|
@@ -934,52 +881,52 @@ class CreateAuthChallengeTriggerEvent(BaseTriggerEvent):
|
|
934
881
|
@property
|
935
882
|
def request(self) -> CreateAuthChallengeTriggerEventRequest:
|
936
883
|
"""Create Auth Challenge Request Parameters"""
|
937
|
-
return CreateAuthChallengeTriggerEventRequest(self
|
884
|
+
return CreateAuthChallengeTriggerEventRequest(self["request"])
|
938
885
|
|
939
886
|
@property
|
940
887
|
def response(self) -> CreateAuthChallengeTriggerEventResponse:
|
941
888
|
"""Create Auth Challenge Response Parameters"""
|
942
|
-
return CreateAuthChallengeTriggerEventResponse(self
|
889
|
+
return CreateAuthChallengeTriggerEventResponse(self["response"])
|
943
890
|
|
944
891
|
|
945
892
|
class VerifyAuthChallengeResponseTriggerEventRequest(DictWrapper):
|
946
893
|
@property
|
947
894
|
def user_attributes(self) -> dict[str, str]:
|
948
895
|
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
|
949
|
-
return self["
|
896
|
+
return self["userAttributes"]
|
950
897
|
|
951
898
|
@property
|
952
899
|
def private_challenge_parameters(self) -> dict[str, str]:
|
953
900
|
"""This parameter comes from the Create Auth Challenge trigger, and is
|
954
901
|
compared against a user’s challengeAnswer to determine whether the user passed the challenge."""
|
955
|
-
return self["
|
902
|
+
return self["privateChallengeParameters"]
|
956
903
|
|
957
904
|
@property
|
958
905
|
def challenge_answer(self) -> Any:
|
959
906
|
"""The answer from the user's response to the challenge."""
|
960
|
-
return self["
|
907
|
+
return self["challengeAnswer"]
|
961
908
|
|
962
909
|
@property
|
963
910
|
def client_metadata(self) -> dict[str, str]:
|
964
911
|
"""One or more key-value pairs that you can provide as custom input to the Lambda function that
|
965
912
|
you specify for the "Verify Auth Challenge" trigger."""
|
966
|
-
return self
|
913
|
+
return self.get("clientMetadata") or {}
|
967
914
|
|
968
915
|
@property
|
969
916
|
def user_not_found(self) -> bool | None:
|
970
917
|
"""This boolean is populated when PreventUserExistenceErrors is set to ENABLED for your User Pool client."""
|
971
|
-
return self
|
918
|
+
return self.get("userNotFound")
|
972
919
|
|
973
920
|
|
974
921
|
class VerifyAuthChallengeResponseTriggerEventResponse(DictWrapper):
|
975
922
|
@property
|
976
923
|
def answer_correct(self) -> bool:
|
977
|
-
return bool(self["
|
924
|
+
return bool(self["answerCorrect"])
|
978
925
|
|
979
926
|
@answer_correct.setter
|
980
927
|
def answer_correct(self, value: bool):
|
981
928
|
"""Set to true if the user has successfully completed the challenge, or false otherwise."""
|
982
|
-
self["
|
929
|
+
self._data["answerCorrect"] = value
|
983
930
|
|
984
931
|
|
985
932
|
class VerifyAuthChallengeResponseTriggerEvent(BaseTriggerEvent):
|
@@ -1003,12 +950,12 @@ class VerifyAuthChallengeResponseTriggerEvent(BaseTriggerEvent):
|
|
1003
950
|
@property
|
1004
951
|
def request(self) -> VerifyAuthChallengeResponseTriggerEventRequest:
|
1005
952
|
"""Verify Auth Challenge Request Parameters"""
|
1006
|
-
return VerifyAuthChallengeResponseTriggerEventRequest(self
|
953
|
+
return VerifyAuthChallengeResponseTriggerEventRequest(self["request"])
|
1007
954
|
|
1008
955
|
@property
|
1009
956
|
def response(self) -> VerifyAuthChallengeResponseTriggerEventResponse:
|
1010
957
|
"""Verify Auth Challenge Response Parameters"""
|
1011
|
-
return VerifyAuthChallengeResponseTriggerEventResponse(self
|
958
|
+
return VerifyAuthChallengeResponseTriggerEventResponse(self["response"])
|
1012
959
|
|
1013
960
|
|
1014
961
|
class CustomEmailSenderTriggerEventRequest(DictWrapper):
|
@@ -1017,17 +964,17 @@ class CustomEmailSenderTriggerEventRequest(DictWrapper):
|
|
1017
964
|
"""The request version. For a custom email sender event, the value of this string
|
1018
965
|
is always customEmailSenderRequestV1.
|
1019
966
|
"""
|
1020
|
-
return self["
|
967
|
+
return self["type"]
|
1021
968
|
|
1022
969
|
@property
|
1023
970
|
def code(self) -> str:
|
1024
971
|
"""The encrypted code that your function can decrypt and send to your user."""
|
1025
|
-
return self["
|
972
|
+
return self["code"]
|
1026
973
|
|
1027
974
|
@property
|
1028
975
|
def user_attributes(self) -> dict[str, str]:
|
1029
976
|
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
|
1030
|
-
return self["
|
977
|
+
return self["userAttributes"]
|
1031
978
|
|
1032
979
|
@property
|
1033
980
|
def client_metadata(self) -> dict[str, str]:
|
@@ -1038,14 +985,14 @@ class CustomEmailSenderTriggerEventRequest(DictWrapper):
|
|
1038
985
|
ClientMetadata parameter in AdminInitiateAuth and InitiateAuth API operations
|
1039
986
|
in the request that it passes to the post authentication function.
|
1040
987
|
"""
|
1041
|
-
return self
|
988
|
+
return self.get("clientMetadata") or {}
|
1042
989
|
|
1043
990
|
|
1044
991
|
class CustomEmailSenderTriggerEvent(BaseTriggerEvent):
|
1045
992
|
@property
|
1046
993
|
def request(self) -> CustomEmailSenderTriggerEventRequest:
|
1047
994
|
"""Custom Email Sender Request Parameters"""
|
1048
|
-
return CustomEmailSenderTriggerEventRequest(self
|
995
|
+
return CustomEmailSenderTriggerEventRequest(self["request"])
|
1049
996
|
|
1050
997
|
|
1051
998
|
class CustomSMSSenderTriggerEventRequest(DictWrapper):
|
@@ -1054,17 +1001,17 @@ class CustomSMSSenderTriggerEventRequest(DictWrapper):
|
|
1054
1001
|
"""The request version. For a custom SMS sender event, the value of this string is always
|
1055
1002
|
customSMSSenderRequestV1.
|
1056
1003
|
"""
|
1057
|
-
return self["
|
1004
|
+
return self["type"]
|
1058
1005
|
|
1059
1006
|
@property
|
1060
1007
|
def code(self) -> str:
|
1061
1008
|
"""The encrypted code that your function can decrypt and send to your user."""
|
1062
|
-
return self["
|
1009
|
+
return self["code"]
|
1063
1010
|
|
1064
1011
|
@property
|
1065
1012
|
def user_attributes(self) -> dict[str, str]:
|
1066
1013
|
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
|
1067
|
-
return self
|
1014
|
+
return self.get("userAttributes") or {}
|
1068
1015
|
|
1069
1016
|
@property
|
1070
1017
|
def client_metadata(self) -> dict[str, str]:
|
@@ -1075,11 +1022,11 @@ class CustomSMSSenderTriggerEventRequest(DictWrapper):
|
|
1075
1022
|
ClientMetadata parameter in AdminInitiateAuth and InitiateAuth API operations
|
1076
1023
|
in the request that it passes to the post authentication function.
|
1077
1024
|
"""
|
1078
|
-
return self
|
1025
|
+
return self.get("clientMetadata") or {}
|
1079
1026
|
|
1080
1027
|
|
1081
1028
|
class CustomSMSSenderTriggerEvent(BaseTriggerEvent):
|
1082
1029
|
@property
|
1083
1030
|
def request(self) -> CustomSMSSenderTriggerEventRequest:
|
1084
1031
|
"""Custom SMS Sender Request Parameters"""
|
1085
|
-
return CustomSMSSenderTriggerEventRequest(self
|
1032
|
+
return CustomSMSSenderTriggerEventRequest(self["request"])
|