use of com.thinkbiganalytics.feedmgr.rest.beanvalidation.NewFeedCategory in project kylo by Teradata.
the class FeedCategoryRestController method saveCategory.
@POST
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation("Creates or updates a category.")
@ApiResponses({ @ApiResponse(code = 200, message = "The category was saved successfully.", response = FeedCategory.class), @ApiResponse(code = 400, message = "The category name is invalid.", response = RestResponseStatus.class), @ApiResponse(code = 500, message = "The category could not be saved.", response = RestResponseStatus.class) })
public Response saveCategory(@NewFeedCategory FeedCategory feedCategory) {
getMetadataService().saveCategory(feedCategory);
// requery it to get the allowed actions
FeedCategory savedCategory = getMetadataService().getCategoryBySystemName(feedCategory.getSystemName());
return Response.ok(savedCategory).build();
}
Aggregations