Skip to content

Commit b15ec77

Browse files
Merge pull request #533 from aws/staging/2874de37-8ada-42e8-a09a-66037bb49ee3
Pull request: release <- staging/2874de37-8ada-42e8-a09a-66037bb49ee3
2 parents 3b5cc48 + 66ab358 commit b15ec77

File tree

233 files changed

+548
-263
lines changed

Some content is hidden

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

233 files changed

+548
-263
lines changed

.changes/2.5.62.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": "2.5.62",
3+
"date": "2019-06-12",
4+
"entries": [
5+
{
6+
"type": "bugfix",
7+
"category": "AWS SDK for Java v2",
8+
"description": "Fix a bug in the code generator causing event headers to be incorrectly marshalled and unmarshalled to and from the payload."
9+
},
10+
{
11+
"type": "feature",
12+
"category": "AWS Service Catalog",
13+
"description": "This release adds a new field named Guidance to update provisioning artifact, this field can be set by the administrator to provide guidance to end users about which provisioning artifacts to use."
14+
}
15+
]
16+
}

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# __2.5.62__ __2019-06-12__
2+
## __AWS SDK for Java v2__
3+
- ### Bugfixes
4+
- Fix a bug in the code generator causing event headers to be incorrectly marshalled and unmarshalled to and from the payload.
5+
6+
## __AWS Service Catalog__
7+
- ### Features
8+
- This release adds a new field named Guidance to update provisioning artifact, this field can be set by the administrator to provide guidance to end users about which provisioning artifacts to use.
9+
110
# __2.5.61__ __2019-06-11__
211
## __Amazon SageMaker Service__
312
- ### Features

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ You can import the whole SDK into your project (includes all services) as follow
4646
<dependency>
4747
<groupId>software.amazon.awssdk</groupId>
4848
<artifactId>aws-sdk-java</artifactId>
49-
<version>2.5.61</version>
49+
<version>2.5.62</version>
5050
</dependency>
5151
```
5252

@@ -58,12 +58,12 @@ Alternatively you can add dependencies for the specific services you use only:
5858
<dependency>
5959
<groupId>software.amazon.awssdk</groupId>
6060
<artifactId>ec2</artifactId>
61-
<version>2.5.61</version>
61+
<version>2.5.62</version>
6262
</dependency>
6363
<dependency>
6464
<groupId>software.amazon.awssdk</groupId>
6565
<artifactId>s3</artifactId>
66-
<version>2.5.61</version>
66+
<version>2.5.62</version>
6767
</dependency>
6868
```
6969

