2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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.annotations.Api;
24 import io.swagger.annotations.ApiOperation;
25 import io.swagger.annotations.ApiParam;
26 import org.openecomp.sdc.versioning.dao.types.Version;
27 import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupEntityDto;
28 import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupModelDto;
29 import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupRequestDto;
30 import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupUpdateRequestDto;
31 import org.springframework.validation.annotation.Validated;
33 import javax.validation.Valid;
34 import javax.validation.constraints.NotNull;
35 import javax.validation.constraints.Pattern;
36 import javax.ws.rs.Consumes;
37 import javax.ws.rs.DELETE;
38 import javax.ws.rs.GET;
39 import javax.ws.rs.HeaderParam;
40 import javax.ws.rs.POST;
41 import javax.ws.rs.PUT;
42 import javax.ws.rs.Path;
43 import javax.ws.rs.PathParam;
44 import javax.ws.rs.Produces;
45 import javax.ws.rs.QueryParam;
46 import javax.ws.rs.core.MediaType;
47 import javax.ws.rs.core.Response;
49 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
50 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
53 @Path("/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/feature-groups")
54 @Produces(MediaType.APPLICATION_JSON)
55 @Consumes(MediaType.APPLICATION_JSON)
56 @Api(value = "Vendor License Model - Feature Groups")
58 public interface FeatureGroups {
62 @ApiOperation(value = "List vendor feature groups",
63 response = FeatureGroupEntityDto.class,
64 responseContainer = "List")
65 Response listFeatureGroups(
66 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
67 @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
68 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
72 @ApiOperation(value = "Create vendor feature group")
73 Response createFeatureGroup(@Valid FeatureGroupRequestDto request,
74 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
76 @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
77 @NotNull(message = USER_MISSING_ERROR_MSG)
78 @HeaderParam(USER_ID_HEADER_PARAM) String user);
81 @Path("/{featureGroupId}")
82 @ApiOperation(value = "Update vendor feature group")
83 Response updateFeatureGroup(@Valid FeatureGroupUpdateRequestDto request,
84 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
86 @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
87 @PathParam("featureGroupId") String featureGroupId,
88 @NotNull(message = USER_MISSING_ERROR_MSG)
89 @HeaderParam(USER_ID_HEADER_PARAM) String user);
92 @Path("/{featureGroupId}")
93 @ApiOperation(value = "Get vendor feature group",
94 response = FeatureGroupModelDto.class)
95 Response getFeatureGroup(
96 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
97 @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
98 @PathParam("featureGroupId") String featureGroupId,
99 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
102 @Path("/{featureGroupId}")
103 @ApiOperation(value = "Delete vendor feature group")
104 Response deleteFeatureGroup(
105 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
106 @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
107 @PathParam("featureGroupId") String featureGroupId,
108 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);