Skip to content

Commit

Permalink
Merge pull request #1275 from aws/staging/f0a13f45-b8c1-4b9e-8e46-502…
Browse files Browse the repository at this point in the history
…aff5fbd4a

Pull request: release <- staging/f0a13f45-b8c1-4b9e-8e46-502aff5fbd4a
  • Loading branch information
aws-sdk-java-automation authored Apr 15, 2021
2 parents cb78c49 + 9876a7c commit 9b78ecf
Show file tree
Hide file tree
Showing 333 changed files with 1,924 additions and 1,373 deletions.
30 changes: 30 additions & 0 deletions .changes/2.16.43.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version": "2.16.43",
"date": "2021-04-15",
"entries": [
{
"type": "feature",
"category": "AWS SDK for Java v2",
"contributor": "",
"description": "Updated service endpoint metadata."
},
{
"type": "bugfix",
"category": "Amazon DynamoDB",
"contributor": "",
"description": "Fixed an issue where structure builders containing List<Map<String, Shape>> could not be marshalled using bean-based serializers."
},
{
"type": "feature",
"category": "AWS Database Migration Service",
"contributor": "",
"description": "AWS DMS added support of TLS for Kafka endpoint. Added Describe endpoint setting API for DMS endpoints."
},
{
"type": "feature",
"category": "AWS Security Token Service",
"contributor": "",
"description": "STS now supports assume role with Web Identity using JWT token length upto 20000 characters"
}
]
}
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# __2.16.43__ __2021-04-15__
## __AWS Database Migration Service__
- ### Features
- AWS DMS added support of TLS for Kafka endpoint. Added Describe endpoint setting API for DMS endpoints.

## __AWS SDK for Java v2__
- ### Features
- Updated service endpoint metadata.

## __AWS Security Token Service__
- ### Features
- STS now supports assume role with Web Identity using JWT token length upto 20000 characters

## __Amazon DynamoDB__
- ### Bugfixes
- Fixed an issue where structure builders containing List<Map<String, Shape>> could not be marshalled using bean-based serializers.

# __2.16.42__ __2021-04-14__
## __AWS CodeStar connections__
- ### 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.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>2.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</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.16.42</version>
<version>2.16.43</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 @@ -620,6 +620,12 @@ public boolean isCollectionWithBuilderMember() {
(isMap() && getMapModel().getValueModel() != null && getMapModel().getValueModel().hasBuilder());
}

@JsonIgnore
public boolean isCollectionWithNestedBuilderMember() {
return isList() && getListModel().getListMemberModel() != null && getListModel().isMap() &&
getListModel().getListMemberModel().getMapModel().getValueModel().hasBuilder();
}

