Skip to content

Commit

Permalink
Merge pull request #1586 from aws/staging/8d00501b-0523-4e5f-b2b4-9c9…
Browse files Browse the repository at this point in the history
…cfd44c44d

Pull request: release <- staging/8d00501b-0523-4e5f-b2b4-9c9cfd44c44d
  • Loading branch information
aws-sdk-java-automation authored Aug 4, 2021
2 parents e3fb1f4 + cbad007 commit d663e4a
Show file tree
Hide file tree
Showing 379 changed files with 2,809 additions and 1,676 deletions.
54 changes: 54 additions & 0 deletions .changes/2.17.12.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"version": "2.17.12",
"date": "2021-08-04",
"entries": [
{
"type": "feature",
"category": "EC2 Image Builder",
"contributor": "",
"description": "Updated list actions to include a list of valid filters that can be used in the request."
},
{
"type": "feature",
"category": "AWS SDK for Java v2",
"contributor": "",
"description": "Updated service endpoint metadata."
},
{
"type": "feature",
"category": "Amazon Transcribe Service",
"contributor": "",
"description": "This release adds support for call analytics (batch) within Amazon Transcribe."
},
{
"type": "feature",
"category": "AWS SDK for Java v2",
"contributor": "",
"description": "Add customization.config support for setting default RetryMode"
},
{
"type": "feature",
"category": "Amazon EventBridge",
"contributor": "",
"description": "Documentation updates to add EC2 Image Builder as a target on PutTargets."
},
{
"type": "feature",
"category": "AWS Systems Manager Incident Manager",
"contributor": "",
"description": "Documentation updates for Incident Manager."
},
{
"type": "feature",
"category": "Amazon Relational Database Service",
"contributor": "",
"description": "This release adds AutomaticRestartTime to the DescribeDBInstances and DescribeDBClusters operations. AutomaticRestartTime indicates the time when a stopped DB instance or DB cluster is restarted automatically."
},
{
"type": "bugfix",
"category": "AWS SDK for Java v2",
"contributor": "",
"description": "Fixed an issue where a bean-based marshallers for request and response models would fail for fluent setters that happened to start with \"set\", like \"settings\"."
}
]
}
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# __2.17.12__ __2021-08-04__
## __AWS SDK for Java v2__
- ### Features
- Add customization.config support for setting default RetryMode
- Updated service endpoint metadata.

- ### Bugfixes
- Fixed an issue where a bean-based marshallers for request and response models would fail for fluent setters that happened to start with "set", like "settings".

## __AWS Systems Manager Incident Manager__
- ### Features
- Documentation updates for Incident Manager.

## __Amazon EventBridge__
- ### Features
- Documentation updates to add EC2 Image Builder as a target on PutTargets.

## __Amazon Relational Database Service__
- ### Features
- This release adds AutomaticRestartTime to the DescribeDBInstances and DescribeDBClusters operations. AutomaticRestartTime indicates the time when a stopped DB instance or DB cluster is restarted automatically.

## __Amazon Transcribe Service__
- ### Features
- This release adds support for call analytics (batch) within Amazon Transcribe.

## __EC2 Image Builder__
- ### Features
- Updated list actions to include a list of valid filters that can be used in the request.

