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 / 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.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}/license-key-groups/{licenseKeyGroupId}/limits")
29 @Produces(MediaType.APPLICATION_JSON)
30 @Consumes(MediaType.APPLICATION_JSON)
31 @Api(value = "Vendor License Model - License Key Group Limits")
32 @Validated
33 public interface LicenseKeyGroupLimits {
34
35   @POST
36   @Path("/")
37   @ApiOperation(value = "Create vendor license key group limit")
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 License Key Group Id")
45                        @PathParam("licenseKeyGroupId")
46                            String licenseKeyGroupId,
47                        @NotNull(message = USER_MISSING_ERROR_MSG)
48                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
49
50   @GET
51   @Path("/")
52   @ApiOperation(value = "List vendor license key group limits",
53       response = LimitEntityDto.class,
54       responseContainer = "List")
55   Response listLimits(
56       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
57       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
58       @ApiParam(value = "Vendor license model License Key Group Id") @PathParam("licenseKeyGroupId")
59           String licenseKeyGroupId,
60       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
61
62   @PUT
63   @Path("/{limitId}")
64   @ApiOperation(value = "Update vendor license key group limit")
65   Response updateLimit(@Valid LimitRequestDto request,
66                        @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
67                            String vlmId,
68                        @ApiParam(value = "Vendor license model version Id") @PathParam
69                            ("versionId")
70                            String versionId,
71                        @ApiParam(value = "Vendor license model License Key Group Id")
72                        @PathParam("licenseKeyGroupId")
73                            String licenseKeyGroupId,
74                        @NotNull(message = USER_MISSING_ERROR_MSG)
75                        @PathParam("limitId") String limitId,
76                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
77
78   @GET
79   @Path("/{limitId}")
80   @ApiOperation(value = "Get vendor entitlement pool limit",
81       response = LimitEntityDto.class)
82   Response getLimit(
83       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
84       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
85       @ApiParam(value = "Vendor license model License Key Group") @PathParam
86           ("licenseKeyGroupId") String entitlementPoolId,
87       @ApiParam(value = "Vendor license model License Key Group Limit Id") @PathParam("limitId")
88           String limitId,
89       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
90
91   @DELETE
92   @Path("/{limitId}")
93   @ApiOperation(value = "Delete vendor license key group limit")
94   Response deleteLimit(
95       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
96       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
97       @ApiParam(value = "Vendor license model license key group Id") @PathParam("licenseKeyGroupId")
98           String licenseKeyGroupId,
99       @PathParam("limitId") String limitId,
100       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
101 }