GHPullRequest wrapUp(GHRepository owner) { this.wrap(owner); return wrapUp(owner.root); }
GHPullRequest wrapUp(GHRepository owner) { this.wrap(owner); return wrapUp(owner.root); }
@Override void wrapUp(GitHub root) { super.wrapUp(root); if (pull_request==null) throw new IllegalStateException("Expected pull_request payload, but got something else. Maybe we've got another type of event?"); if (repository!=null) { repository.wrap(root); pull_request.wrapUp(repository); } else { pull_request.wrapUp(root); } } }
@Override void wrapUp(GitHub root) { super.wrapUp(root); if (pull_request==null) throw new IllegalStateException("Expected pull_request payload, but got something else. Maybe we've got another type of event?"); if (repository!=null) { repository.wrap(root); pull_request.wrapUp(repository); } else { pull_request.wrapUp(root); } } }
GHPullRequest wrapUp(GHRepository owner) { this.wrap(owner); return wrapUp(owner.root); }
@Override void wrapUp(GitHub root) { super.wrapUp(root); if (review==null) throw new IllegalStateException("Expected pull_request_review payload, but got something else. Maybe we've got another type of event?"); review.wrapUp(pull_request); if (repository!=null) { repository.wrap(root); pull_request.wrapUp(repository); } else { pull_request.wrapUp(root); } } }
@Override void wrapUp(GitHub root) { super.wrapUp(root); if (comment==null) throw new IllegalStateException("Expected pull_request_review_comment payload, but got something else. Maybe we've got another type of event?"); comment.wrapUp(pull_request); if (repository!=null) { repository.wrap(root); pull_request.wrapUp(repository); } else { pull_request.wrapUp(root); } } }
@Override void wrapUp(GitHub root) { super.wrapUp(root); if (comment==null) throw new IllegalStateException("Expected pull_request_review_comment payload, but got something else. Maybe we've got another type of event?"); comment.wrapUp(pull_request); if (repository!=null) { repository.wrap(root); pull_request.wrapUp(repository); } else { pull_request.wrapUp(root); } } }
@Override void wrapUp(GitHub root) { super.wrapUp(root); if (review==null) throw new IllegalStateException("Expected pull_request_review payload, but got something else. Maybe we've got another type of event?"); review.wrapUp(pull_request); if (repository!=null) { repository.wrap(root); pull_request.wrapUp(repository); } else { pull_request.wrapUp(root); } } }
/** * Fully populate the data by retrieving missing data. * * Depending on the original API call where this object is created, it may not contain everything. */ private void populate() throws IOException { if (merged_by!=null) return; // already populated root.retrieve().to(url, this).wrapUp(owner); }
@Override void wrapUp(GitHub root) { super.wrapUp(root); if (pull_request==null) throw new IllegalStateException("Expected pull_request payload, but got something else. Maybe we've got another type of event?"); if (repository!=null) { repository.wrap(root); pull_request.wrap(repository); } else { pull_request.wrapUp(root); } } }
/** * Repopulates this object. */ public void refresh() throws IOException { if (root.isOffline()) { return; // cannot populate, will have to live with what we have } root.retrieve().to(url, this).wrapUp(owner); }
/** * Retrieves a specified pull request. */ public GHPullRequest getPullRequest(int i) throws IOException { return root.retrieve().to(getApiTailUrl("pulls/" + i), GHPullRequest.class).wrapUp(this); }
/** * Repopulates this object. */ public void refresh() throws IOException { if (root.isOffline()) { return; // cannot populate, will have to live with what we have } root.retrieve().to(url, this).wrapUp(owner); }
/** * Retrieves a specified pull request. */ public GHPullRequest getPullRequest(int i) throws IOException { return root.retrieve().to(getApiTailUrl("pulls/" + i), GHPullRequest.class).wrapUp(this); }
/** * Retrieves a specified pull request. */ public GHPullRequest getPullRequest(int i) throws IOException { return root.retrieve().to(getApiTailUrl("pulls/" + i), GHPullRequest.class).wrapUp(this); }
/** * Creates a new pull request. * * @param title * Required. The title of the pull request. * @param head * Required. The name of the branch where your changes are implemented. * For cross-repository pull requests in the same network, * namespace head with a user like this: username:branch. * @param base * Required. The name of the branch you want your changes pulled into. * This should be an existing branch on the current repository. * @param body * The contents of the pull request. This is the markdown description * of a pull request. */ public GHPullRequest createPullRequest(String title, String head, String base, String body) throws IOException { return new Requester(root).with("title",title) .with("head",head) .with("base",base) .with("body",body).to(getApiTailUrl("pulls"),GHPullRequest.class).wrapUp(this); }
/** * Creates a new pull request. * * @param title * Required. The title of the pull request. * @param head * Required. The name of the branch where your changes are implemented. * For cross-repository pull requests in the same network, * namespace head with a user like this: username:branch. * @param base * Required. The name of the branch you want your changes pulled into. * This should be an existing branch on the current repository. * @param body * The contents of the pull request. This is the markdown description * of a pull request. */ public GHPullRequest createPullRequest(String title, String head, String base, String body) throws IOException { return new Requester(root).with("title",title) .with("head",head) .with("base",base) .with("body",body).to(getApiTailUrl("pulls"),GHPullRequest.class).wrapUp(this); }
/** * Creates a new pull request. * * @param title * Required. The title of the pull request. * @param head * Required. The name of the branch where your changes are implemented. * For cross-repository pull requests in the same network, * namespace head with a user like this: username:branch. * @param base * Required. The name of the branch you want your changes pulled into. * This should be an existing branch on the current repository. * @param body * The contents of the pull request. This is the markdown description * of a pull request. */ public GHPullRequest createPullRequest(String title, String head, String base, String body) throws IOException { return new Requester(root).with("title",title) .with("head",head) .with("base",base) .with("body",body).to(getApiTailUrl("pulls"),GHPullRequest.class).wrapUp(this); }