use of com.formkiq.lambda.apigateway.ApiResponseStatus.SC_OK in project formkiq-core by formkiq.
the class WebhooksTagsRequestHandler method get.
@Override
public ApiRequestHandlerResponse get(final LambdaLogger logger, final ApiGatewayRequestEvent event, final ApiAuthorizer authorizer, final AwsServiceCache awsServices) throws Exception {
String siteId = authorizer.getSiteId();
String id = getPathParameter(event, "webhookId");
PaginationResults<DynamicObject> list = awsServices.webhookService().findTags(siteId, id, null);
List<Map<String, Object>> tags = list.getResults().stream().map(m -> {
Map<String, Object> map = new HashMap<>();
map.put("insertedDate", m.getString("inserteddate"));
map.put("webhookId", id);
map.put("type", m.getString("type"));
map.put("userId", m.getString("userId"));
map.put("value", m.getString("tagValue"));
map.put("key", m.getString("tagKey"));
return map;
}).collect(Collectors.toList());
return new ApiRequestHandlerResponse(SC_OK, new ApiMapResponse(Map.of("tags", tags)));
}
Aggregations