[SDC-29] Amdocs OnBoard 1707 initial commit.
[sdc.git] / openecomp-be / api / openecomp-sdc-rest-webapp / vendor-license-rest / vendor-license-rest-services / src / main / java / org / openecomp / sdcrests / vendorlicense / rest / FeatureGroups.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
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.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;
32
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;
48
49 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
50 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
51
52
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")
57 @Validated
58 public interface FeatureGroups {
59
60   @GET
61   @Path("/")
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);
69
70   @POST
71   @Path("/")
72   @ApiOperation(value = "Create vendor feature group")
73   Response createFeatureGroup(@Valid FeatureGroupRequestDto request,
74                               @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
75                                   String 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);
79
80   @PUT
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")
85                                   String 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);
90
91   @GET
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);
100
101   @DELETE
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);
109
110 }