@@ -77,7 +77,7 @@ To automatically manage module versions (currently all modules have the same ver
7777
<dependency>
7878
<groupId>software.amazon.awssdk</groupId>
7979
<artifactId>bom</artifactId>
80-
<version>2.5.61</version>
80+
<version>2.5.62</version>
8181
<type>pom</type>
8282
<scope>import</scope>
8383
</dependency>

aws-sdk-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>software.amazon.awssdk</groupId>
66
<artifactId>aws-sdk-java-pom</artifactId>
7-
<version>2.5.61</version>
7+
<version>2.5.62</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010
<artifactId>aws-sdk-java</artifactId>

bom-internal/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>aws-sdk-java-pom</artifactId>
77
<groupId>software.amazon.awssdk</groupId>
8-
<version>2.5.61</version>
8+
<version>2.5.62</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

bom/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>software.amazon.awssdk</groupId>
66
<artifactId>aws-sdk-java-pom</artifactId>
7-
<version>2.5.61</version>
7+
<version>2.5.62</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010
<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.5.61</version>
24+
<version>2.5.62</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
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>software.amazon.awssdk</groupId>
99
<artifactId>aws-sdk-java-pom</artifactId>
10-
<version>2.5.61</version>
10+
<version>2.5.62</version>
1111
<relativePath>../pom.xml</relativePath>
1212
</parent>
1313
<artifactId>codegen-lite-maven-plugin</artifactId>

codegen-lite/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>software.amazon.awssdk</groupId>
88
<artifactId>aws-sdk-java-pom</artifactId>
9-
<version>2.5.61</version>
9+
<version>2.5.62</version>
1010
</parent>
1111
<artifactId>codegen-lite</artifactId>
1212
<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.5.61</version>
25+
<version>2.5.62</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.5.61</version>
24+
<version>2.5.62</version>
2525
</parent>
2626
<artifactId>codegen</artifactId>
2727
<name>AWS Java SDK :: Code Generator</name>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ private class VisitorFromBuilderImplSpec extends EventStreamVisitorInterfaceSpec
7979
@Override
8080
protected TypeSpec.Builder createTypeSpec() {
8181
return PoetUtils.createClassBuilder(className())
82+
.addModifiers(Modifier.STATIC)
8283
.addField(consumerType(eventStreamBaseClass), "onDefault", Modifier.PRIVATE, Modifier.FINAL)
8384
.addSuperinterface(visitorType);
8485
}

codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ShapeModelSpec.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,18 +195,31 @@ private CodeBlock createTimestampFormatTrait(MemberModel m) {
195195
}
196196

197197
private CodeBlock createLocationTrait(MemberModel m) {
198+
MarshallLocation marshallLocation = marshallLocation(m);
198199
String unmarshallLocation = unmarshallLocation(m);
200+
199201
return CodeBlock.builder()
200202
// TODO will marshall and unmarshall location name ever differ?
201203
.add("$T.builder()\n"
202204
+ ".location($T.$L)\n"
203205
+ ".locationName($S)\n"
204206
+ unmarshallLocation
205207
+ ".build()", ClassName.get(LocationTrait.class), ClassName.get(MarshallLocation.class),
206-
m.getHttp().getMarshallLocation(), m.getHttp().getMarshallLocationName())
208+
marshallLocation, m.getHttp().getMarshallLocationName())
207209
.build();
208210
}
209211

212+
private MarshallLocation marshallLocation(MemberModel m) {
213+
// Handle events explicitly
214+
if (m.isEventHeader()) {
215+
return MarshallLocation.HEADER;
216+
}
217+
if (m.isEventPayload()) {
218+
return MarshallLocation.PAYLOAD;
219+
}
220+
return m.getHttp().getMarshallLocation();
221+
}
222+
210223
// Rest xml uses unmarshall locationName to properly unmarshall flattened lists
211224
private String unmarshallLocation(MemberModel m) {
212225
return model.getMetadata().getProtocol() == Protocol.EC2 ||

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/eventstream/test-visitor-builder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public EventStreamOperationResponseHandler.Visitor.Builder onEventTwo(Consumer<E
3737
}
3838

3939
@Generated("software.amazon.awssdk:codegen")
40-
class VisitorFromBuilder implements EventStreamOperationResponseHandler.Visitor {
40+
static class VisitorFromBuilder implements EventStreamOperationResponseHandler.Visitor {
4141
private final Consumer<EventStream> onDefault;
4242

4343
private final Consumer<EventOne> onEventOne;

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/inputeventtwo.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,24 @@
2525
*/
2626
@Generated("software.amazon.awssdk:codegen")
2727
public final class InputEventTwo implements SdkPojo, Serializable, ToCopyableBuilder<InputEventTwo.Builder, InputEventTwo>,
28-
InputEventStreamTwo {
28+
InputEventStreamTwo {
2929
private static final SdkField<SdkBytes> IMPLICIT_PAYLOAD_MEMBER_ONE_FIELD = SdkField
30-
.<SdkBytes> builder(MarshallingType.SDK_BYTES).getter(getter(InputEventTwo::implicitPayloadMemberOne))
31-
.setter(setter(Builder::implicitPayloadMemberOne))
32-
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImplicitPayloadMemberOne").build())
33-
.build();
30+
.<SdkBytes> builder(MarshallingType.SDK_BYTES).getter(getter(InputEventTwo::implicitPayloadMemberOne))
31+
.setter(setter(Builder::implicitPayloadMemberOne))
32+
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImplicitPayloadMemberOne").build())
33+
.build();
3434

3535
private static final SdkField<String> IMPLICIT_PAYLOAD_MEMBER_TWO_FIELD = SdkField.<String> builder(MarshallingType.STRING)
36-
.getter(getter(InputEventTwo::implicitPayloadMemberTwo)).setter(setter(Builder::implicitPayloadMemberTwo))
37-
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImplicitPayloadMemberTwo").build())
38-
.build();
36+
.getter(getter(InputEventTwo::implicitPayloadMemberTwo)).setter(setter(Builder::implicitPayloadMemberTwo))
37+
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImplicitPayloadMemberTwo").build())
38+
.build();
3939

4040
private static final SdkField<String> EVENT_HEADER_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
41-
.getter(getter(InputEventTwo::eventHeaderMember)).setter(setter(Builder::eventHeaderMember))
42-
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EventHeaderMember").build()).build();
41+
.getter(getter(InputEventTwo::eventHeaderMember)).setter(setter(Builder::eventHeaderMember))
42+
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("EventHeaderMember").build()).build();
4343

4444
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
45-
IMPLICIT_PAYLOAD_MEMBER_ONE_FIELD, IMPLICIT_PAYLOAD_MEMBER_TWO_FIELD, EVENT_HEADER_MEMBER_FIELD));
45+
IMPLICIT_PAYLOAD_MEMBER_ONE_FIELD, IMPLICIT_PAYLOAD_MEMBER_TWO_FIELD, EVENT_HEADER_MEMBER_FIELD));
4646

