re base code
[sdc.git] / openecomp-be / api / openecomp-sdc-rest-webapp / vendor-software-products-rest / vendor-software-products-rest-services / src / main / java / org / openecomp / sdcrests / vsp / rest / ComponentDependencies.java
1 package org.openecomp.sdcrests.vsp.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.vendorsoftwareproducts.types.ComponentDependencyModel;
7 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyResponseDto;
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("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/component-dependencies")
20 @Produces(MediaType.APPLICATION_JSON)
21 @Consumes(MediaType.APPLICATION_JSON)
22 @Api(value = "Vendor Software Product Component Dependencies")
23 @Validated
24 public interface ComponentDependencies extends VspEntities {
25
26   @POST
27   @Path("/")
28   @ApiOperation(value = "Create a vendor software product component dependency")
29   Response create(@Valid ComponentDependencyModel request,
30                   @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
31                   @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
32                   @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
33                       String user);
34
35   @GET
36   @Path("/")
37   @ApiOperation(value = "Get component dependencies for vendor software product",
38       response = ComponentDependencyResponseDto.class,
39       responseContainer = "List")
40   Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
41                 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId")
42                     String versionId,
43                 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
44                     String user);
45
46   @DELETE
47   @Path("/{dependencyId}")
48   @ApiOperation(value = "Delete component dependency for vendor software product")
49   Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
50                   @ApiParam(value = "Vendor software product version Id")
51                   @PathParam("versionId") String versionId,
52                   @ApiParam(value = "Vendor software product Component Dependency Id") @PathParam
53                       ("dependencyId") String dependencyId,
54                   @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
55                       String user);
56
57   @PUT
58   @Path("/{dependencyId}")
59   @ApiOperation(value = "Update component dependency for vendor software product")
60   Response update(@Valid ComponentDependencyModel request,
61                   @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
62                   @ApiParam(value = "Vendor software product version Id") @PathParam("versionId")
63                       String versionId,
64                   @ApiParam(value = "Vendor software product Component Dependency Id") @PathParam
65                       ("dependencyId") String dependencyId,
66                   @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
67                       String user);
68
69   @GET
70   @Path("/{dependencyId}")
71   @ApiOperation(value = "Get component dependency for vendor software product",
72       response = ComponentDependencyResponseDto.class)
73   Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
74                @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
75                @ApiParam(value = "Vendor software product Component Dependency Id") @PathParam
76                    ("dependencyId") String dependencyId,
77                @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
78                    String user);
79 }