Skip to content

Commit f3ad78a

Browse files
Merge pull request #840 from aws/staging/5d470e56-78d5-4af8-beab-fcef680ec0cf
Pull request: release <- staging/5d470e56-78d5-4af8-beab-fcef680ec0cf
2 parents 8212363 + 003e20a commit f3ad78a

File tree

312 files changed

+2045
-366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

312 files changed

+2045
-366
lines changed

.changes/2.13.17.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"version": "2.13.17",
3+
"date": "2020-05-14",
4+
"entries": [
5+
{
6+
"type": "bugfix",
7+
"category": "AWS SDK for Java v2",
8+
"description": "Support event streams that are shared between two operations."
9+
},
10+
{
11+
"type": "feature",
12+
"category": "Amazon RDS",
13+
"description": "Add SourceRegion to CopyDBClusterSnapshot and CreateDBCluster operations. As with CopyDBSnapshot and CreateDBInstanceReadReplica, specifying this field will automatically populate the PresignedURL field with a valid value."
14+
},
15+
{
16+
"type": "feature",
17+
"category": "AWS SDK for Java v2",
18+
"description": "Updated service endpoint metadata."
19+
},
20+
{
21+
"type": "feature",
22+
"category": "Amazon Elastic Compute Cloud",
23+
"description": "Amazon EC2 now supports adding AWS resource tags for associations between VPCs and local gateways, at creation time."
24+
},
25+
{
26+
"type": "bugfix",
27+
"category": "AWS SDK for Java v2",
28+
"description": "Fix generation for operations that share an output shape."
29+
},
30+
{
31+
"type": "feature",
32+
"category": "AWS SDK for Java v2",
33+
"description": "Expose the `extendedRequestId` from `SdkServiceException`, so it can be provided to support to investigate issues."
34+
},
35+
{
36+
"type": "bugfix",
37+
"category": "AWS SDK for Java v2",
38+
"description": "Fix unmarshalling of events when structure member name and shape name mismatch."
39+
},
40+
{
41+
"type": "feature",
42+
"category": "EC2 Image Builder",
43+
"description": "This release adds a new parameter (SupportedOsVersions) to the Components API. This parameter lists the OS versions supported by a component."
44+
}
45+
]
46+
}

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
# __2.13.17__ __2020-05-14__
2+
## __AWS SDK for Java v2__
3+
- ### Features
4+
- Expose the `extendedRequestId` from `SdkServiceException`, so it can be provided to support to investigate issues.
5+
- Updated service endpoint metadata.
6+
7+
- ### Bugfixes
8+
- Fix generation for operations that share an output shape.
9+
- Fix unmarshalling of events when structure member name and shape name mismatch.
10+
- Support event streams that are shared between two operations.
11+
12+
## __Amazon Elastic Compute Cloud__
13+
- ### Features
14+
- Amazon EC2 now supports adding AWS resource tags for associations between VPCs and local gateways, at creation time.
15+
16+
## __Amazon RDS__
17+
- ### Features
18+
- Add SourceRegion to CopyDBClusterSnapshot and CreateDBCluster operations. As with CopyDBSnapshot and CreateDBInstanceReadReplica, specifying this field will automatically populate the PresignedURL field with a valid value.
19+
20+
## __EC2 Image Builder__
21+
- ### Features
22+
- This release adds a new parameter (SupportedOsVersions) to the Components API. This parameter lists the OS versions supported by a component.
23+
124
# __2.13.16__ __2020-05-13__
225
## __AWS SDK for Java v2__
326
- ### Bugfixes

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To automatically manage module versions (currently all modules have the same ver
4949
<dependency>
5050
<groupId>software.amazon.awssdk</groupId>
5151
<artifactId>bom</artifactId>
52-
<version>2.13.16</version>
52+
<version>2.13.17</version>
5353
<type>pom</type>
5454
<scope>import</scope>
5555
</dependency>
@@ -83,12 +83,12 @@ Alternatively you can add dependencies for the specific services you use only:
8383
<dependency>
8484
<groupId>software.amazon.awssdk</groupId>
8585
<artifactId>ec2</artifactId>
86-
<version>2.13.16</version>
86+
<version>2.13.17</version>
8787
</dependency>
8888
<dependency>
8989
<groupId>software.amazon.awssdk</groupId>
9090
<artifactId>s3</artifactId>
91-
<version>2.13.16</version>
91+
<version>2.13.17</version>
9292
</dependency>
9393
```
9494

@@ -100,7 +100,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please
100100
<dependency>
101101
<groupId>software.amazon.awssdk</groupId>
102102
<artifactId>aws-sdk-java</artifactId>
103-
<version>2.13.16</version>
103+
<version>2.13.17</version>
104104
</dependency>
105105
```
106106

archetypes/archetype-lambda/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>archetypes</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.13.16</version>
23+
<version>2.13.17</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>archetype-lambda</artifactId>

archetypes/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>aws-sdk-java-pom</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.13.16</version>
23+
<version>2.13.17</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>archetypes</artifactId>

aws-sdk-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>software.amazon.awssdk</groupId>
1919
<artifactId>aws-sdk-java-pom</artifactId>
20-
<version>2.13.16</version>
20+
<version>2.13.17</version>
2121
<relativePath>../pom.xml</relativePath>
2222
</parent>
2323
<artifactId>aws-sdk-java</artifactId>

bom-internal/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<artifactId>aws-sdk-java-pom</artifactId>
2222
<groupId>software.amazon.awssdk</groupId>
23-
<version>2.13.16</version>
23+
<version>2.13.17</version>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626

bom/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>software.amazon.awssdk</groupId>
1919
<artifactId>aws-sdk-java-pom</artifactId>
20-
<version>2.13.16</version>
20+
<version>2.13.17</version>
2121
<relativePath>../pom.xml</relativePath>
2222
</parent>
2323
<artifactId>bom</artifactId>

bundle/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.13.16</version>
24+
<version>2.13.17</version>
2525
</parent>
2626
<artifactId>bundle</artifactId>
2727
<packaging>jar</packaging>

codegen-lite-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>aws-sdk-java-pom</artifactId>
25-
<version>2.13.16</version>
25+
<version>2.13.17</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-lite-maven-plugin</artifactId>

codegen-lite/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.13.16</version>
24+
<version>2.13.17</version>
2525
</parent>
2626
<artifactId>codegen-lite</artifactId>
2727
<name>AWS Java SDK :: Code Generator Lite</name>

codegen-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>aws-sdk-java-pom</artifactId>
25-
<version>2.13.16</version>
25+
<version>2.13.17</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-maven-plugin</artifactId>

codegen/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.13.16</version>
24+
<version>2.13.17</version>
2525
</parent>
2626
<artifactId>codegen</artifactId>
2727
<name>AWS Java SDK :: Code Generator</name>

codegen/src/main/java/software/amazon/awssdk/codegen/IntermediateModelBuilder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ private void linkOperationsToInputOutputShapes(IntermediateModel model) {
186186

187187
if (operation.getOutput() != null) {
188188
String outputShapeName = operation.getOutput().getShape();
189-
entry.getValue().setOutputShape(model.getShapeByC2jName(outputShapeName));
189+
ShapeModel outputShape =
190+
model.getShapeByNameAndC2jName(entry.getValue().getReturnType().getReturnType(), outputShapeName);
191+
entry.getValue().setOutputShape(outputShape);
190192
}
191193
}
192194
}

codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/IntermediateModel.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import java.util.stream.Collectors;
2828
import software.amazon.awssdk.awscore.AwsResponse;
2929
import software.amazon.awssdk.awscore.AwsResponseMetadata;
30-
import software.amazon.awssdk.codegen.internal.Utils;
3130
import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig;
3231
import software.amazon.awssdk.codegen.model.service.PaginatorDefinition;
3332
import software.amazon.awssdk.codegen.naming.NamingStrategy;
@@ -104,8 +103,21 @@ public Map<String, ShapeModel> getShapes() {
104103
return shapes;
105104
}
106105

107-
public ShapeModel getShapeByC2jName(String c2jName) {
108-
return Utils.findShapeModelByC2jName(this, c2jName);
106+
/**
107+
* Looks up a shape by name and verifies that the expected C2J name matches
108+
* @param shapeName the name of the shape in the intermediate model
109+
* @param shapeC2jName C2J's name for the shape
110+
* @return the ShapeModel
111+
* @throws IllegalArgumentException if no matching shape is found
112+
*/
113+
public ShapeModel getShapeByNameAndC2jName(String shapeName, String shapeC2jName) {
114+
for (ShapeModel sm : getShapes().values()) {
115+
if (shapeName.equals(sm.getShapeName()) && shapeC2jName.equals(sm.getC2jName())) {
116+
return sm;
117+
}
118+
}
119+
throw new IllegalArgumentException("C2J shape " + shapeC2jName + " with shape name " + shapeName + " does not exist in "
120+
+ "the intermediate model.");
109121
}
110122

111123
public CustomizationConfig getCustomizationConfig() {

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,9 @@ private void responseHandlersForEventStreaming(OperationModel opModel, TypeName
417417
protocolFactory,
418418
JsonOperationMetadata.class,
419419
ClassName.get(EventStreamTaggedUnionPojoSupplier.class));
420-
EventStreamUtils.getEvents(eventStream)
420+
EventStreamUtils.getEventMembers(eventStream)
421421
.forEach(m -> builder.add(".putSdkPojoSupplier(\"$L\", $T::builder)\n",
422-
m.getC2jName(), poetExtensions.getModelClass(m.getC2jName())));
422+
m.getC2jName(), poetExtensions.getModelClass(m.getShape().getC2jName())));
423423
builder.add(".defaultSdkPojoSupplier(() -> $T.UNKNOWN)\n"
424424
+ ".build());\n", eventStreamBaseClass);
425425
}

