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