Add delete and update for GHIssueComment

This commit is contained in:
Julien HENRY
2015-05-22 09:50:52 +02:00
parent dd3e73996b
commit cce02aec3d
3 changed files with 23 additions and 2 deletions

View File

@@ -79,4 +79,23 @@ public class GHIssueComment extends GHObject {
public URL getHtmlUrl() {
return null;
}
/**
* Updates the body of the issue comment.
*/
public void update(String body) throws IOException {
new Requester(owner.root).with("body", body).method("PATCH").to(getCommentApiTail(), GHIssueComment.class);
this.body = body;
}
/**
* Deletes this issue comment.
*/
public void delete() throws IOException {
new Requester(owner.root).method("DELETE").to(getCommentApiTail());
}
private String getCommentApiTail() {
return "/repos/"+owner.getRepository().getOwnerName()+"/"+owner.getRepository().getName()+"/issues/comments/" + id;
}
}