use of software.amazon.awssdk.services.xml.model.XmlRequest in project aws-sdk-java-v2 by aws.
the class DefaultXmlAsyncClient method applySignerOverride.
private <T extends XmlRequest> T applySignerOverride(T request, Signer signer) {
if (request.overrideConfiguration().flatMap(c -> c.signer()).isPresent()) {
return request;
}
Consumer<AwsRequestOverrideConfiguration.Builder> signerOverride = b -> b.signer(signer).build();
AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration().map(c -> c.toBuilder().applyMutation(signerOverride).build()).orElse((AwsRequestOverrideConfiguration.builder().applyMutation(signerOverride).build()));
return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
Aggregations