de63c4efdcf7dedd5c29e39ee8c409967e176b73
[sdc.git] /
1 /*
2  * Copyright © 2018 European Support Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.openecomp.sdcrests.item.rest;
17
18 import io.swagger.annotations.Api;
19 import io.swagger.annotations.ApiOperation;
20 import org.openecomp.sdcrests.item.types.ItemActionRequestDto;
21 import org.springframework.validation.annotation.Validated;
22
23 import javax.validation.constraints.NotNull;
24 import javax.ws.rs.*;
25 import javax.ws.rs.core.MediaType;
26 import javax.ws.rs.core.Response;
27
28 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
29 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
30
31 @Path("/v1.0/items")
32 @Produces(MediaType.APPLICATION_JSON)
33 @Consumes(MediaType.APPLICATION_JSON)
34 @Api(value = "Items")
35 @Validated
36 public interface Items {
37
38    @GET
39    @Path("/{itemId}")
40    @ApiOperation(value = "Get details of a item")
41    Response getItem(@PathParam("itemId") String itemId,
42                      @NotNull(message = USER_MISSING_ERROR_MSG)
43                      @HeaderParam(USER_ID_HEADER_PARAM) String user);
44
45   @PUT
46   @Path("/{itemId}/actions")
47   @ApiOperation(value = "Acts on item version")
48   Response actOn(ItemActionRequestDto request,
49                  @PathParam("itemId") String itemId,
50                  @NotNull(message = USER_MISSING_ERROR_MSG)
51                  @HeaderParam(USER_ID_HEADER_PARAM) String user);
52
53
54
55 }