Skip to content

Commit

Permalink
Merge pull request #1160 from aws/staging/351dc4f8-12a0-44e1-9022-a83…
Browse files Browse the repository at this point in the history
…27eb7dcd5

Pull request: release <- staging/351dc4f8-12a0-44e1-9022-a8327eb7dcd5
  • Loading branch information
aws-sdk-java-automation authored Jan 21, 2021
2 parents ce0a740 + 85aba8e commit 9c7a948
Show file tree
Hide file tree
Showing 322 changed files with 1,156 additions and 443 deletions.
30 changes: 30 additions & 0 deletions .changes/2.15.68.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version": "2.15.68",
"date": "2021-01-21",
"entries": [
{
"type": "feature",
"category": "AWS Resource Groups Tagging API",
"contributor": "",
"description": "This release adds a new parameter ResourceARNList to Resource Groups Tagging api GetResources api to allow customers retrieve tag data for specific resources."
},
{
"type": "feature",
"category": "Managed Streaming for Kafka",
"contributor": "",
"description": "Amazon MSK has added a new API that allows you to update all the brokers in the cluster to the specified type."
},
{
"type": "bugfix",
"category": "AWS SDK for Java v2",
"contributor": "",
"description": "Add support for content-type in AsyncRequestBody."
},
{
"type": "feature",
"category": "AWS SecurityHub",
"contributor": "",
"description": "This release of ASFF adds a new Action object and a new resource details object - AwsSsmPatchCompliance. It also adds several new attributes for the AwsEc2NetworkInterface resource type."
}
]
}
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# __2.15.68__ __2021-01-21__
## __AWS Resource Groups Tagging API__
- ### Features
- This release adds a new parameter ResourceARNList to Resource Groups Tagging api GetResources api to allow customers retrieve tag data for specific resources.

## __AWS SDK for Java v2__
- ### Bugfixes
- Add support for content-type in AsyncRequestBody.

## __AWS SecurityHub__
- ### Features
- This release of ASFF adds a new Action object and a new resource details object - AwsSsmPatchCompliance. It also adds several new attributes for the AwsEc2NetworkInterface resource type.

## __Managed Streaming for Kafka__
- ### Features
- Amazon MSK has added a new API that allows you to update all the brokers in the cluster to the specified type.

