extractor.setResponseMetadata(responseMetadata);
extractor.setClientResult(clientResult);
}
ResponseModel responseModel = action.getResponse();
Object data = null;
List<ResourceImpl> resources = null;
Object nextToken = null;
if (responseModel != null) {
if (responseModel.getDataMapping() != null) {
data = getResultAttributes(
responseModel.getDataMapping().getSource(),
clientResult);
} else if (responseModel.getResourceMapping() != null) {
resources = getResultResources(
context,
responseModel.getResourceMapping(),
request,
clientResult);
} else {
data = clientResult;
}
if (responseModel.getNextTokenPath() != null) {
nextToken = ReflectionUtils.getByPath(
clientResult, responseModel.getNextTokenPath());
}
}
return new ActionResult(data, resources, nextToken);