use of software.amazon.awssdk.http.SdkHttpFullResponse in project aws-sdk-java-v2 by aws.
the class QueryProtocolUnmarshaller method unmarshall.
public <TypeT extends SdkPojo> Pair<TypeT, Map<String, String>> unmarshall(SdkPojo sdkPojo, SdkHttpFullResponse response) {
if (responsePayloadIsBlob(sdkPojo)) {
XmlElement document = XmlElement.builder().textContent(response.content().map(s -> invokeSafely(() -> IoUtils.toUtf8String(s))).orElse("")).build();
return Pair.of(unmarshall(sdkPojo, document, response), new HashMap<>());
}
XmlElement document = response.content().map(XmlDomParser::parse).orElseGet(XmlElement::empty);
XmlElement resultRoot = hasResultWrapper ? document.getFirstChild() : document;
return Pair.of(unmarshall(sdkPojo, resultRoot, response), parseMetadata(document));
}
Aggregations