# __2.15.67__ __2021-01-19__
## __AWS Certificate Manager Private Certificate Authority__
- ### Features
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ To automatically manage module versions (currently all modules have the same ver
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.15.67</version>
<version>2.15.68</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -83,12 +83,12 @@ Alternatively you can add dependencies for the specific services you use only:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>ec2</artifactId>
<version>2.15.67</version>
<version>2.15.68</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>2.15.67</version>
<version>2.15.68</version>
</dependency>
```

Expand All @@ -100,7 +100,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.15.67</version>
<version>2.15.68</version>
</dependency>
```

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.15.67</version>
<version>2.15.68</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetype-lambda</artifactId>
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.15.67</version>
<version>2.15.68</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.15.67</version>
<version>2.15.68</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.15.67</version>
<version>2.15.68</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.15.67</version>
<version>2.15.68</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.15.67</version>
<version>2.15.68</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.15.67</version>
<version>2.15.68</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.15.67</version>
<version>2.15.68</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.15.67</version>
<version>2.15.68</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.15.67</version>
<version>2.15.68</version>
</parent>
<artifactId>codegen</artifactId>
<name>AWS Java SDK :: Code Generator</name>
Expand Down
2 changes: 1 addition & 1 deletion core/annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>core</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.15.67</version>
<version>2.15.68</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion core/arns/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>core</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.15.67</version>
<version>2.15.68</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion core/auth/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>core</artifactId>
<version>2.15.67</version>
<version>2.15.68</version>
</parent>

<artifactId>auth</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ public void subscribe(Subscriber<? super ByteBuffer> s) {
public Optional<Long> contentLength() {
return transformedRequestBody.contentLength();
}

@Override
public String contentType() {
return transformedRequestBody.contentType();
}
}

static String toDebugString(Message m, boolean truncatePayload) {
Expand Down
2 changes: 1 addition & 1 deletion core/aws-core/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>core</artifactId>
<version>2.15.67</version>
<version>2.15.68</version>
</parent>

<artifactId>aws-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/metrics-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>core</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.15.67</version>
<version>2.15.68</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.15.67</version>
<version>2.15.68</version>
</parent>

<artifactId>core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/profiles/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>core</artifactId>
<version>2.15.67</version>
<version>2.15.68</version>
</parent>

<artifactId>profiles</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/protocols/aws-cbor-protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>protocols</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.15.67</version>
<version>2.15.68</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion core/protocols/aws-ion-protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>protocols</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.15.67</version>
<version>2.15.68</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion core/protocols/aws-json-protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>protocols</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.15.67</version>
<version>2.15.68</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion core/protocols/aws-query-protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>protocols</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.15.67</version>
<version>2.15.68</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion core/protocols/aws-xml-protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>protocols</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.15.67</version>
<version>2.15.68</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
package software.amazon.awssdk.protocols.xml.internal.unmarshall;

import static java.util.Collections.singletonList;
import static software.amazon.awssdk.protocols.xml.internal.unmarshall.XmlResponseParserUtils.getBlobTypePayloadMemberToUnmarshal;

import java.time.Instant;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
Expand Down Expand Up @@ -76,6 +79,7 @@ public <TypeT extends SdkPojo> TypeT unmarshall(SdkPojo sdkPojo,
}

SdkPojo unmarshall(XmlUnmarshallerContext context, SdkPojo sdkPojo, XmlElement root) {
Optional<SdkField<?>> payloadMemberAsBlobType = getBlobTypePayloadMemberToUnmarshal(sdkPojo);
for (SdkField<?> field : sdkPojo.sdkFields()) {
XmlUnmarshaller<Object> unmarshaller = REGISTRY.getUnmarshaller(field.location(), field.marshallingType());

Expand All @@ -94,8 +98,15 @@ SdkPojo unmarshall(XmlUnmarshallerContext context, SdkPojo sdkPojo, XmlElement r
root.getElementsByName(field.unmarshallLocationName());

if (!CollectionUtils.isNullOrEmpty(element)) {
Object unmarshalled = unmarshaller.unmarshall(context, element, (SdkField<Object>) field);
field.set(sdkPojo, unmarshalled);
boolean isFieldBlobTypePayload = payloadMemberAsBlobType.isPresent()
&& payloadMemberAsBlobType.get().equals(field);

if (isFieldBlobTypePayload) {
field.set(sdkPojo, SdkBytes.fromInputStream(context.response().content().get()));
} else {
Object unmarshalled = unmarshaller.unmarshall(context, element, (SdkField<Object>) field);
field.set(sdkPojo, unmarshalled);
}
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@

import java.util.Optional;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.PayloadTrait;
import software.amazon.awssdk.http.AbortableInputStream;
import software.amazon.awssdk.http.SdkHttpFullResponse;
import software.amazon.awssdk.protocols.query.unmarshall.XmlDomParser;
Expand Down Expand Up @@ -49,7 +52,7 @@ public static XmlElement parse(SdkPojo sdkPojo, SdkHttpFullResponse response) {
// In some cases the responseContent is present but empty, so when we are not expecting a body we should
// not attempt to parse it even if the body appears to be present.
if ((!response.isSuccessful() || hasPayloadMembers(sdkPojo)) && responseContent.isPresent() &&
!contentLengthZero(response)) {
!contentLengthZero(response) && !getBlobTypePayloadMemberToUnmarshal(sdkPojo).isPresent()) {
return XmlDomParser.parse(responseContent.get());
} else {
return XmlElement.empty();
Expand All @@ -63,6 +66,21 @@ public static XmlElement parse(SdkPojo sdkPojo, SdkHttpFullResponse response) {
}
}

/**
* Gets the Member which is a Payload and which is of Blob Type.
* @param sdkPojo
* @return Optional of SdkField member if member is Blob type payload else returns Empty.
*/
public static Optional<SdkField<?>> getBlobTypePayloadMemberToUnmarshal(SdkPojo sdkPojo) {
return sdkPojo.sdkFields().stream()
.filter(e -> isExplicitPayloadMember(e))
.filter(f -> f.marshallingType() == MarshallingType.SDK_BYTES).findFirst();
}

private static boolean isExplicitPayloadMember(SdkField<?> f) {
return f.containsTrait(PayloadTrait.class);
}

private static boolean hasPayloadMembers(SdkPojo sdkPojo) {
return sdkPojo.sdkFields().stream()
.anyMatch(f -> f.location() == MarshallLocation.PAYLOAD);
Expand All @@ -71,4 +89,6 @@ private static boolean hasPayloadMembers(SdkPojo sdkPojo) {
private static boolean contentLengthZero(SdkHttpFullResponse response) {
return response.firstMatchingHeader(CONTENT_LENGTH).map(l -> Long.parseLong(l) == 0).orElse(false);
}


}
2 changes: 1 addition & 1 deletion core/protocols/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>core</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.15.67</version>
<version>2.15.68</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Loading

0 comments on commit 9c7a948

Please sign in to comment.