mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-04 00:11:24 +00:00
Method to mark the thread as read
This commit is contained in:
@@ -1,20 +1,23 @@
|
||||
package org.kohsuke.github;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* A conversation in the notification API.
|
||||
*
|
||||
*
|
||||
* @see <a href="https://developer.github.com/v3/activity/notifications/">documentation</a>
|
||||
* @see GHNotificationStream
|
||||
* @author Kohsuke Kawaguchi
|
||||
*/
|
||||
public class GHThread extends GHObject {
|
||||
private GitHub root;
|
||||
private GHRepository repository;
|
||||
private Subject subject;
|
||||
private String reason;
|
||||
private boolean unread;
|
||||
private String last_read_at;
|
||||
private String url;
|
||||
|
||||
static class Subject {
|
||||
String title;
|
||||
@@ -54,4 +57,18 @@ public class GHThread extends GHObject {
|
||||
public String getType() {
|
||||
return subject.type;
|
||||
}
|
||||
|
||||
/*package*/ GHThread wrap(GitHub root) {
|
||||
this.root = root;
|
||||
if (this.repository!=null)
|
||||
this.repository.wrap(root);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks this thread as read.
|
||||
*/
|
||||
public void markAsRead() throws IOException {
|
||||
new Requester(root).method("PATCH").to(url);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user