@@ -447,6 +447,69 @@ async fn cognito_create_describe_user_pool_client() {
447447 assert_eq ! ( described. user_pool_id( ) . unwrap( ) , pool_id) ;
448448}
449449
450+ #[ tokio:: test]
451+ async fn cognito_user_pool_client_analytics_configuration_round_trips ( ) {
452+ use aws_sdk_cognitoidentityprovider:: types:: AnalyticsConfigurationType ;
453+ let server = TestServer :: start ( ) . await ;
454+ let client = server. cognito_client ( ) . await ;
455+
456+ let pool_id = client
457+ . create_user_pool ( )
458+ . pool_name ( "analytics-pool" )
459+ . send ( )
460+ . await
461+ . expect ( "create user pool" )
462+ . user_pool ( )
463+ . unwrap ( )
464+ . id ( )
465+ . unwrap ( )
466+ . to_string ( ) ;
467+
468+ let analytics = AnalyticsConfigurationType :: builder ( )
469+ . application_id ( "app-1234567890abcdef" )
470+ . role_arn ( "arn:aws:iam::123456789012:role/pinpoint-role" )
471+ . external_id ( "ext-42" )
472+ . user_data_shared ( true )
473+ . build ( ) ;
474+
475+ let created = client
476+ . create_user_pool_client ( )
477+ . user_pool_id ( & pool_id)
478+ . client_name ( "analytics-client" )
479+ . analytics_configuration ( analytics)
480+ . send ( )
481+ . await
482+ . expect ( "create client with analytics" ) ;
483+ let client_id = created
484+ . user_pool_client ( )
485+ . unwrap ( )
486+ . client_id ( )
487+ . unwrap ( )
488+ . to_string ( ) ;
489+ let created_ac = created
490+ . user_pool_client ( )
491+ . unwrap ( )
492+ . analytics_configuration ( )
493+ . expect ( "analytics config echoed on create" ) ;
494+ assert_eq ! ( created_ac. application_id( ) , Some ( "app-1234567890abcdef" ) ) ;
495+
496+ // Persisted: describe reflects it, not the default.
497+ let described = client
498+ . describe_user_pool_client ( )
499+ . user_pool_id ( & pool_id)
500+ . client_id ( & client_id)
501+ . send ( )
502+ . await
503+ . expect ( "describe client" ) ;
504+ let ac = described
505+ . user_pool_client ( )
506+ . unwrap ( )
507+ . analytics_configuration ( )
508+ . expect ( "analytics config persisted" ) ;
509+ assert_eq ! ( ac. external_id( ) , Some ( "ext-42" ) ) ;
510+ assert ! ( ac. user_data_shared( ) ) ;
511+ }
512+
450513#[ tokio:: test]
451514async fn cognito_create_client_with_secret ( ) {
452515 let server = TestServer :: start ( ) . await ;
0 commit comments