bd31dc56078ab7099082667a274d26dcf9409dcb
[sdc.git] /
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.LimitEntityDto;
10 import org.openecomp.sdcrests.vendorlicense.types.LimitRequestDto;
11 import org.springframework.validation.annotation.Validated;
12
13 import javax.validation.Valid;
14 import javax.validation.constraints.NotNull;
15 import javax.ws.rs.Consumes;
16 import javax.ws.rs.DELETE;
17 import javax.ws.rs.GET;
18 import javax.ws.rs.HeaderParam;
19 import javax.ws.rs.POST;
20 import javax.ws.rs.PUT;
21 import javax.ws.rs.Path;
22 import javax.ws.rs.PathParam;
23 import javax.ws.rs.Produces;
24 import javax.ws.rs.core.MediaType;
25 import javax.ws.rs.core.Response;
26
27 @Path("/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/license-key-groups" +
28     "/{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") String licenseKeyGroupId,
98             @PathParam("limitId") String limitId,
99             @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
100 }