2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdcrests.vendorlicense.rest;
23 import io.swagger.v3.oas.annotations.Operation;
24 import io.swagger.v3.oas.annotations.Parameter;
25 import io.swagger.v3.oas.annotations.info.Info;
26 import io.swagger.v3.oas.annotations.media.ArraySchema;
27 import io.swagger.v3.oas.annotations.media.Content;
28 import io.swagger.v3.oas.annotations.media.Schema;
29 import io.swagger.v3.oas.annotations.responses.ApiResponse;
30 import io.swagger.v3.oas.annotations.tags.Tag;
31 import io.swagger.v3.oas.annotations.tags.Tags;
32 import org.openecomp.sdcrests.vendorlicense.types.LimitEntityDto;
33 import org.openecomp.sdcrests.vendorlicense.types.LimitRequestDto;
34 import org.springframework.validation.annotation.Validated;
36 import javax.validation.Valid;
37 import javax.validation.constraints.NotNull;
39 import javax.ws.rs.core.MediaType;
40 import javax.ws.rs.core.Response;
42 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
43 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
46 "/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/license-key-groups/{licenseKeyGroupId}/limits")
47 @Produces(MediaType.APPLICATION_JSON)
48 @Consumes(MediaType.APPLICATION_JSON)
49 @Tags({@Tag(name = "SDCE-1 APIs"), @Tag(name = "Vendor License Model - License Key Group Limits")})
51 public interface LicenseKeyGroupLimits {
55 @Operation(description = "Create vendor license key group limit")
56 Response createLimit(@Valid LimitRequestDto request,
57 @Parameter(description = "Vendor license model Id") @PathParam("vlmId")
59 @Parameter(description = "Vendor license model version Id") @PathParam
62 @Parameter(description = "Vendor license model License Key Group Id")
63 @PathParam("licenseKeyGroupId")
64 String licenseKeyGroupId,
65 @NotNull(message = USER_MISSING_ERROR_MSG)
66 @HeaderParam(USER_ID_HEADER_PARAM) String user);
70 @Operation(description = "List vendor license key group limits", responses = @ApiResponse(content = @Content(array = @ArraySchema( schema = @Schema(implementation = LimitEntityDto.class)))))
72 @Parameter(description = "Vendor license model Id") @PathParam("vlmId") String vlmId,
73 @Parameter(description = "Vendor license model version Id") @PathParam("versionId") String versionId,
74 @Parameter(description = "Vendor license model License Key Group Id") @PathParam("licenseKeyGroupId")
75 String licenseKeyGroupId,
76 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
80 @Operation(description = "Update vendor license key group limit")
81 Response updateLimit(@Valid LimitRequestDto request,
82 @Parameter(description = "Vendor license model Id") @PathParam("vlmId")
84 @Parameter(description = "Vendor license model version Id") @PathParam
87 @Parameter(description = "Vendor license model License Key Group Id")
88 @PathParam("licenseKeyGroupId")
89 String licenseKeyGroupId,
90 @NotNull(message = USER_MISSING_ERROR_MSG)
91 @PathParam("limitId") String limitId,
92 @HeaderParam(USER_ID_HEADER_PARAM) String user);
96 @Operation(description = "Get vendor entitlement pool limit", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = LimitEntityDto.class))))
98 @Parameter(description = "Vendor license model Id") @PathParam("vlmId") String vlmId,
99 @Parameter(description = "Vendor license model version Id") @PathParam("versionId") String versionId,
100 @Parameter(description = "Vendor license model License Key Group") @PathParam
101 ("licenseKeyGroupId") String entitlementPoolId,
102 @Parameter(description = "Vendor license model License Key Group Limit Id") @PathParam("limitId")
104 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
108 @Operation(description = "Delete vendor license key group limit")
109 Response deleteLimit(
110 @Parameter(description = "Vendor license model Id") @PathParam("vlmId") String vlmId,
111 @Parameter(description = "Vendor license model version Id") @PathParam("versionId") String versionId,
112 @Parameter(description = "Vendor license model license key group Id") @PathParam("licenseKeyGroupId")
113 String licenseKeyGroupId,
114 @PathParam("limitId") String limitId,
115 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);