2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 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.conflict.rest;
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.conflict.types.ConflictDto;
28 import org.openecomp.sdcrests.conflict.types.ConflictResolutionDto;
29 import org.openecomp.sdcrests.conflict.types.ItemVersionConflictDto;
30 import org.springframework.validation.annotation.Validated;
32 import javax.validation.constraints.NotNull;
34 import javax.ws.rs.core.MediaType;
35 import javax.ws.rs.core.Response;
37 @Path("/v1.0/items/{itemId}/versions/{versionId}/conflicts")
38 @Produces(MediaType.APPLICATION_JSON)
39 @Consumes(MediaType.APPLICATION_JSON)
40 @Api(value = "Item Version Conflicts")
42 public interface Conflicts {
46 @ApiOperation(value = "item version conflicts",
47 notes = "Item version private copy conflicts against its public copy",
48 response = ItemVersionConflictDto.class)
49 Response getConflict(@ApiParam("Item Id") @PathParam("itemId") String itemId,
50 @ApiParam("Version Id") @PathParam("versionId") String versionId,
51 @NotNull(message = RestConstants.USER_MISSING_ERROR_MSG)
52 @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
55 @Path("/{conflictId}")
56 @ApiOperation(value = "Gets item version conflict",
57 notes = "Gets an item version private copy conflict against its public copy",
58 response = ConflictDto.class)
59 Response getConflict(@ApiParam("Item Id") @PathParam("itemId") String itemId,
60 @ApiParam("Version Id") @PathParam("versionId") String versionId,
61 @ApiParam("Version Id") @PathParam("conflictId") String conflictId,
62 @NotNull(message = RestConstants.USER_MISSING_ERROR_MSG)
63 @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
66 @Path("/{conflictId}")
67 @ApiOperation(value = "Resolves item version conflict",
68 notes = "Resolves an item version private copy conflict against its public copy")
69 Response resolveConflict(ConflictResolutionDto conflictResolution,
70 @ApiParam("Item Id") @PathParam("itemId") String itemId,
71 @ApiParam("Version Id") @PathParam("versionId") String versionId,
72 @ApiParam("Version Id") @PathParam("conflictId") String conflictId,
73 @NotNull(message = RestConstants.USER_MISSING_ERROR_MSG)
74 @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);