GHIssueBuilder(GHRepository repo, String title) { this.repo = repo; this.builder = new Requester(repo.root); builder.with("title",title); }
/** * Removes this subscription. */ public void delete() throws IOException { new Requester(root).method("DELETE").to(url); }
/** * Deletes this ref from the repository using the GitHub API. */ public void delete() throws IOException { new Requester(root).method("DELETE").to(url); }
/** * Disables branch protection and allows anyone with push access to push changes. */ public void disableProtection() throws IOException { new Requester(root).method("DELETE").to(protection_url); }
/** * Deletes this review comment. */ public void delete() throws IOException { new Requester(owner.root).method("DELETE").to(getApiRoute()); }
/** * Deletes this release. */ public void delete() throws IOException { new Requester(root).method("DELETE").to(owner.getApiTailUrl("releases/"+id)); }
/** * Marks all the notifications as read. */ public void markAsRead(long timestamp) throws IOException { final Requester req = new Requester(root).method("PUT"); if (timestamp>=0) req.with("last_read_at", GitHub.printDate(new Date(timestamp))); req.asHttpStatusCode(apiUrl); }
/** * Forks this gist into your own. */ public GHGist fork() throws IOException { return new Requester(root).to(getApiTailUrl("forks"),GHGist.class).wrapUp(root); }
public void setEmailServiceHook(String address) throws IOException { Map<String, String> config = new HashMap<String, String>(); config.put("address", address); new Requester(root).method("POST").with("name", "email").with("config", config).with("active", true) .to(getApiTailUrl("hooks")); }
private void edit(String key, String value) throws IOException { Requester requester = new Requester(root); if (!key.equals("name")) requester.with("name", name); // even when we don't change the name, we need to send it in requester.with(key, value).method("PATCH").to(getApiTailUrl("")); }
/** * Updates the body of the commit message. */ public void update(String body) throws IOException { new Requester(owner.root) .with("body", body) .method("PATCH").to(getApiTail(), GHCommitComment.class); this.body = body; }
public void requestReviewers(List<GHUser> reviewers) throws IOException { new Requester(root).method("POST") .withLogins("reviewers", reviewers) .to(getApiRoute() + REQUEST_REVIEWERS); }
/** * @see <a href="https://developer.github.com/v3/repos/hooks/#ping-a-hook">Ping hook</a> */ public void ping() throws IOException { new Requester(getRoot()).method("POST").to(getApiRoute() + "/pings"); }
/** * Updates the comment. */ public void update(String body) throws IOException { new Requester(owner.root).method("PATCH").with("body", body).to(getApiRoute(),this); this.body = body; }
/** * Updates the body of the issue comment. */ public void update(String body) throws IOException { new Requester(owner.root).with("body", body).method("PATCH").to(getApiRoute(), GHIssueComment.class); this.body = body; }
/** * Subscribes to this conversation to get notifications. */ public GHSubscription subscribe(boolean subscribed, boolean ignored) throws IOException { return new Requester(root) .with("subscribed", subscribed) .with("ignored", ignored) .method("PUT").to(subscription_url, GHSubscription.class).wrapUp(root); }
@Preview @Deprecated public GHReaction createReaction(ReactionContent content) throws IOException { return new Requester(owner.root) .withPreview(SQUIRREL_GIRL) .with("content", content.getContent()) .to(getApiRoute()+"/reactions", GHReaction.class).wrap(root); }
/** * Updates this ref to the specified commit. * * @param sha * The SHA1 value to set this reference to * @param force * Whether or not to force this ref update. */ public void updateTo(String sha, Boolean force) throws IOException { new Requester(root) .with("sha", sha).with("force", force).method("PATCH").to(url, GHRef.class).wrap(root); }
@Preview @Deprecated public GHReaction createReaction(ReactionContent content) throws IOException { return new Requester(owner.root) .withPreview(SQUIRREL_GIRL) .with("content", content.getContent()) .to(getApiRoute()+"/reactions", GHReaction.class).wrap(owner.root); }
/** * Updates the comment. */ public void submit(String body, GHPullRequestReviewEvent event) throws IOException { new Requester(owner.root).method("POST") .with("body", body) .with("event", event.action()) .to(getApiRoute()+"/events",this); this.body = body; this.state = event.toState(); }