Search in sources :

Example 1 with NewFeedCategory

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();
}
Also used : FeedCategory(com.thinkbiganalytics.feedmgr.rest.model.FeedCategory) NewFeedCategory(com.thinkbiganalytics.feedmgr.rest.beanvalidation.NewFeedCategory) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

NewFeedCategory (com.thinkbiganalytics.feedmgr.rest.beanvalidation.NewFeedCategory)1 FeedCategory (com.thinkbiganalytics.feedmgr.rest.model.FeedCategory)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 Consumes (javax.ws.rs.Consumes)1 POST (javax.ws.rs.POST)1 Produces (javax.ws.rs.Produces)1