codegen/src/main/java/software/amazon/awssdk/codegen/poet/eventstream/EventStreamUtils.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
package software.amazon.awssdk.codegen.poet.eventstream;
1717

18+
import java.util.Collection;
1819
import java.util.Objects;
20+
import java.util.stream.Collectors;
1921
import java.util.stream.Stream;
2022
import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
2123
import software.amazon.awssdk.codegen.model.intermediate.MemberModel;
@@ -116,16 +118,21 @@ public static Stream<MemberModel> getEventMembers(ShapeModel eventStreamShape) {
116118
}
117119

118120
/**
119-
* Returns the first operation that contains the given event stream shape. The event stream can be in operation
121+
* Returns the all operations that contain the given event stream shape. The event stream can be in operation
120122
* request or response shape.
121123
*/
122-
public static OperationModel findOperationWithEventStream(IntermediateModel model, ShapeModel eventStreamShape) {
123-
return model.getOperations().values()
124+
public static Collection<OperationModel> findOperationsWithEventStream(IntermediateModel model, ShapeModel eventStreamShape) {
125+
Collection<OperationModel> operations = model.getOperations().values()
124126
.stream()
125127
.filter(op -> operationContainsEventStream(op, eventStreamShape))
126-
.findFirst()
127-
.orElseThrow(() -> new IllegalStateException(String.format(
128-
"%s is an event shape but has no corresponding operation in the model", eventStreamShape.getC2jName())));
128+
.collect(Collectors.toList());
129+
130+
if (operations.isEmpty()) {
131+
throw new IllegalStateException(String.format(
132+
"%s is an event shape but has no corresponding operation in the model", eventStreamShape.getC2jName()));
133+
}
134+
135+
return operations;
129136
}
130137

131138
/**

0 commit comments

Comments
 (0)