# __2.17.11__ __2021-08-03__
## __AWS Elemental MediaConvert__
- ### Features
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ To automatically manage module versions (currently all modules have the same ver
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.17.11</version>
<version>2.17.12</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -86,12 +86,12 @@ Alternatively you can add dependencies for the specific services you use only:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>ec2</artifactId>
<version>2.17.11</version>
<version>2.17.12</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>2.17.11</version>
<version>2.17.12</version>
</dependency>
```

Expand All @@ -103,7 +103,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java</artifactId>
<version>2.17.11</version>
<version>2.17.12</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion archetypes/archetype-app-quickstart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.17.11</version>
<version>2.17.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion archetypes/archetype-lambda/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.17.11</version>
<version>2.17.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetype-lambda</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion archetypes/archetype-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.17.11</version>
<version>2.17.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion archetypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.17.11</version>
<version>2.17.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetypes</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-sdk-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.11</version>
<version>2.17.12</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>aws-sdk-java</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom-internal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.17.11</version>
<version>2.17.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.11</version>
<version>2.17.12</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>bom</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.11</version>
<version>2.17.12</version>
</parent>
<artifactId>bundle</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion codegen-lite-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.11</version>
<version>2.17.12</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-lite-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion codegen-lite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.11</version>
<version>2.17.12</version>
</parent>
<artifactId>codegen-lite</artifactId>
<name>AWS Java SDK :: Code Generator Lite</name>
Expand Down
2 changes: 1 addition & 1 deletion codegen-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.11</version>
<version>2.17.12</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.17.11</version>
<version>2.17.12</version>
</parent>
<artifactId>codegen</artifactId>
<name>AWS Java SDK :: Code Generator</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.core.retry.RetryMode;
import software.amazon.awssdk.core.traits.PayloadTrait;
import software.amazon.awssdk.utils.AttributeMap;

/**
* {@code service-2.json} models can be manually modified via defining properties in an associated {@code customization.config}
* file. This class defines the Java bean representation that will be used to parse the JSON customization file. The bean can
* then be later queried in the misc. codegen steps.
*/
public class CustomizationConfig {

/**
Expand Down Expand Up @@ -188,6 +194,8 @@ public class CustomizationConfig {
private UnderscoresInNameBehavior underscoresInNameBehavior;

private String userAgent;

private RetryMode defaultRetryMode;

private CustomizationConfig() {
}
Expand Down Expand Up @@ -485,4 +493,12 @@ public CustomizationConfig withUserAgent(String userAgent) {
this.userAgent = userAgent;
return this;
}

public RetryMode getDefaultRetryMode() {
return defaultRetryMode;
}

public void setDefaultRetryMode(RetryMode defaultRetryMode) {
this.defaultRetryMode = defaultRetryMode;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.squareup.javapoet.TypeVariableName;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import javax.lang.model.element.Modifier;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.auth.signer.Aws4Signer;
Expand All @@ -45,6 +46,7 @@
import software.amazon.awssdk.core.endpointdiscovery.providers.DefaultEndpointDiscoveryProviderChain;
import software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
import software.amazon.awssdk.core.retry.RetryMode;
import software.amazon.awssdk.core.signer.Signer;
import software.amazon.awssdk.http.Protocol;
import software.amazon.awssdk.http.SdkHttpConfigurationOption;
Expand Down Expand Up @@ -92,9 +94,7 @@ public TypeSpec poetSpec() {
builder.addMethod(serviceNameMethod());
builder.addMethod(mergeServiceDefaultsMethod());

if (model.getCustomizationConfig().getUserAgent() != null) {
builder.addMethod(mergeInternalDefaultsMethod());
}
mergeInternalDefaultsMethod().ifPresent(builder::addMethod);

builder.addMethod(finalizeServiceConfigurationMethod());
builder.addMethod(defaultSignerMethod());
Expand Down Expand Up @@ -175,19 +175,31 @@ private MethodSpec mergeServiceDefaultsMethod() {
return builder.build();
}

private MethodSpec mergeInternalDefaultsMethod() {
private Optional<MethodSpec> mergeInternalDefaultsMethod() {
String userAgent = model.getCustomizationConfig().getUserAgent();
RetryMode defaultRetryMode = model.getCustomizationConfig().getDefaultRetryMode();

// If none of the options are customized, then we do not need to bother overriding the method
if (userAgent == null && defaultRetryMode == null) {
return Optional.empty();
}

MethodSpec.Builder builder = MethodSpec.methodBuilder("mergeInternalDefaults")
.addAnnotation(Override.class)
.addModifiers(PROTECTED, FINAL)
.returns(SdkClientConfiguration.class)
.addParameter(SdkClientConfiguration.class, "config")
.addCode("return config.merge(c -> c.option($T.INTERNAL_USER_AGENT, $S)\n",
SdkClientOption.class, userAgent);

builder.addCode(");");
return builder.build();
.addCode("return config.merge(c -> {\n");
if (userAgent != null) {
builder.addCode("c.option($T.INTERNAL_USER_AGENT, $S);\n",
SdkClientOption.class, userAgent);
}
if (defaultRetryMode != null) {
builder.addCode("c.option($T.DEFAULT_RETRY_MODE, $T.$L);\n",
SdkClientOption.class, RetryMode.class, defaultRetryMode.name());
}
builder.addCode("});\n");
return Optional.of(builder.build());
}

private MethodSpec finalizeServiceConfigurationMethod() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterSpec;
import com.squareup.javapoet.TypeName;
import java.beans.Transient;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.lang.model.element.Modifier;
Expand Down Expand Up @@ -84,6 +85,7 @@ protected MethodSpec.Builder fluentSetterBuilder(String methodName, ParameterSpe
return MethodSpec.methodBuilder(methodName)
.addParameter(setterParam)
.addAnnotation(Override.class)
.addAnnotation(Transient.class)
.returns(returnType)
.addModifiers(Modifier.PUBLIC, Modifier.FINAL);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ private List<MethodSpec> accessors() {
shapeModel.getNonStreamingMembers()
.forEach(m -> {
accessors.add(checkDeprecated(m, accessorsFactory.beanStyleGetter(m)));
accessors.addAll(checkDeprecated(m, accessorsFactory.fluentSetters(m, builderInterfaceName())));
accessors.addAll(checkDeprecated(m, accessorsFactory.beanStyleSetters(m)));
accessors.addAll(checkDeprecated(m, accessorsFactory.fluentSetters(m, builderInterfaceName())));
accessors.addAll(checkDeprecated(m, accessorsFactory.convenienceSetters(m, builderInterfaceName())));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void baseClientBuilderClass() throws Exception {

@Test
public void baseClientBuilderClassWithInternalUserAgent() throws Exception {
assertThat(new BaseClientBuilderClass(ClientTestModels.internalConfigModels()), generatesTo("test-client-builder-internal-user-agent-class.java"));
assertThat(new BaseClientBuilderClass(ClientTestModels.internalConfigModels()), generatesTo("test-client-builder-internal-defaults-class.java"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
import software.amazon.awssdk.core.retry.RetryMode;
import software.amazon.awssdk.core.signer.Signer;
import software.amazon.awssdk.utils.CollectionUtils;

Expand Down Expand Up @@ -37,7 +38,10 @@ protected final SdkClientConfiguration mergeServiceDefaults(SdkClientConfigurati

@Override
protected final SdkClientConfiguration mergeInternalDefaults(SdkClientConfiguration config) {
return config.merge(c -> c.option(SdkClientOption.INTERNAL_USER_AGENT, "md/foobar"));
return config.merge(c -> {
c.option(SdkClientOption.INTERNAL_USER_AGENT, "md/foobar");
c.option(SdkClientOption.DEFAULT_RETRY_MODE, RetryMode.STANDARD);
});
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"authPolicyActions" : {
"skip" : true
},
"userAgent": "md/foobar"
"userAgent": "md/foobar",
"defaultRetryMode": "STANDARD"
}
Loading

0 comments on commit d663e4a

Please sign in to comment.