use of org.sonarqube.ws.Issues.Operation in project sonarqube by SonarSource.
the class SearchResponseFormat method formatOperation.
Operation formatOperation(SearchResponseData data) {
Operation.Builder response = Operation.newBuilder();
if (data.getIssues().size() == 1) {
Issue.Builder issueBuilder = Issue.newBuilder();
IssueDto dto = data.getIssues().get(0);
formatIssue(issueBuilder, dto, data);
formatIssueActions(data, issueBuilder, dto);
formatIssueTransitions(data, issueBuilder, dto);
formatIssueComments(data, issueBuilder, dto);
response.setIssue(issueBuilder.build());
}
response.addAllComponents(formatComponents(data));
response.addAllRules(formatRules(data).getRulesList());
response.addAllUsers(formatUsers(data).getUsersList());
return response.build();
}