use of com.meisolsson.githubsdk.model.request.pull_request.SubmitReview in project gh4a by slapperwan.
the class CreateReviewActivity method onEditorDoSend.
@Override
public Single<?> onEditorDoSend(String body) {
int position = mReviewEventSpinner.getSelectedItemPosition();
@SuppressWarnings("ConstantConditions") ReviewEventDesc desc = mReviewEventAdapter.getItem(position);
PullRequestReviewService service = ServiceFactory.get(PullRequestReviewService.class, false);
final Single<Response<Review>> resultSingle;
if (mPendingReview == null) {
CreateReview request = CreateReview.builder().body(body).event(desc.mCreateEvent).build();
resultSingle = service.createReview(mRepoOwner, mRepoName, mPullRequestNumber, request);
} else {
SubmitReview request = SubmitReview.builder().body(body).event(desc.mSubmitEvent).build();
resultSingle = service.submitReview(mRepoOwner, mRepoName, mPullRequestNumber, mPendingReview.id(), request);
}
return resultSingle.map(ApiHelpers::throwOnFailure);
}
Aggregations