/** * Removes this subscription. */ 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); }
@Preview @Deprecated public void enabledSignedCommits() throws IOException { requester().method("POST") .to(url + REQUIRE_SIGNATURES_URI, RequiredSignatures.class); }
@Preview @Deprecated public void disableSignedCommits() throws IOException { requester().method("DELETE") .to(url + REQUIRE_SIGNATURES_URI); }
@Preview @Deprecated public boolean getRequiredSignatures() throws IOException { return requester().method("GET") .to(url + REQUIRE_SIGNATURES_URI, RequiredSignatures.class).enabled; }
/** * Deletes this review comment. */ public void delete() throws IOException { new Requester(owner.root).method("DELETE").to(getApiRoute()); }
/** * Conceals the membership. */ public void conceal(GHUser u) throws IOException { root.retrieve().method("DELETE").to("/orgs/" + login + "/public_members/" + u.getLogin(), null); }
/** * Accepts a pending invitation to an organization. * * @see GHMyself#getMembership(GHOrganization) */ public void activate() throws IOException { root.retrieve().method("PATCH").with("state",State.ACTIVE).to(url,this); }
/** * Deletes this comment. */ public void delete() throws IOException { new Requester(owner.root).method("DELETE").to(getApiTail()); }
/** * 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); }
/** * 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; }
/** * Creates a blob based on the parameters specified thus far. */ public GHCommit create() throws IOException { req._with("parents", parents); return req.method("POST").to(getApiTail(), GHCommit.class).wrapUp(repo); } }
public void requestReviewers(List<GHUser> reviewers) throws IOException { new Requester(root).method("POST") .withLogins("reviewers", reviewers) .to(getApiRoute() + REQUEST_REVIEWERS); }
/** * 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); }
/** * 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); }
public GHBranchProtection enable() throws IOException { return requester().method("PUT") .withNullable("required_status_checks", statusChecks) .withNullable("required_pull_request_reviews", prReviews) .withNullable("restrictions", restrictions) .withNullable("enforce_admins", enforceAdmins) .to(branch.getProtectionUrl().toString(), GHBranchProtection.class) .wrap(branch); }
public GHLabel createLabel(String name, String color) throws IOException { return root.retrieve().method("POST") .with("name",name) .with("color", color) .to(getApiTailUrl("labels"), GHLabel.class).wrapUp(this); }
/** * Subscribes to this repository 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(getApiTailUrl("subscription"), GHSubscription.class).wrapUp(this); }
/** * 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(); }