4747
private static final long serialVersionUID = 1L;
4848

@@ -60,7 +60,7 @@ private InputEventTwo(BuilderImpl builder) {
6060

6161
/**
6262
* Returns the value of the ImplicitPayloadMemberOne property for this object.
63-
*
63+
*
6464
* @return The value of the ImplicitPayloadMemberOne property for this object.
6565
*/
6666
public SdkBytes implicitPayloadMemberOne() {
@@ -69,7 +69,7 @@ public SdkBytes implicitPayloadMemberOne() {
6969

7070
/**
7171
* Returns the value of the ImplicitPayloadMemberTwo property for this object.
72-
*
72+
*
7373
* @return The value of the ImplicitPayloadMemberTwo property for this object.
7474
*/
7575
public String implicitPayloadMemberTwo() {
@@ -78,7 +78,7 @@ public String implicitPayloadMemberTwo() {
7878

7979
/**
8080
* Returns the value of the EventHeaderMember property for this object.
81-
*
81+
*
8282
* @return The value of the EventHeaderMember property for this object.
8383
*/
8484
public String eventHeaderMember() {
@@ -120,8 +120,8 @@ public boolean equals(Object obj) {
120120
}
121121
InputEventTwo other = (InputEventTwo) obj;
122122
return Objects.equals(implicitPayloadMemberOne(), other.implicitPayloadMemberOne())
123-
&& Objects.equals(implicitPayloadMemberTwo(), other.implicitPayloadMemberTwo())
124-
&& Objects.equals(eventHeaderMember(), other.eventHeaderMember());
123+
&& Objects.equals(implicitPayloadMemberTwo(), other.implicitPayloadMemberTwo())
124+
&& Objects.equals(eventHeaderMember(), other.eventHeaderMember());
125125
}
126126

127127
/**
@@ -131,20 +131,20 @@ public boolean equals(Object obj) {
131131
@Override
132132
public String toString() {
133133
return ToString.builder("InputEventTwo").add("ImplicitPayloadMemberOne", implicitPayloadMemberOne())
134-
.add("ImplicitPayloadMemberTwo", implicitPayloadMemberTwo()).add("EventHeaderMember", eventHeaderMember())
135-
.build();
134+
.add("ImplicitPayloadMemberTwo", implicitPayloadMemberTwo()).add("EventHeaderMember", eventHeaderMember())
135+
.build();
136136
}
137137

138138
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
139139
switch (fieldName) {
140-
case "ImplicitPayloadMemberOne":
141-
return Optional.ofNullable(clazz.cast(implicitPayloadMemberOne()));
142-
case "ImplicitPayloadMemberTwo":
143-
return Optional.ofNullable(clazz.cast(implicitPayloadMemberTwo()));
144-
case "EventHeaderMember":
145-
return Optional.ofNullable(clazz.cast(eventHeaderMember()));
146-
default:
147-
return Optional.empty();
140+
case "ImplicitPayloadMemberOne":
141+
return Optional.ofNullable(clazz.cast(implicitPayloadMemberOne()));
142+
case "ImplicitPayloadMemberTwo":
143+
return Optional.ofNullable(clazz.cast(implicitPayloadMemberTwo()));
144+
case "EventHeaderMember":
145+
return Optional.ofNullable(clazz.cast(eventHeaderMember()));
146+
default:
147+
return Optional.empty();
148148
}
149149
}
150150

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package software.amazon.awssdk.services.jsonprotocoltests.transform;
2+
3+
import software.amazon.awssdk.annotations.Generated;
4+
import software.amazon.awssdk.annotations.SdkInternalApi;
5+
import software.amazon.awssdk.core.exception.SdkClientException;
6+
import software.amazon.awssdk.core.runtime.transform.Marshaller;
7+
import software.amazon.awssdk.http.SdkHttpFullRequest;
8+
import software.amazon.awssdk.http.SdkHttpMethod;
9+
import software.amazon.awssdk.protocols.core.OperationInfo;
10+
import software.amazon.awssdk.protocols.core.ProtocolMarshaller;
11+
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
12+
import software.amazon.awssdk.services.jsonprotocoltests.model.EventThree;
13+
import software.amazon.awssdk.utils.Validate;
14+
15+
/**
16+
* {@link EventThree} Marshaller
17+
*/
18+
@Generated("software.amazon.awssdk:codegen")
19+
@SdkInternalApi
20+
public class EventThreeMarshaller implements Marshaller<EventThree> {
21+
private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().hasExplicitPayloadMember(false)
22+
.hasPayloadMembers(true).httpMethod(SdkHttpMethod.GET).build();
23+
24+
private final BaseAwsJsonProtocolFactory protocolFactory;
25+
26+
public EventThreeMarshaller(BaseAwsJsonProtocolFactory protocolFactory) {
27+
this.protocolFactory = protocolFactory;
28+
}
29+
30+
@Override
31+
public SdkHttpFullRequest marshall(EventThree eventThree) {
32+
Validate.paramNotNull(eventThree, "eventThree");
33+
try {
34+
ProtocolMarshaller<SdkHttpFullRequest> protocolMarshaller = protocolFactory
35+
.createProtocolMarshaller(SDK_OPERATION_BINDING);
36+
return protocolMarshaller.marshall(eventThree).toBuilder().putHeader(":message-type", "event")
37+
.putHeader(":event-type", "EventThree").putHeader(":content-type", "application/json").build();
38+
} catch (Exception e) {
39+
throw SdkClientException.builder().message("Unable to marshall request to JSON: " + e.getMessage()).cause(e).build();
40+
}
41+
}
42+
}
43+

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/transform/service-2.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@
339339
},
340340
"EventTwo": {
341341
"shape": "EventTwo"
342+
},
343+
"EventThree": {
344+
"shape": "EventThree"
342345
}
343346
},
344347
"eventstream": true
@@ -361,6 +364,19 @@
361364
},
362365
"event": true
363366
},
367+
"EventThree": {
368+
"type": "structure",
369+
"members": {
370+
"Foo": {
371+
"shape": "String",
372+
"eventheader": true
373+
},
374+
"Bar": {
375+
"shape": "String"
376+
}
377+
},
378+
"event": true
379+
},
364380
"EventStreamOperationWithOnlyInputRequest": {
365381
"type": "structure",
366382
"required": [

core/annotations/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>core</artifactId>
77
<groupId>software.amazon.awssdk</groupId>
8-
<version>2.5.61</version>
8+
<version>2.5.62</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

core/auth/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>software.amazon.awssdk</groupId>
99
<artifactId>core</artifactId>
10-
<version>2.5.61</version>
10+
<version>2.5.62</version>
1111
</parent>
1212

1313
<artifactId>auth</artifactId>

core/aws-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>software.amazon.awssdk</groupId>
99
<artifactId>core</artifactId>
10-
<version>2.5.61</version>
10+
<version>2.5.62</version>
1111
</parent>
1212

1313
<artifactId>aws-core</artifactId>

0 commit comments

Comments
 (0)