[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 / VendorLicenseModels.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.sdcrests.common.RestConstants;
27 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelActionRequestDto;
28 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto;
29 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelRequestDto;
30 import org.springframework.validation.annotation.Validated;
31
32 import javax.validation.Valid;
33 import javax.validation.constraints.NotNull;
34 import javax.ws.rs.*;
35 import javax.ws.rs.core.MediaType;
36 import javax.ws.rs.core.Response;
37
38 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
39
40
41 @Path("/v1.0/vendor-license-models")
42 @Produces(MediaType.APPLICATION_JSON)
43 @Consumes(MediaType.APPLICATION_JSON)
44 @Api(value = "Vendor License Models")
45 @Validated
46 public interface VendorLicenseModels {
47
48     @GET
49     @Path("/")
50     @ApiOperation(value = "List vendor license models",
51             response = VendorLicenseModelEntityDto.class,
52             responseContainer = "List")
53     Response listLicenseModels(@ApiParam(
54             value = "Currently supported value: 'Final' - only vendor License models with final versions "
55                     + "will be return - with their latest final version")
56                                @QueryParam("versionFilter") String versionFilter,
57                                @NotNull(message = USER_MISSING_ERROR_MSG)
58                                @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
59
60     @POST
61     @Path("/")
62     @ApiOperation(value = "Create vendor license model")
63     Response createLicenseModel(@Valid VendorLicenseModelRequestDto request,
64                                 @NotNull(message = USER_MISSING_ERROR_MSG)
65                                 @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
66
67     @PUT
68     @Path("/{vlmId}/versions/{versionId}")
69     @ApiOperation(value = "Update vendor license model")
70     Response updateLicenseModel(@Valid VendorLicenseModelRequestDto request,
71                                 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
72                                 String vlmId,
73                                 @ApiParam(value = "Vendor license model version Id") @PathParam
74                                         ("versionId") String versionId,
75                                 @NotNull(message = USER_MISSING_ERROR_MSG)
76                                 @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
77
78     @GET
79     @Path("/{vlmId}/versions/{versionId}")
80     @ApiOperation(value = "Get vendor license model",
81             response = VendorLicenseModelEntityDto.class)
82     Response getLicenseModel(
83             @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
84             @ApiParam(value = "Vendor license model version Id") @PathParam
85                     ("versionId") String versionId,
86             @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_ID_HEADER_PARAM)
87             String user);
88
89     @DELETE
90     @Path("/{vlmId}/versions/{versionId}")
91     @ApiOperation(value = "Delete vendor license model")
92     Response deleteLicenseModel(
93             @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
94             @ApiParam(value = "Vendor license model version Id") @PathParam
95                     ("versionId") String versionId,
96             @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_ID_HEADER_PARAM)
97             String user);
98
99     @PUT
100     @Path("/{vlmId}/versions/{versionId}/actions")
101     @ApiOperation(value = "Update vendor license model")
102     Response actOnLicenseModel(@Valid VendorLicenseModelActionRequestDto request,
103                                @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
104                                String vlmId,
105                                @ApiParam(value = "Vendor license model version Id") @PathParam
106                                        ("versionId") String versionId,
107                                @NotNull(message = USER_MISSING_ERROR_MSG)
108                                @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
109 }