Add collaboration feature
[sdc.git] / openecomp-be / api / openecomp-sdc-rest-webapp / vendor-license-rest / vendor-license-rest-services / src / main / java / org / openecomp / sdcrests / vendorlicense / rest / EntitlementPoolLimits.java
1 package org.openecomp.sdcrests.vendorlicense.rest;
2
3 import io.swagger.annotations.Api;
4 import io.swagger.annotations.ApiOperation;
5 import io.swagger.annotations.ApiParam;
6 import org.openecomp.sdcrests.vendorlicense.types.LimitEntityDto;
7 import org.openecomp.sdcrests.vendorlicense.types.LimitRequestDto;
8 import org.springframework.validation.annotation.Validated;
9
10 import javax.validation.Valid;
11 import javax.validation.constraints.NotNull;
12 import javax.ws.rs.Consumes;
13 import javax.ws.rs.DELETE;
14 import javax.ws.rs.GET;
15 import javax.ws.rs.HeaderParam;
16 import javax.ws.rs.POST;
17 import javax.ws.rs.PUT;
18 import javax.ws.rs.Path;
19 import javax.ws.rs.PathParam;
20 import javax.ws.rs.Produces;
21 import javax.ws.rs.core.MediaType;
22 import javax.ws.rs.core.Response;
23
24 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
25 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
26
27 @Path(
28     "/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/entitlement-pools/{entitlementPoolId}/limits")
29 @Produces(MediaType.APPLICATION_JSON)
30 @Consumes(MediaType.APPLICATION_JSON)
31 @Api(value = "Vendor License Model - Entitlement Pool Limits")
32 @Validated
33 public interface EntitlementPoolLimits {
34
35   @POST
36   @Path("/")
37   @ApiOperation(value = "Create vendor entitlement pool limits")
38   Response createLimit(@Valid LimitRequestDto request,
39                        @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
40                            String vlmId,
41                        @ApiParam(value = "Vendor license model version Id") @PathParam
42                            ("versionId")
43                            String versionId,
44                        @ApiParam(value = "Vendor license model Entitlement Pool Id")
45                        @PathParam("entitlementPoolId")
46                            String entitlementPoolId,
47                        @NotNull(message = USER_MISSING_ERROR_MSG)
48                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
49
50
51   @GET
52   @Path("/")
53   @ApiOperation(value = "List vendor entitlement pool limits",
54       response = LimitRequestDto.class,
55       responseContainer = "List")
56   Response listLimits(
57       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
58       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
59       @ApiParam(value = "Vendor license model Entitlement Pool Id") @PathParam("entitlementPoolId")
60           String entitlementPoolId,
61       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
62
63   @PUT
64   @Path("/{limitId}")
65   @ApiOperation(value = "Update vendor entitlement pool limit")
66   Response updateLimit(@Valid LimitRequestDto request,
67                        @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
68                            String vlmId,
69                        @ApiParam(value = "Vendor license model version Id") @PathParam
70                            ("versionId")
71                            String versionId,
72                        @ApiParam(value = "Vendor license model Entitlement Pool Id")
73                        @PathParam("entitlementPoolId")
74                            String entitlementPoolId,
75                        @NotNull(message = USER_MISSING_ERROR_MSG)
76                        @PathParam("limitId") String limitId,
77                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
78
79   @GET
80   @Path("/{limitId}")
81   @ApiOperation(value = "Get vendor entitlement pool limit",
82       response = LimitEntityDto.class)
83   Response getLimit(
84       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
85       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
86       @ApiParam(value = "Vendor license model Entitlement Pool Id") @PathParam
87           ("entitlementPoolId") String entitlementPoolId,
88       @ApiParam(value = "Vendor license model Entitlement Pool Limit Id") @PathParam("limitId")
89           String limitId,
90       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
91
92   @DELETE
93   @Path("/{limitId}")
94   @ApiOperation(value = "Delete vendor entitlement pool limit")
95   Response deleteLimit(
96       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
97       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
98       @ApiParam(value = "Vendor license model Entitlement pool Id") @PathParam("entitlementPoolId")
99           String entitlementPoolId,
100       @PathParam("limitId") String limitId,
101       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
102
103 }