use of com.cloudogu.scm.review.pullrequest.dto.MergeStrategyInfoDto in project scm-review-plugin by scm-manager.
the class MergeResource method getMergeStrategyInfo.
@GET
@Path("{namespace}/{name}/{pullRequestId}/merge-strategy-info")
@Produces(PullRequestMediaType.MERGE_STRATEGY_INFO)
@Operation(summary = "Get commit message information", description = "Returns commit message information for the given merge strategy", tags = "Pull Request")
@ApiResponse(responseCode = "200", description = "commit message was created", content = @Content(schema = @Schema(implementation = MergeStrategyInfoDto.class)))
@ApiResponse(responseCode = "401", description = "not authenticated / invalid credentials")
@ApiResponse(responseCode = "500", description = "internal server error", content = @Content(mediaType = VndMediaType.ERROR_TYPE, schema = @Schema(implementation = ErrorDto.class)))
public MergeStrategyInfoDto getMergeStrategyInfo(@PathParam("namespace") String namespace, @PathParam("name") String name, @PathParam("pullRequestId") String pullRequestId, @QueryParam("strategy") MergeStrategy strategy) {
MergeService.CommitDefaults commitDefaults = service.createCommitDefaults(new NamespaceAndName(namespace, name), pullRequestId, strategy);
DisplayUser commitAuthor = commitDefaults.getCommitAuthor();
return new MergeStrategyInfoDto(service.isCommitMessageDisabled(strategy), commitDefaults.getCommitMessage(), service.createMergeCommitMessageHint(strategy), renderCommitAuthorIfPresent(commitAuthor));
}
Aggregations