Search in sources :

Example 1 with CreateCommitComment

use of com.meisolsson.githubsdk.model.request.repository.CreateCommitComment in project gh4a by slapperwan.

the class EditCommitCommentActivity method createComment.

@Override
protected Single<GitHubCommentBase> createComment(String repoOwner, String repoName, String body, long replyToCommentId) {
    RepositoryCommentService service = ServiceFactory.get(RepositoryCommentService.class, false);
    CreateCommitComment request = CreateCommitComment.builder().body(body).build();
    String sha = getIntent().getStringExtra("commit");
    return service.createCommitComment(repoOwner, repoName, sha, request).map(ApiHelpers::throwOnFailure);
}
Also used : ApiHelpers(com.gh4a.utils.ApiHelpers) RepositoryCommentService(com.meisolsson.githubsdk.service.repositories.RepositoryCommentService) CreateCommitComment(com.meisolsson.githubsdk.model.request.repository.CreateCommitComment)

Example 2 with CreateCommitComment

use of com.meisolsson.githubsdk.model.request.repository.CreateCommitComment in project gh4a by slapperwan.

the class EditDiffCommentActivity method createComment.

@Override
protected Single<GitHubCommentBase> createComment(String repoOwner, String repoName, String body, long replyToCommentId) {
    Bundle extras = getIntent().getExtras();
    String commitId = extras.getString("commit_id");
    RepositoryCommentService service = ServiceFactory.get(RepositoryCommentService.class, false);
    CreateCommitComment request = CreateCommitComment.builder().body(body).path(extras.getString("path")).position(extras.getInt("position")).build();
    return service.createCommitComment(repoOwner, repoName, commitId, request).map(ApiHelpers::throwOnFailure);
}
Also used : Bundle(android.os.Bundle) ApiHelpers(com.gh4a.utils.ApiHelpers) RepositoryCommentService(com.meisolsson.githubsdk.service.repositories.RepositoryCommentService) CreateCommitComment(com.meisolsson.githubsdk.model.request.repository.CreateCommitComment)

Example 3 with CreateCommitComment

use of com.meisolsson.githubsdk.model.request.repository.CreateCommitComment in project gh4a by slapperwan.

the class CommitNoteFragment method onEditorDoSend.

@Override
public Single<?> onEditorDoSend(String comment) {
    RepositoryCommentService service = ServiceFactory.get(RepositoryCommentService.class, false);
    CreateCommitComment request = CreateCommitComment.builder().body(comment).build();
    return service.createCommitComment(mRepoOwner, mRepoName, mObjectSha, request).map(ApiHelpers::throwOnFailure);
}
Also used : ApiHelpers(com.gh4a.utils.ApiHelpers) RepositoryCommentService(com.meisolsson.githubsdk.service.repositories.RepositoryCommentService) CreateCommitComment(com.meisolsson.githubsdk.model.request.repository.CreateCommitComment)

Aggregations

ApiHelpers (com.gh4a.utils.ApiHelpers)3 CreateCommitComment (com.meisolsson.githubsdk.model.request.repository.CreateCommitComment)3 RepositoryCommentService (com.meisolsson.githubsdk.service.repositories.RepositoryCommentService)3 Bundle (android.os.Bundle)1