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 / EntitlementPoolLimits.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}/entitlement-pools/{entitlementPoolId}/limits")
21 @Produces(MediaType.APPLICATION_JSON)
22 @Consumes(MediaType.APPLICATION_JSON)
23 @Api(value = "Vendor License Model - Entitlement Pool Limits")
24 @Validated
25 public interface EntitlementPoolLimits {
26
27   @POST
28   @Path("/")
29   @ApiOperation(value = "Create vendor entitlement pool limits")
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 Entitlement Pool Id")
37                        @PathParam("entitlementPoolId")
38                            String entitlementPoolId,
39                        @NotNull(message = USER_MISSING_ERROR_MSG)
40                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
41
42
43   @GET
44   @Path("/")
45   @ApiOperation(value = "List vendor entitlement pool limits",
46       response = LimitRequestDto.class,
47       responseContainer = "List")
48   Response listLimits(
49       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
50       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
51       @ApiParam(value = "Vendor license model Entitlement Pool Id") @PathParam("entitlementPoolId")
52           String entitlementPoolId,
53       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
54
55   @PUT
56   @Path("/{limitId}")
57   @ApiOperation(value = "Update vendor entitlement pool limit")
58   Response updateLimit(@Valid LimitRequestDto request,
59                        @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
60                            String vlmId,
61                        @ApiParam(value = "Vendor license model version Id") @PathParam
62                            ("versionId")
63                            String versionId,
64                        @ApiParam(value = "Vendor license model Entitlement Pool Id")
65                        @PathParam("entitlementPoolId")
66                            String entitlementPoolId,
67                        @NotNull(message = USER_MISSING_ERROR_MSG)
68                        @PathParam("limitId") String limitId,
69                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
70
71   @GET
72   @Path("/{limitId}")
73   @ApiOperation(value = "Get vendor entitlement pool limit",
74       response = LimitEntityDto.class)
75   Response getLimit(
76       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
77       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
78       @ApiParam(value = "Vendor license model Entitlement Pool Id") @PathParam
79           ("entitlementPoolId") String entitlementPoolId,
80       @ApiParam(value = "Vendor license model Entitlement Pool Limit Id") @PathParam("limitId")
81           String limitId,
82       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
83
84   @DELETE
85   @Path("/{limitId}")
86   @ApiOperation(value = "Delete vendor entitlement pool limit")
87   Response deleteLimit(
88       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
89       @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
90       @ApiParam(value = "Vendor license model Entitlement pool Id") @PathParam("entitlementPoolId")
91           String entitlementPoolId,
92       @PathParam("limitId") String limitId,
93       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
94
95 }