Add collaboration feature
[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.Consumes;
13 import javax.ws.rs.DELETE;
14 import javax.ws.rs.GET;
15 import javax.ws.rs.HeaderParam;
16 import javax.ws.rs.POST;
17 import javax.ws.rs.PUT;
18 import javax.ws.rs.Path;
19 import javax.ws.rs.PathParam;
20 import javax.ws.rs.Produces;
21 import javax.ws.rs.core.MediaType;
22 import javax.ws.rs.core.Response;
23
24 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
25 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
26
27 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/component-dependencies")
28 @Produces(MediaType.APPLICATION_JSON)
29 @Consumes(MediaType.APPLICATION_JSON)
30 @Api(value = "Vendor Software Product Component Dependencies")
31 @Validated
32 public interface ComponentDependencies extends VspEntities {
33
34   @POST
35   @Path("/")
36   @ApiOperation(value = "Create a vendor software product component dependency")
37   Response create(@Valid ComponentDependencyModel request,
38                   @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
39                   @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
40                   @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
41                       String user);
42
43   @GET
44   @Path("/")
45   @ApiOperation(value = "Get component dependencies for vendor software product",
46       response = ComponentDependencyResponseDto.class,
47       responseContainer = "List")
48   Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
49                 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId")
50                     String versionId,
51                 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
52                     String user);
53
54   @DELETE
55   @Path("/{dependencyId}")
56   @ApiOperation(value = "Delete component dependency for vendor software product")
57   Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
58                   @ApiParam(value = "Vendor software product version Id")
59                   @PathParam("versionId") String versionId,
60                   @ApiParam(value = "Vendor software product Component Dependency Id") @PathParam
61                       ("dependencyId") String dependencyId,
62                   @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
63                       String user);
64
65   @PUT
66   @Path("/{dependencyId}")
67   @ApiOperation(value = "Update component dependency for vendor software product")
68   Response update(@Valid ComponentDependencyModel request,
69                   @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
70                   @ApiParam(value = "Vendor software product version Id") @PathParam("versionId")
71                       String versionId,
72                   @ApiParam(value = "Vendor software product Component Dependency Id") @PathParam
73                       ("dependencyId") String dependencyId,
74                   @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
75                       String user);
76
77   @GET
78   @Path("/{dependencyId}")
79   @ApiOperation(value = "Get component dependency for vendor software product",
80       response = ComponentDependencyResponseDto.class)
81   Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
82                @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
83                @ApiParam(value = "Vendor software product Component Dependency Id") @PathParam
84                    ("dependencyId") String dependencyId,
85                @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
86                    String user);
87 }