public static Map<String, Object> convertToMap(Object o) throws IOException {
		//convert to json so the method calls do not have to be
		ObjectMapper objectMapper = new ObjectMapper();
		String jsonResult = objectMapper.writer().writeValueAsString(o);
		return objectMapper.readValue(jsonResult, new TypeReference<Map<String, Object>>() {
		});
	}
Jenkins doesn't support returning the API response directly.
Converting it into a map/list construct allows the full API response to be returned to be used in the jenkinsfile.
src/main/java/de/taimos/pipeline/aws/AwsSdkResponseToJson.java