@JsonIgnore
public boolean isSdkBytesType() {
return SdkBytes.class.getName().equals(variable.getVariableType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.stream.Collectors;
import javax.lang.model.element.Modifier;
import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
import software.amazon.awssdk.codegen.model.intermediate.MapModel;
import software.amazon.awssdk.codegen.model.intermediate.MemberModel;
import software.amazon.awssdk.codegen.model.intermediate.ShapeModel;
import software.amazon.awssdk.codegen.poet.PoetExtensions;
Expand Down Expand Up @@ -124,7 +125,7 @@ protected CodeBlock copySetterBuilderBody() {
"this.$1N = $1N != null ? $1N.build() : null",
serviceModelCopiers.copyMethodName());
}
if (memberModel.isCollectionWithBuilderMember()) {
if (memberModel.isCollectionWithBuilderMember() || memberModel.isCollectionWithNestedBuilderMember()) {
return copySetterBody("this.$1N = $2T.$3N($1N)", null, serviceModelCopiers.builderCopyMethodName());
}
return copySetterBody();
Expand Down Expand Up @@ -175,6 +176,19 @@ protected ParameterSpec memberAsBeanStyleParameter() {
}

if (memberModel.isList()) {
if (memberModel.isCollectionWithNestedBuilderMember()) {
MapModel nestedMapModel = memberModel.getListModel().getListMemberModel().getMapModel();
TypeName nestedMapKeyType = typeProvider.getTypeNameForSimpleType(nestedMapModel.getKeyModel()
.getVariable()
.getVariableType());
ClassName nestedMapValueType = poetExtensions.getModelClass(nestedMapModel.getValueModel().getC2jShape());
TypeName nestedMapReturnType = ParameterizedTypeName.get(ClassName.get(Map.class),
nestedMapKeyType,
nestedMapValueType.nestedClass("BuilderImpl"));
TypeName listType = ParameterizedTypeName.get(ClassName.get(Collection.class), nestedMapReturnType);
return ParameterSpec.builder(listType, fieldName()).build();
}

MemberModel listMember = memberModel.getListModel().getListMemberModel();

if (hasBuilder(listMember)) {
Expand Down Expand Up @@ -249,4 +263,5 @@ private CodeBlock copySetterBody(String copyAssignment, String regularAssignment
private boolean hasBuilder(MemberModel model) {
return model != null && model.hasBuilder();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Map;
import java.util.stream.Collectors;
import javax.lang.model.element.Modifier;
import software.amazon.awssdk.codegen.model.intermediate.MapModel;
import software.amazon.awssdk.codegen.model.intermediate.MemberModel;
import software.amazon.awssdk.codegen.poet.PoetExtensions;
import software.amazon.awssdk.codegen.poet.PoetUtils;
Expand All @@ -48,6 +49,9 @@ public MethodSpec beanStyleGetter(MemberModel memberModel) {
if (memberModel.isCollectionWithBuilderMember()) {
return memberModel.isList() ? listOfBuildersGetter(memberModel) : mapOfBuildersGetter(memberModel);
}
if (memberModel.isCollectionWithNestedBuilderMember()) {
return listOfMapOfBuilderGetter(memberModel);
}
if (memberModel.isSdkBytesType()) {
return byteBufferGetter(memberModel);
}
Expand Down Expand Up @@ -96,6 +100,28 @@ private MethodSpec builderGetter(MemberModel memberModel) {
memberModel.getVariable().getVariableName()));
}

private MethodSpec listOfMapOfBuilderGetter(MemberModel memberModel) {
MapModel nestedMapModel = memberModel.getListModel().getListMemberModel().getMapModel();
TypeName nestedMapKeyType = typeProvider.getTypeNameForSimpleType(nestedMapModel.getKeyModel()
.getVariable().getVariableType());
ClassName nestedMapValueType = poetExtensions.getModelClass(nestedMapModel.getValueModel().getC2jShape());
TypeName nestedMapReturnType = ParameterizedTypeName.get(ClassName.get(Map.class),
nestedMapKeyType,
nestedMapValueType.nestedClass("Builder"));

TypeName returnType = ParameterizedTypeName.get(ClassName.get(Collection.class), nestedMapReturnType);

CodeBlock mapReturnStatement =
CodeBlock.of("Collectors.toMap(entry -> entry.getKey(), entry -> entry.getValue().toBuilder())");

CodeBlock returnStatement = CodeBlock.of("return $1N != null ? $1N.stream().map(m -> m.entrySet().stream().collect("
+ mapReturnStatement + ")).collect($2T.toList()) : null;",
memberModel.getVariable().getVariableName(),
Collectors.class);

return basicGetter(memberModel, returnType, returnStatement);
}

private MethodSpec mapOfBuildersGetter(MemberModel memberModel) {
TypeName keyType = typeProvider.getTypeNameForSimpleType(memberModel.getMapModel().getKeyModel()
.getVariable().getVariableType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@ public List<MethodSpec> fluent(TypeName returnType) {

@Override
public List<MethodSpec> beanStyle() {
MethodSpec.Builder builder = beanStyleSetterBuilder()
.addCode(memberModel().isCollectionWithBuilderMember() ? copySetterBuilderBody() : beanCopySetterBody());
MethodSpec.Builder builder = beanStyleSetterBuilder();
if (memberModel().isCollectionWithBuilderMember()) {
builder.addCode(copySetterBuilderBody());
} else {
builder.addCode(beanCopySetterBody());
}

return Collections.singletonList(builder.build());

Expand Down
Loading

0 comments on commit 9b78ecf

Please sign in to comment.