re base code
[sdc.git] / openecomp-be / api / openecomp-sdc-rest-webapp / vendor-license-rest / vendor-license-rest-services / src / main / java / org / openecomp / sdcrests / vendorlicense / rest / EntitlementPools.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdcrests.vendorlicense.rest;
22
23 import io.swagger.annotations.Api;
24 import io.swagger.annotations.ApiOperation;
25 import io.swagger.annotations.ApiParam;
26 import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto;
27 import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto;
28 import org.springframework.validation.annotation.Validated;
29
30 import javax.validation.Valid;
31 import javax.validation.constraints.NotNull;
32 import javax.ws.rs.*;
33 import javax.ws.rs.core.MediaType;
34 import javax.ws.rs.core.Response;
35
36 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
37 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
38
39 @Path("/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/entitlement-pools")
40 @Produces(MediaType.APPLICATION_JSON)
41 @Consumes(MediaType.APPLICATION_JSON)
42 @Api(value = "Vendor License Model - Entitlement Pools")
43 @Validated
44 public interface EntitlementPools {
45   @GET
46   @Path("/")
47   @ApiOperation(value = "List vendor entitlement pools",
48       response = EntitlementPoolEntityDto.class,
49       responseContainer = "List")
50   Response listEntitlementPools(
51       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
52       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
53
54       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
55
56   @POST
57   @Path("/")
58   @ApiOperation(value = "Create vendor entitlement pool")
59   Response createEntitlementPool(@Valid EntitlementPoolRequestDto request,
60                                  @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
61                                      String vlmId,
62                                  @ApiParam(value = "Vendor license model version Id") @PathParam
63                                      ("versionId")
64                                      String versionId,
65                                  @NotNull(message = USER_MISSING_ERROR_MSG)
66                                  @HeaderParam(USER_ID_HEADER_PARAM) String user);
67
68   @PUT
69   @Path("/{entitlementPoolId}")
70   @ApiOperation(value = "Update vendor entitlement pool")
71   Response updateEntitlementPool(@Valid EntitlementPoolRequestDto request,
72                                  @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
73                                      String vlmId,
74                                  @ApiParam(value = "Vendor license model version Id")
75                                  @PathParam("versionId") String versionId,
76                                  @NotNull(message = USER_MISSING_ERROR_MSG)
77                                  @PathParam("entitlementPoolId") String entitlementPoolId,
78                                  @HeaderParam(USER_ID_HEADER_PARAM) String user);
79
80   @GET
81   @Path("/{entitlementPoolId}")
82   @ApiOperation(value = "Get vendor entitlement pool",
83       response = EntitlementPoolEntityDto.class)
84   Response getEntitlementPool(
85       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
86       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
87       @PathParam("entitlementPoolId") String entitlementPoolId,
88       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
89
90   @DELETE
91   @Path("/{entitlementPoolId}")
92   @ApiOperation(value = "Delete vendor entitlement pool")
93   Response deleteEntitlementPool(
94       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
95       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
96       @PathParam("entitlementPoolId") String entitlementPoolId,
97       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
98
99 }