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 / LicenseKeyGroupLimits.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.*;
13 import javax.ws.rs.core.MediaType;
14 import javax.ws.rs.core.Response;
15
16 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
17 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
18
19 @Path(
20     "/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/license-key-groups/{licenseKeyGroupId}/limits")
21 @Produces(MediaType.APPLICATION_JSON)
22 @Consumes(MediaType.APPLICATION_JSON)
23 @Api(value = "Vendor License Model - License Key Group Limits")
24 @Validated
25 public interface LicenseKeyGroupLimits {
26
27   @POST
28   @Path("/")
29   @ApiOperation(value = "Create vendor license key group limit")
30   Response createLimit(@Valid LimitRequestDto request,
31                        @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
32                            String vlmId,
33                        @ApiParam(value = "Vendor license model version Id") @PathParam
34                            ("versionId")
35                            String versionId,
36                        @ApiParam(value = "Vendor license model License Key Group Id")
37                        @PathParam("licenseKeyGroupId")
38                            String licenseKeyGroupId,
39                        @NotNull(message = USER_MISSING_ERROR_MSG)
40                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
41
42   @GET
43   @Path("/")
44   @ApiOperation(value = "List vendor license key group limits",
45       response = LimitEntityDto.class,
46       responseContainer = "List")
47   Response listLimits(
48       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
49       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
50       @ApiParam(value = "Vendor license model License Key Group Id") @PathParam("licenseKeyGroupId")
51           String licenseKeyGroupId,
52       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
53
54   @PUT
55   @Path("/{limitId}")
56   @ApiOperation(value = "Update vendor license key group limit")
57   Response updateLimit(@Valid LimitRequestDto request,
58                        @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
59                            String vlmId,
60                        @ApiParam(value = "Vendor license model version Id") @PathParam
61                            ("versionId")
62                            String versionId,
63                        @ApiParam(value = "Vendor license model License Key Group Id")
64                        @PathParam("licenseKeyGroupId")
65                            String licenseKeyGroupId,
66                        @NotNull(message = USER_MISSING_ERROR_MSG)
67                        @PathParam("limitId") String limitId,
68                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
69
70   @GET
71   @Path("/{limitId}")
72   @ApiOperation(value = "Get vendor entitlement pool limit",
73       response = LimitEntityDto.class)
74   Response getLimit(
75       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
76       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
77       @ApiParam(value = "Vendor license model License Key Group") @PathParam
78           ("licenseKeyGroupId") String entitlementPoolId,
79       @ApiParam(value = "Vendor license model License Key Group Limit Id") @PathParam("limitId")
80           String limitId,
81       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
82
83   @DELETE
84   @Path("/{limitId}")
85   @ApiOperation(value = "Delete vendor license key group limit")
86   Response deleteLimit(
87       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
88       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
89       @ApiParam(value = "Vendor license model license key group Id") @PathParam("licenseKeyGroupId")
90           String licenseKeyGroupId,
91       @PathParam("limitId") String limitId,
92       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
93 }