[SDC-29] Amdocs OnBoard 1707 initial commit.
[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.Consumes;
33 import javax.ws.rs.DELETE;
34 import javax.ws.rs.GET;
35 import javax.ws.rs.HeaderParam;
36 import javax.ws.rs.POST;
37 import javax.ws.rs.PUT;
38 import javax.ws.rs.Path;
39 import javax.ws.rs.PathParam;
40 import javax.ws.rs.Produces;
41 import javax.ws.rs.core.MediaType;
42 import javax.ws.rs.core.Response;
43
44 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
45 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
46
47 @Path("/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/entitlement-pools")
48 @Produces(MediaType.APPLICATION_JSON)
49 @Consumes(MediaType.APPLICATION_JSON)
50 @Api(value = "Vendor License Model - Entitlement Pools")
51 @Validated
52 public interface EntitlementPools {
53   @GET
54   @Path("/")
55   @ApiOperation(value = "List vendor entitlement pools",
56       response = EntitlementPoolEntityDto.class,
57       responseContainer = "List")
58   Response listEntitlementPools(
59       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
60       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
61
62       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
63
64   @POST
65   @Path("/")
66   @ApiOperation(value = "Create vendor entitlement pool")
67   Response createEntitlementPool(@Valid EntitlementPoolRequestDto request,
68                                  @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
69                                      String vlmId,
70                                  @ApiParam(value = "Vendor license model version Id") @PathParam
71                                      ("versionId")
72                                      String versionId,
73                                  @NotNull(message = USER_MISSING_ERROR_MSG)
74                                  @HeaderParam(USER_ID_HEADER_PARAM) String user);
75
76   @PUT
77   @Path("/{entitlementPoolId}")
78   @ApiOperation(value = "Update vendor entitlement pool")
79   Response updateEntitlementPool(@Valid EntitlementPoolRequestDto request,
80                                  @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
81                                      String vlmId,
82                                  @ApiParam(value = "Vendor license model version Id")
83                                  @PathParam("versionId") String versionId,
84                                  @NotNull(message = USER_MISSING_ERROR_MSG)
85                                  @PathParam("entitlementPoolId") String entitlementPoolId,
86                                  @HeaderParam(USER_ID_HEADER_PARAM) String user);
87
88   @GET
89   @Path("/{entitlementPoolId}")
90   @ApiOperation(value = "Get vendor entitlement pool",
91       response = EntitlementPoolEntityDto.class)
92   Response getEntitlementPool(
93       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
94       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
95       @PathParam("entitlementPoolId") String entitlementPoolId,
96       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
97
98   @DELETE
99   @Path("/{entitlementPoolId}")
100   @ApiOperation(value = "Delete vendor entitlement pool")
101   Response deleteEntitlementPool(
102       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
103       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
104       @PathParam("entitlementPoolId") String entitlementPoolId,
105       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
106
107 }