2727import software .amazon .awssdk .identity .spi .IdentityProvider ;
2828import software .amazon .awssdk .identity .spi .IdentityProviders ;
2929import software .amazon .awssdk .identity .spi .TokenIdentity ;
30+ import software .amazon .awssdk .protocols .json .internal .unmarshall .SdkClientJsonProtocolAdvancedOption ;
3031import software .amazon .awssdk .regions .ServiceMetadataAdvancedOption ;
3132import software .amazon .awssdk .retries .api .RetryStrategy ;
3233import software .amazon .awssdk .services .json .auth .scheme .JsonAuthSchemeProvider ;
@@ -59,13 +60,13 @@ protected final String serviceName() {
5960 @ Override
6061 protected final SdkClientConfiguration mergeServiceDefaults (SdkClientConfiguration config ) {
6162 return config .merge (c -> c
62- .option (SdkClientOption .ENDPOINT_PROVIDER , defaultEndpointProvider ())
63- .option (SdkClientOption .AUTH_SCHEME_PROVIDER , defaultAuthSchemeProvider ())
64- .option (SdkClientOption .AUTH_SCHEMES , authSchemes ())
65- .option (SdkClientOption .CRC32_FROM_COMPRESSED_DATA_ENABLED , false )
66- .lazyOption (AwsClientOption .TOKEN_PROVIDER ,
63+ .option (SdkClientOption .ENDPOINT_PROVIDER , defaultEndpointProvider ())
64+ .option (SdkClientOption .AUTH_SCHEME_PROVIDER , defaultAuthSchemeProvider ())
65+ .option (SdkClientOption .AUTH_SCHEMES , authSchemes ())
66+ .option (SdkClientOption .CRC32_FROM_COMPRESSED_DATA_ENABLED , false )
67+ .lazyOption (AwsClientOption .TOKEN_PROVIDER ,
6768 p -> TokenUtils .toSdkTokenProvider (p .get (AwsClientOption .TOKEN_IDENTITY_PROVIDER )))
68- .option (AwsClientOption .TOKEN_IDENTITY_PROVIDER , defaultTokenProvider ()));
69+ .option (AwsClientOption .TOKEN_IDENTITY_PROVIDER , defaultTokenProvider ()));
6970 }
7071
7172 @ Override
@@ -76,7 +77,7 @@ protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientCon
7677 endpointInterceptors .add (new JsonRequestSetEndpointInterceptor ());
7778 ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory ();
7879 List <ExecutionInterceptor > interceptors = interceptorFactory
79- .getInterceptors ("software/amazon/awssdk/services/json/execution.interceptors" );
80+ .getInterceptors ("software/amazon/awssdk/services/json/execution.interceptors" );
8081 List <ExecutionInterceptor > additionalInterceptors = new ArrayList <>();
8182 interceptors = CollectionUtils .mergeLists (endpointInterceptors , interceptors );
8283 interceptors = CollectionUtils .mergeLists (interceptors , additionalInterceptors );
@@ -92,21 +93,22 @@ protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientCon
9293 });
9394 builder .option (SdkClientOption .EXECUTION_INTERCEPTORS , interceptors );
9495 builder .lazyOptionIfAbsent (
95- SdkClientOption .CLIENT_ENDPOINT_PROVIDER ,
96- c -> AwsClientEndpointProvider
97- .builder ()
98- .serviceEndpointOverrideEnvironmentVariable ("AWS_ENDPOINT_URL_JSON_SERVICE" )
99- .serviceEndpointOverrideSystemProperty ("aws.endpointUrlJson" )
100- .serviceProfileProperty ("json_service" )
101- .serviceEndpointPrefix (serviceEndpointPrefix ())
102- .defaultProtocol ("https" )
103- .region (c .get (AwsClientOption .AWS_REGION ))
104- .profileFile (c .get (SdkClientOption .PROFILE_FILE_SUPPLIER ))
105- .profileName (c .get (SdkClientOption .PROFILE_NAME ))
106- .putAdvancedOption (ServiceMetadataAdvancedOption .DEFAULT_S3_US_EAST_1_REGIONAL_ENDPOINT ,
107- c .get (ServiceMetadataAdvancedOption .DEFAULT_S3_US_EAST_1_REGIONAL_ENDPOINT ))
108- .dualstackEnabled (c .get (AwsClientOption .DUALSTACK_ENDPOINT_ENABLED ))
109- .fipsEnabled (c .get (AwsClientOption .FIPS_ENDPOINT_ENABLED )).build ());
96+ SdkClientOption .CLIENT_ENDPOINT_PROVIDER ,
97+ c -> AwsClientEndpointProvider
98+ .builder ()
99+ .serviceEndpointOverrideEnvironmentVariable ("AWS_ENDPOINT_URL_JSON_SERVICE" )
100+ .serviceEndpointOverrideSystemProperty ("aws.endpointUrlJson" )
101+ .serviceProfileProperty ("json_service" )
102+ .serviceEndpointPrefix (serviceEndpointPrefix ())
103+ .defaultProtocol ("https" )
104+ .region (c .get (AwsClientOption .AWS_REGION ))
105+ .profileFile (c .get (SdkClientOption .PROFILE_FILE_SUPPLIER ))
106+ .profileName (c .get (SdkClientOption .PROFILE_NAME ))
107+ .putAdvancedOption (ServiceMetadataAdvancedOption .DEFAULT_S3_US_EAST_1_REGIONAL_ENDPOINT ,
108+ c .get (ServiceMetadataAdvancedOption .DEFAULT_S3_US_EAST_1_REGIONAL_ENDPOINT ))
109+ .dualstackEnabled (c .get (AwsClientOption .DUALSTACK_ENDPOINT_ENABLED ))
110+ .fipsEnabled (c .get (AwsClientOption .FIPS_ENDPOINT_ENABLED )).build ());
111+ builder .option (SdkClientJsonProtocolAdvancedOption .ENABLE_FAST_UNMARSHALLER , true );
110112 return builder .build ();
111113 }
112114
@@ -194,6 +196,6 @@ private List<SdkPlugin> internalPlugins(SdkClientConfiguration config) {
194196
195197 protected static void validateClientOptions (SdkClientConfiguration c ) {
196198 Validate .notNull (c .option (AwsClientOption .TOKEN_IDENTITY_PROVIDER ),
197- "The 'tokenProvider' must be configured in the client builder." );
199+ "The 'tokenProvider' must be configured in the client builder." );
198200 }
199201}
0 commit comments