[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 / LicenseKeyGroupLimits.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 import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto;
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.GET;
19 import javax.ws.rs.HeaderParam;
20 import javax.ws.rs.POST;
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}/license-key-groups" +
29     "/{licenseKeyGroupId}/limits")
30 @Produces(MediaType.APPLICATION_JSON)
31 @Consumes(MediaType.APPLICATION_JSON)
32 @Api(value = "Vendor License Model - License Key Group Limits")
33 @Validated
34 public interface LicenseKeyGroupLimits {
35
36   @POST
37   @Path("/")
38   @ApiOperation(value = "Create vendor license key group limit")
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 License Key Group Id")
46                        @PathParam("licenseKeyGroupId")
47                            String licenseKeyGroupId  ,
48                        @NotNull(message = USER_MISSING_ERROR_MSG)
49                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
50
51   @GET
52   @Path("/")
53   @ApiOperation(value = "List vendor license key group limits",
54       response = LimitEntityDto.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 License Key Group Id") @PathParam("licenseKeyGroupId")
60           String licenseKeyGroupId,
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 license key group 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 License Key Group Id")
73                        @PathParam("licenseKeyGroupId")
74                            String licenseKeyGroupId  ,
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 License Key Group") @PathParam
87           ("licenseKeyGroupId") String entitlementPoolId,
88       @ApiParam(value = "Vendor license model License Key Group 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 license key group 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 license key group Id") @PathParam("licenseKeyGroupId") String licenseKeyGroupId,
99             @PathParam("limitId") String limitId,
100             @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
101 }