Added oparent to sdc main
[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 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdcrests.vendorlicense.rest;
22
23 import io.swagger.annotations.Api;
24 import io.swagger.annotations.ApiOperation;
25 import io.swagger.annotations.ApiParam;
26 import org.openecomp.sdcrests.vendorlicense.types.LimitEntityDto;
27 import org.openecomp.sdcrests.vendorlicense.types.LimitRequestDto;
28 import org.springframework.validation.annotation.Validated;
29
30 import javax.validation.Valid;
31 import javax.validation.constraints.NotNull;
32 import javax.ws.rs.*;
33 import javax.ws.rs.core.MediaType;
34 import javax.ws.rs.core.Response;
35
36 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
37 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
38
39 @Path(
40     "/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/license-key-groups/{licenseKeyGroupId}/limits")
41 @Produces(MediaType.APPLICATION_JSON)
42 @Consumes(MediaType.APPLICATION_JSON)
43 @Api(value = "Vendor License Model - License Key Group Limits")
44 @Validated
45 public interface LicenseKeyGroupLimits {
46
47   @POST
48   @Path("/")
49   @ApiOperation(value = "Create vendor license key group limit")
50   Response createLimit(@Valid LimitRequestDto request,
51                        @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
52                            String vlmId,
53                        @ApiParam(value = "Vendor license model version Id") @PathParam
54                            ("versionId")
55                            String versionId,
56                        @ApiParam(value = "Vendor license model License Key Group Id")
57                        @PathParam("licenseKeyGroupId")
58                            String licenseKeyGroupId,
59                        @NotNull(message = USER_MISSING_ERROR_MSG)
60                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
61
62   @GET
63   @Path("/")
64   @ApiOperation(value = "List vendor license key group limits",
65       response = LimitEntityDto.class,
66       responseContainer = "List")
67   Response listLimits(
68       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
69       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
70       @ApiParam(value = "Vendor license model License Key Group Id") @PathParam("licenseKeyGroupId")
71           String licenseKeyGroupId,
72       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
73
74   @PUT
75   @Path("/{limitId}")
76   @ApiOperation(value = "Update vendor license key group limit")
77   Response updateLimit(@Valid LimitRequestDto request,
78                        @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
79                            String vlmId,
80                        @ApiParam(value = "Vendor license model version Id") @PathParam
81                            ("versionId")
82                            String versionId,
83                        @ApiParam(value = "Vendor license model License Key Group Id")
84                        @PathParam("licenseKeyGroupId")
85                            String licenseKeyGroupId,
86                        @NotNull(message = USER_MISSING_ERROR_MSG)
87                        @PathParam("limitId") String limitId,
88                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
89
90   @GET
91   @Path("/{limitId}")
92   @ApiOperation(value = "Get vendor entitlement pool limit",
93       response = LimitEntityDto.class)
94   Response getLimit(
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") @PathParam
98           ("licenseKeyGroupId") String entitlementPoolId,
99       @ApiParam(value = "Vendor license model License Key Group Limit Id") @PathParam("limitId")
100           String limitId,
101       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
102
103   @DELETE
104   @Path("/{limitId}")
105   @ApiOperation(value = "Delete vendor license key group limit")
106   Response deleteLimit(
107       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
108       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
109       @ApiParam(value = "Vendor license model license key group Id") @PathParam("licenseKeyGroupId")
110           String licenseKeyGroupId,
111       @PathParam("limitId") String limitId,
112       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
113 }