@@ -220,11 +220,11 @@ pub struct CognitoEventUserPoolsPreTokenGenRequest {
220
220
pub client_metadata : HashMap < String , String > ,
221
221
}
222
222
223
- /// `CognitoEventUserPoolsPreTokenGenResponse` containst the response portion of a PreTokenGen event
223
+ /// `CognitoEventUserPoolsPreTokenGenResponse` contains the response portion of a PreTokenGen event
224
224
#[ derive( Debug , Clone , PartialEq , Deserialize , Serialize ) ]
225
225
#[ serde( rename_all = "camelCase" ) ]
226
226
pub struct CognitoEventUserPoolsPreTokenGenResponse {
227
- pub claims_override_details : ClaimsOverrideDetails ,
227
+ pub claims_override_details : Option < ClaimsOverrideDetails > ,
228
228
}
229
229
230
230
/// `CognitoEventUserPoolsPostAuthenticationRequest` contains the request portion of a PostAuthentication event
@@ -286,7 +286,7 @@ pub struct ClaimsOverrideDetails {
286
286
pub claims_to_suppress : Vec < String > ,
287
287
}
288
288
289
- /// `GroupConfiguration` allows lambda to override groups, roles and set a perferred role
289
+ /// `GroupConfiguration` allows lambda to override groups, roles and set a preferred role
290
290
#[ derive( Debug , Clone , PartialEq , Deserialize , Serialize ) ]
291
291
#[ serde( rename_all = "camelCase" ) ]
292
292
pub struct GroupConfiguration {
@@ -363,7 +363,7 @@ pub struct CognitoEventUserPoolsCreateAuthChallengeRequest {
363
363
pub client_metadata : HashMap < String , String > ,
364
364
}
365
365
366
- /// `CognitoEventUserPoolsCreateAuthChallengeResponse` defines create auth challenge response rarameters
366
+ /// `CognitoEventUserPoolsCreateAuthChallengeResponse` defines create auth challenge response parameters
367
367
#[ derive( Debug , Clone , PartialEq , Deserialize , Serialize ) ]
368
368
#[ serde( rename_all = "camelCase" ) ]
369
369
pub struct CognitoEventUserPoolsCreateAuthChallengeResponse {
@@ -618,6 +618,19 @@ mod test {
618
618
assert_eq ! ( parsed, reparsed) ;
619
619
}
620
620
621
+ #[ test]
622
+ #[ cfg( feature = "cognito" ) ]
623
+ fn example_cognito_event_userpools_pretokengen_incoming ( ) {
624
+ let data = include_bytes ! (
625
+ "../generated/fixtures/example-cognito-event-userpools-pretokengen-incoming.json"
626
+ ) ;
627
+ let parsed: CognitoEventUserPoolsPreTokenGen = serde_json:: from_slice ( data) . unwrap ( ) ;
628
+ let output: String = serde_json:: to_string ( & parsed) . unwrap ( ) ;
629
+ let reparsed: CognitoEventUserPoolsPreTokenGen =
630
+ serde_json:: from_slice ( output. as_bytes ( ) ) . unwrap ( ) ;
631
+ assert_eq ! ( parsed, reparsed) ;
632
+ }
633
+
621
634
#[ test]
622
635
#[ cfg( feature = "cognito" ) ]
623
636
fn example_cognito_event_userpools_pretokengen ( ) {
0 commit comments