use of com.meisolsson.githubsdk.service.pull_request.PullRequestReviewCommentService in project gh4a by slapperwan.
the class EditPullRequestDiffCommentActivity method createComment.
@Override
protected Single<GitHubCommentBase> createComment(String repoOwner, String repoName, String body, long replyToCommentId) {
Bundle extras = getIntent().getExtras();
int prNumber = extras.getInt("pull_request_number", 0);
PullRequestReviewCommentService service = ServiceFactory.get(PullRequestReviewCommentService.class, false);
CreateReviewComment.Builder builder = CreateReviewComment.builder().body(body);
if (replyToCommentId != 0) {
builder.inReplyTo(replyToCommentId);
} else {
builder.commitId(extras.getString("commit_id")).path(extras.getString("path")).position(extras.getInt("position"));
}
return service.createReviewComment(repoOwner, repoName, prNumber, builder.build()).map(ApiHelpers::throwOnFailure);
}
use of com.meisolsson.githubsdk.service.pull_request.PullRequestReviewCommentService in project gh4a by slapperwan.
the class EditPullRequestDiffCommentActivity method editComment.
@Override
protected Single<GitHubCommentBase> editComment(String repoOwner, String repoName, long commentId, String body) {
PullRequestReviewCommentService service = ServiceFactory.get(PullRequestReviewCommentService.class, false);
CommentRequest request = CommentRequest.builder().body(body).build();
return service.editReviewComment(repoOwner, repoName, commentId, request).map(ApiHelpers::throwOnFailure);
}
Aggregations