Module: Octokit::Client::Reviews
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/octokit/client/reviews.rb |
Overview
Methods for the Reviews
API
Instance Method Summary
-
#create_pull_request_review(repo, number, options = {}) ⇒ Sawyer::Resource
Create a pull request review.
-
#delete_pull_request_review(repo, number, review, options = {}) ⇒ Sawyer::Resource
Delete a pending review.
-
#delete_pull_request_review_request(repo, id, reviewers = {}, options = {}) ⇒ Sawyer::Resource
Delete a review request.
-
#dismiss_pull_request_review(repo, number, review, message, options = {}) ⇒ Sawyer::Resource
Dismiss a pull request review.
-
#pull_request_review(repo, number, review, options = {}) ⇒ Sawyer::Resource
Get a single review.
-
#pull_request_review_comments(repo, number, review, options = {}) ⇒ Array<Sawyer::Resource>
Get comments for a single review.
-
#pull_request_review_requests(repo, number, options = {}) ⇒ Array<Sawyer::Resource>
List review requests.
-
#pull_request_reviews(repo, number, options = {}) ⇒ Array<Sawyer::Resource>
List reviews on a pull request.
-
#request_pull_request_review(repo, number, reviewers = {}, options = {}) ⇒ Sawyer::Resource
Create a review request.
-
#submit_pull_request_review(repo, number, review, event, options = {}) ⇒ Sawyer::Resource
Submit a pull request review.
-
#update_pull_request_review(repo, number, review, body, options = {}) ⇒ Sawyer::Resource
Update a review request comment.
Instance Method Details
#create_pull_request_review(repo, number, options = {}) ⇒ Sawyer::Resource
Create a pull request review
# File 'lib/octokit/client/reviews.rb', line 92
def create_pull_request_review(repo, number, = {}) post "#{Repository.path repo}/pulls/#{number}/reviews", end
#delete_pull_request_review(repo, number, review, options = {}) ⇒ Sawyer::Resource
Delete a pending review
# File 'lib/octokit/client/reviews.rb', line 49
def delete_pull_request_review(repo, number, review, = {}) delete "#{Repository.path repo}/pulls/#{number}/reviews/#{review}", end
#delete_pull_request_review_request(repo, id, reviewers = {}, options = {}) ⇒ Sawyer::Resource
Delete a review request
# File 'lib/octokit/client/reviews.rb', line 193
def delete_pull_request_review_request(repo, id, reviewers = {}, = {}) # TODO(5.0): remove deprecated behavior if !reviewers.empty? && ! .empty? octokit_warn( 'Deprecated: Octokit::Client#delete_pull_request_review_request ' \ "no longer takes a separate :reviewers argument.\n" \ 'Please update your call to pass :reviewers and :team_reviewers as part of the options hash.' ) end # For backwards compatibility, this endpoint can be called with a separate reviewers hash. # If not called with a separate hash, then 'reviewers' is, in fact, 'options'. = .merge(reviewers) delete "#{Repository.path repo}/pulls/#{id}/requested_reviewers", end
#dismiss_pull_request_review(repo, number, review, message, options = {}) ⇒ Sawyer::Resource
Dismiss a pull request review
# File 'lib/octokit/client/reviews.rb', line 129
def dismiss_pull_request_review(repo, number, review, , = {}) = .merge(message: ) put "#{Repository.path repo}/pulls/#{number}/reviews/#{review}/dismissals", end
#pull_request_review(repo, number, review, options = {}) ⇒ Sawyer::Resource
Get a single review
# File 'lib/octokit/client/reviews.rb', line 34
def pull_request_review(repo, number, review, = {}) get "#{Repository.path repo}/pulls/#{number}/reviews/#{review}", end
#pull_request_review_comments(repo, number, review, options = {}) ⇒ Array
<Sawyer::Resource
>
Get comments for a single review
# File 'lib/octokit/client/reviews.rb', line 64
def pull_request_review_comments(repo, number, review, = {}) paginate "#{Repository.path repo}/pulls/#{number}/reviews/#{review}/comments", end
#pull_request_review_requests(repo, number, options = {}) ⇒ Array
<Sawyer::Resource
>
List review requests
# File 'lib/octokit/client/reviews.rb', line 144
def pull_request_review_requests(repo, number, = {}) paginate "#{Repository.path repo}/pulls/#{number}/requested_reviewers", end
#pull_request_reviews(repo, number, options = {}) ⇒ Array
<Sawyer::Resource
>
List reviews on a pull request
# File 'lib/octokit/client/reviews.rb', line 19
def pull_request_reviews(repo, number, = {}) paginate "#{Repository.path repo}/pulls/#{number}/reviews", end
#request_pull_request_review(repo, number, reviewers = {}, options = {}) ⇒ Sawyer::Resource
Create a review request
# File 'lib/octokit/client/reviews.rb', line 160
def request_pull_request_review(repo, number, reviewers = {}, = {}) # TODO(5.0): remove deprecated behavior if reviewers.is_a?(Array) octokit_warn( 'Deprecated: Octokit::Client#request_pull_request_review ' \ "no longer takes a separate :reviewers argument.\n" \ 'Please update your call to pass :reviewers and :team_reviewers as part of the options hash.' ) = .merge(reviewers: reviewers) else = .merge(reviewers) end post "#{Repository.path repo}/pulls/#{number}/requested_reviewers", end
#submit_pull_request_review(repo, number, review, event, options = {}) ⇒ Sawyer::Resource
Submit a pull request review
# File 'lib/octokit/client/reviews.rb', line 112
def submit_pull_request_review(repo, number, review, event, = {}) = .merge(event: event) post "#{Repository.path repo}/pulls/#{number}/reviews/#{review}/events", end
#update_pull_request_review(repo, number, review, body, options = {}) ⇒ Sawyer::Resource
Update a review request comment
# File 'lib/octokit/client/reviews.rb', line 221
def update_pull_request_review(repo, number, review, body, = {}) [:body] = body put "#{Repository.path repo}/pulls/#{number}/reviews/#{review}", end