Search in sources :

Example 1 with SnomedRelationshipRestUpdate

use of com.b2international.snowowl.snomed.core.rest.domain.SnomedRelationshipRestUpdate in project snow-owl by b2ihealthcare.

the class SnomedRelationshipRestService method update.

@Operation(summary = "Update Relationship", description = "Updates properties of the specified Relationship.")
@ApiResponses({ @ApiResponse(responseCode = "204", description = "No content"), @ApiResponse(responseCode = "404", description = "Branch or Relationship not found") })
@PutMapping(value = "/{relationshipId}", consumes = { AbstractRestService.JSON_MEDIA_TYPE })
@ResponseStatus(HttpStatus.NO_CONTENT)
public void update(@Parameter(description = "The resource path", required = true) @PathVariable("path") final String path, @Parameter(description = "The Relationship identifier") @PathVariable("relationshipId") final String relationshipId, @Parameter(description = "Update Relationship parameters") @RequestBody final SnomedResourceRequest<SnomedRelationshipRestUpdate> body, @Parameter(description = "Force update flag") @RequestParam(defaultValue = "false", required = false) final Boolean force, @RequestHeader(value = X_AUTHOR, required = false) final String author) {
    final String commitComment = body.getCommitComment();
    final SnomedRelationshipRestUpdate update = body.getChange();
    final String defaultModuleId = body.getDefaultModuleId();
    update.toRequestBuilder(relationshipId).force(force).commit().setDefaultModuleId(defaultModuleId).setAuthor(author).setCommitComment(commitComment).build(path).execute(getBus()).getSync(COMMIT_TIMEOUT, TimeUnit.MINUTES);
}
Also used : SnomedRelationshipRestUpdate(com.b2international.snowowl.snomed.core.rest.domain.SnomedRelationshipRestUpdate) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Aggregations

SnomedRelationshipRestUpdate (com.b2international.snowowl.snomed.core.rest.domain.SnomedRelationshipRestUpdate)1 Operation (io.swagger.v3.oas.annotations.Operation)1 ApiResponses (io.swagger.v3.oas.annotations.responses.ApiResponses)1