@Test public void getProductBaselineTest() throws ApplicationException { PartUsageLink partLink = new PartUsageLink(); List<PartLink> partLinks = Collections.singletonList(partLink); partLink.setComponent(partMaster); Mockito.when(productBaselineService.getBaseline(baseline.getId())) .thenReturn(baseline); Mockito.when(productService.decodePath(configurationItemKey, path)) .thenReturn(partLinks); PartUsageLink link = new PartUsageLink(); link.setComponent(partMaster); List<PartLink> sourcePath = Collections.singletonList(link); Mockito.when(productService.decodePath(configurationItemKey, p2pLink.getSourcePath())) .thenReturn(sourcePath); List<PartLink> targetPath = Collections.singletonList(link); Mockito.when(productService.decodePath(configurationItemKey, p2pLink.getTargetPath())) .thenReturn(targetPath); ProductBaselineDTO productBaseline = productBaselineResource.getProductBaseline(workspaceId, ciId, baseline.getId()); Assert.assertNotNull(productBaseline); }
@GET @ApiOperation(value = "Get product-baseline by id", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Produces(MediaType.APPLICATION_JSON) public ProductBaselineDTO getProductBaseline( @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId, @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId, @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId) throws EntityNotFoundException, UserNotActiveException, AccessRightException, WorkspaceNotEnabledException { ProductBaseline productBaseline = productBaselineService.getBaseline(baselineId); ProductBaselineDTO productBaselineDTO = mapper.map(productBaseline, ProductBaselineDTO.class); productBaselineDTO.setPathToPathLinks(getPathToPathLinksForGivenBaseline(productBaseline)); productBaselineDTO.setConfigurationItemId(productBaseline.getConfigurationItem().getId()); productBaselineDTO.setConfigurationItemLatestRevision(productBaseline.getConfigurationItem().getDesignItem().getLastRevision().getVersion()); ConfigurationItemKey ciKey = productBaseline.getConfigurationItem().getKey(); List<LightPartLinkListDTO> substitutesParts = new ArrayList<>(); List<LightPartLinkListDTO> optionalParts = new ArrayList<>(); for (String path : productBaseline.getSubstituteLinks()) { LightPartLinkListDTO lightPartLinkListDTO = new LightPartLinkListDTO(); for (PartLink partLink : productService.decodePath(ciKey, path)) { lightPartLinkListDTO.getPartLinks().add(new LightPartLinkDTO(partLink.getComponent().getNumber(), partLink.getComponent().getName(),partLink.getReferenceDescription(),partLink.getFullId())); } substitutesParts.add(lightPartLinkListDTO); } for (String path : productBaseline.getOptionalUsageLinks()) { LightPartLinkListDTO lightPartLinkListDTO = new LightPartLinkListDTO(); for (PartLink partLink : productService.decodePath(ciKey, path)) { lightPartLinkListDTO.getPartLinks().add(new LightPartLinkDTO(partLink.getComponent().getNumber(), partLink.getComponent().getName(),partLink.getReferenceDescription(),partLink.getFullId())); } optionalParts.add(lightPartLinkListDTO); } productBaselineDTO.setSubstitutesParts(substitutesParts); productBaselineDTO.setOptionalsParts(optionalParts); return productBaselineDTO; }
ProductBaselinesResource { @GET @ApiOperation(value = "Get product-baseline by id", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Produces(MediaType.APPLICATION_JSON) public ProductBaselineDTO getProductBaseline( @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId, @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId, @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId) throws EntityNotFoundException, UserNotActiveException, AccessRightException, WorkspaceNotEnabledException { ProductBaseline productBaseline = productBaselineService.getBaseline(baselineId); ProductBaselineDTO productBaselineDTO = mapper.map(productBaseline, ProductBaselineDTO.class); productBaselineDTO.setPathToPathLinks(getPathToPathLinksForGivenBaseline(productBaseline)); productBaselineDTO.setConfigurationItemId(productBaseline.getConfigurationItem().getId()); productBaselineDTO.setConfigurationItemLatestRevision(productBaseline.getConfigurationItem().getDesignItem().getLastRevision().getVersion()); ConfigurationItemKey ciKey = productBaseline.getConfigurationItem().getKey(); List<LightPartLinkListDTO> substitutesParts = new ArrayList<>(); List<LightPartLinkListDTO> optionalParts = new ArrayList<>(); for (String path : productBaseline.getSubstituteLinks()) { LightPartLinkListDTO lightPartLinkListDTO = new LightPartLinkListDTO(); for (PartLink partLink : productService.decodePath(ciKey, path)) { lightPartLinkListDTO.getPartLinks().add(new LightPartLinkDTO(partLink.getComponent().getNumber(), partLink.getComponent().getName(),partLink.getReferenceDescription(),partLink.getFullId())); } substitutesParts.add(lightPartLinkListDTO); } for (String path : productBaseline.getOptionalUsageLinks()) { LightPartLinkListDTO lightPartLinkListDTO = new LightPartLinkListDTO(); for (PartLink partLink : productService.decodePath(ciKey, path)) { lightPartLinkListDTO.getPartLinks().add(new LightPartLinkDTO(partLink.getComponent().getNumber(), partLink.getComponent().getName(),partLink.getReferenceDescription(),partLink.getFullId())); } optionalParts.add(lightPartLinkListDTO); } productBaselineDTO.setSubstitutesParts(substitutesParts); productBaselineDTO.setOptionalsParts(optionalParts); return productBaselineDTO; } }
ProductBaselinesResource { @GET @ApiOperation(value = "Get product-baseline by id", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Produces(MediaType.APPLICATION_JSON) public ProductBaselineDTO getProductBaseline( @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId, @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId, @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId) throws EntityNotFoundException, UserNotActiveException, AccessRightException, WorkspaceNotEnabledException { ProductBaseline productBaseline = productBaselineService.getBaseline(baselineId); ProductBaselineDTO productBaselineDTO = mapper.map(productBaseline, ProductBaselineDTO.class); productBaselineDTO.setPathToPathLinks(getPathToPathLinksForGivenBaseline(productBaseline)); productBaselineDTO.setConfigurationItemId(productBaseline.getConfigurationItem().getId()); productBaselineDTO.setConfigurationItemLatestRevision(productBaseline.getConfigurationItem().getDesignItem().getLastRevision().getVersion()); ConfigurationItemKey ciKey = productBaseline.getConfigurationItem().getKey(); List<LightPartLinkListDTO> substitutesParts = new ArrayList<>(); List<LightPartLinkListDTO> optionalParts = new ArrayList<>(); for (String path : productBaseline.getSubstituteLinks()) { LightPartLinkListDTO lightPartLinkListDTO = new LightPartLinkListDTO(); for (PartLink partLink : productService.decodePath(ciKey, path)) { lightPartLinkListDTO.getPartLinks().add(new LightPartLinkDTO(partLink.getComponent().getNumber(), partLink.getComponent().getName(),partLink.getReferenceDescription(),partLink.getFullId())); } substitutesParts.add(lightPartLinkListDTO); } for (String path : productBaseline.getOptionalUsageLinks()) { LightPartLinkListDTO lightPartLinkListDTO = new LightPartLinkListDTO(); for (PartLink partLink : productService.decodePath(ciKey, path)) { lightPartLinkListDTO.getPartLinks().add(new LightPartLinkDTO(partLink.getComponent().getNumber(), partLink.getComponent().getName(),partLink.getReferenceDescription(),partLink.getFullId())); } optionalParts.add(lightPartLinkListDTO); } productBaselineDTO.setSubstitutesParts(substitutesParts); productBaselineDTO.setOptionalsParts(optionalParts); return productBaselineDTO; } ProductBaselinesResource(); }
ProductBaselinesResource { @GET @ApiOperation(value = "Get product-baseline by id", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Produces(MediaType.APPLICATION_JSON) public ProductBaselineDTO getProductBaseline( @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId, @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId, @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId) throws EntityNotFoundException, UserNotActiveException, AccessRightException, WorkspaceNotEnabledException { ProductBaseline productBaseline = productBaselineService.getBaseline(baselineId); ProductBaselineDTO productBaselineDTO = mapper.map(productBaseline, ProductBaselineDTO.class); productBaselineDTO.setPathToPathLinks(getPathToPathLinksForGivenBaseline(productBaseline)); productBaselineDTO.setConfigurationItemId(productBaseline.getConfigurationItem().getId()); productBaselineDTO.setConfigurationItemLatestRevision(productBaseline.getConfigurationItem().getDesignItem().getLastRevision().getVersion()); ConfigurationItemKey ciKey = productBaseline.getConfigurationItem().getKey(); List<LightPartLinkListDTO> substitutesParts = new ArrayList<>(); List<LightPartLinkListDTO> optionalParts = new ArrayList<>(); for (String path : productBaseline.getSubstituteLinks()) { LightPartLinkListDTO lightPartLinkListDTO = new LightPartLinkListDTO(); for (PartLink partLink : productService.decodePath(ciKey, path)) { lightPartLinkListDTO.getPartLinks().add(new LightPartLinkDTO(partLink.getComponent().getNumber(), partLink.getComponent().getName(),partLink.getReferenceDescription(),partLink.getFullId())); } substitutesParts.add(lightPartLinkListDTO); } for (String path : productBaseline.getOptionalUsageLinks()) { LightPartLinkListDTO lightPartLinkListDTO = new LightPartLinkListDTO(); for (PartLink partLink : productService.decodePath(ciKey, path)) { lightPartLinkListDTO.getPartLinks().add(new LightPartLinkDTO(partLink.getComponent().getNumber(), partLink.getComponent().getName(),partLink.getReferenceDescription(),partLink.getFullId())); } optionalParts.add(lightPartLinkListDTO); } productBaselineDTO.setSubstitutesParts(substitutesParts); productBaselineDTO.setOptionalsParts(optionalParts); return productBaselineDTO; } ProductBaselinesResource(); @PostConstruct void init(); @GET @ApiOperation(value = "Get product-baselines in given workspace", response = ProductBaselineDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Produces(MediaType.APPLICATION_JSON) Response getAllProductBaselines(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId); @GET @Path("{ciId}/baselines") @ApiOperation(value = "Get product-baseline with given configuration item", response = ProductBaselineDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Produces(MediaType.APPLICATION_JSON) Response getProductBaselinesForProduct(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId); @POST @ApiOperation(value = "Create a new product-baseline", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) ProductBaselineDTO createProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Product baseline to create") ProductBaselineCreationDTO productBaselineDTO,
            @ApiParam(required = false, value = "Dry run flag") @QueryParam("dryRun") boolean dryRun); @DELETE @ApiOperation(value = "Delete product-baseline", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Consumes(MediaType.APPLICATION_JSON) Response deleteProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId); @GET @ApiOperation(value = "Get product-baseline by id", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Produces(MediaType.APPLICATION_JSON) ProductBaselineDTO getProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId); @GET @ApiOperation(value = "Get product-baseline's baselined parts", response = BaselinedPartDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of BaselinedPartDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}/parts") @Produces(MediaType.APPLICATION_JSON) Response getProductBaselineParts(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId,
            @ApiParam(required = true, value = "Query") @QueryParam("q") String q); @GET @ApiOperation(value = "Get product-baseline's path-to-path links", response = LightPathToPathLinkDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of LightPathToPathLinkDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}/path-to-path-links-types") @Produces(MediaType.APPLICATION_JSON) Response getPathToPathLinkTypesInBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId); @GET @ApiOperation(value = "Get product-baseline's path-to-path links for given source and target", response = LightPathToPathLinkDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of LightPathToPathLinkDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}/path-to-path-links/source/{sourcePath}/target/{targetPath}") @Produces(MediaType.APPLICATION_JSON) Response getPathToPathLinkInProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String configurationItemId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId,
            @ApiParam(required = true, value = "Source path") @PathParam("sourcePath") String sourcePathAsString,
            @ApiParam(required = true, value = "Target path") @PathParam("targetPath") String targetPathAsString); }
ProductBaselinesResource { @GET @ApiOperation(value = "Get product-baseline by id", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Produces(MediaType.APPLICATION_JSON) public ProductBaselineDTO getProductBaseline( @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId, @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId, @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId) throws EntityNotFoundException, UserNotActiveException, AccessRightException, WorkspaceNotEnabledException { ProductBaseline productBaseline = productBaselineService.getBaseline(baselineId); ProductBaselineDTO productBaselineDTO = mapper.map(productBaseline, ProductBaselineDTO.class); productBaselineDTO.setPathToPathLinks(getPathToPathLinksForGivenBaseline(productBaseline)); productBaselineDTO.setConfigurationItemId(productBaseline.getConfigurationItem().getId()); productBaselineDTO.setConfigurationItemLatestRevision(productBaseline.getConfigurationItem().getDesignItem().getLastRevision().getVersion()); ConfigurationItemKey ciKey = productBaseline.getConfigurationItem().getKey(); List<LightPartLinkListDTO> substitutesParts = new ArrayList<>(); List<LightPartLinkListDTO> optionalParts = new ArrayList<>(); for (String path : productBaseline.getSubstituteLinks()) { LightPartLinkListDTO lightPartLinkListDTO = new LightPartLinkListDTO(); for (PartLink partLink : productService.decodePath(ciKey, path)) { lightPartLinkListDTO.getPartLinks().add(new LightPartLinkDTO(partLink.getComponent().getNumber(), partLink.getComponent().getName(),partLink.getReferenceDescription(),partLink.getFullId())); } substitutesParts.add(lightPartLinkListDTO); } for (String path : productBaseline.getOptionalUsageLinks()) { LightPartLinkListDTO lightPartLinkListDTO = new LightPartLinkListDTO(); for (PartLink partLink : productService.decodePath(ciKey, path)) { lightPartLinkListDTO.getPartLinks().add(new LightPartLinkDTO(partLink.getComponent().getNumber(), partLink.getComponent().getName(),partLink.getReferenceDescription(),partLink.getFullId())); } optionalParts.add(lightPartLinkListDTO); } productBaselineDTO.setSubstitutesParts(substitutesParts); productBaselineDTO.setOptionalsParts(optionalParts); return productBaselineDTO; } ProductBaselinesResource(); @PostConstruct void init(); @GET @ApiOperation(value = "Get product-baselines in given workspace", response = ProductBaselineDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Produces(MediaType.APPLICATION_JSON) Response getAllProductBaselines(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId); @GET @Path("{ciId}/baselines") @ApiOperation(value = "Get product-baseline with given configuration item", response = ProductBaselineDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Produces(MediaType.APPLICATION_JSON) Response getProductBaselinesForProduct(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId); @POST @ApiOperation(value = "Create a new product-baseline", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) ProductBaselineDTO createProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Product baseline to create") ProductBaselineCreationDTO productBaselineDTO,
            @ApiParam(required = false, value = "Dry run flag") @QueryParam("dryRun") boolean dryRun); @DELETE @ApiOperation(value = "Delete product-baseline", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Consumes(MediaType.APPLICATION_JSON) Response deleteProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId); @GET @ApiOperation(value = "Get product-baseline by id", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Produces(MediaType.APPLICATION_JSON) ProductBaselineDTO getProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId); @GET @ApiOperation(value = "Get product-baseline's baselined parts", response = BaselinedPartDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of BaselinedPartDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}/parts") @Produces(MediaType.APPLICATION_JSON) Response getProductBaselineParts(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId,
            @ApiParam(required = true, value = "Query") @QueryParam("q") String q); @GET @ApiOperation(value = "Get product-baseline's path-to-path links", response = LightPathToPathLinkDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of LightPathToPathLinkDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}/path-to-path-links-types") @Produces(MediaType.APPLICATION_JSON) Response getPathToPathLinkTypesInBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId); @GET @ApiOperation(value = "Get product-baseline's path-to-path links for given source and target", response = LightPathToPathLinkDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of LightPathToPathLinkDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}/path-to-path-links/source/{sourcePath}/target/{targetPath}") @Produces(MediaType.APPLICATION_JSON) Response getPathToPathLinkInProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String configurationItemId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId,
            @ApiParam(required = true, value = "Source path") @PathParam("sourcePath") String sourcePathAsString,
            @ApiParam(required = true, value = "Target path") @PathParam("targetPath") String targetPathAsString);  }