aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/pulls_reviews.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/go-github/github/pulls_reviews.go')
-rw-r--r--vendor/github.com/google/go-github/github/pulls_reviews.go29
1 files changed, 15 insertions, 14 deletions
diff --git a/vendor/github.com/google/go-github/github/pulls_reviews.go b/vendor/github.com/google/go-github/github/pulls_reviews.go
index be57af8..c27b6a8 100644
--- a/vendor/github.com/google/go-github/github/pulls_reviews.go
+++ b/vendor/github.com/google/go-github/github/pulls_reviews.go
@@ -6,6 +6,7 @@
package github
import (
+ "context"
"fmt"
"time"
)
@@ -64,7 +65,7 @@ func (r PullRequestReviewDismissalRequest) String() string {
// Read more about it here - https://github.com/google/go-github/issues/540
//
// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#list-reviews-on-a-pull-request
-func (s *PullRequestsService) ListReviews(owner, repo string, number int) ([]*PullRequestReview, *Response, error) {
+func (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo string, number int) ([]*PullRequestReview, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number)
req, err := s.client.NewRequest("GET", u, nil)
@@ -76,7 +77,7 @@ func (s *PullRequestsService) ListReviews(owner, repo string, number int) ([]*Pu
req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
var reviews []*PullRequestReview
- resp, err := s.client.Do(req, &reviews)
+ resp, err := s.client.Do(ctx, req, &reviews)
if err != nil {
return nil, resp, err
}
@@ -91,7 +92,7 @@ func (s *PullRequestsService) ListReviews(owner, repo string, number int) ([]*Pu
// Read more about it here - https://github.com/google/go-github/issues/540
//
// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#get-a-single-review
-func (s *PullRequestsService) GetReview(owner, repo string, number, reviewID int) (*PullRequestReview, *Response, error) {
+func (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, number, reviewID int) (*PullRequestReview, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID)
req, err := s.client.NewRequest("GET", u, nil)
@@ -103,7 +104,7 @@ func (s *PullRequestsService) GetReview(owner, repo string, number, reviewID int
req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
review := new(PullRequestReview)
- resp, err := s.client.Do(req, review)
+ resp, err := s.client.Do(ctx, req, review)
if err != nil {
return nil, resp, err
}
@@ -118,7 +119,7 @@ func (s *PullRequestsService) GetReview(owner, repo string, number, reviewID int
// Read more about it here - https://github.com/google/go-github/issues/540
//
// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#delete-a-pending-review
-func (s *PullRequestsService) DeletePendingReview(owner, repo string, number, reviewID int) (*PullRequestReview, *Response, error) {
+func (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, repo string, number, reviewID int) (*PullRequestReview, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID)
req, err := s.client.NewRequest("DELETE", u, nil)
@@ -130,7 +131,7 @@ func (s *PullRequestsService) DeletePendingReview(owner, repo string, number, re
req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
review := new(PullRequestReview)
- resp, err := s.client.Do(req, review)
+ resp, err := s.client.Do(ctx, req, review)
if err != nil {
return nil, resp, err
}
@@ -145,7 +146,7 @@ func (s *PullRequestsService) DeletePendingReview(owner, repo string, number, re
// Read more about it here - https://github.com/google/go-github/issues/540
//
// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#get-a-single-reviews-comments
-func (s *PullRequestsService) ListReviewComments(owner, repo string, number, reviewID int) ([]*PullRequestComment, *Response, error) {
+func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, repo string, number, reviewID int) ([]*PullRequestComment, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/comments", owner, repo, number, reviewID)
req, err := s.client.NewRequest("GET", u, nil)
@@ -157,7 +158,7 @@ func (s *PullRequestsService) ListReviewComments(owner, repo string, number, rev
req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
var comments []*PullRequestComment
- resp, err := s.client.Do(req, &comments)
+ resp, err := s.client.Do(ctx, req, &comments)
if err != nil {
return nil, resp, err
}
@@ -172,7 +173,7 @@ func (s *PullRequestsService) ListReviewComments(owner, repo string, number, rev
// Read more about it here - https://github.com/google/go-github/issues/540
//
// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review
-func (s *PullRequestsService) CreateReview(owner, repo string, number int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) {
+func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo string, number int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number)
req, err := s.client.NewRequest("POST", u, review)
@@ -184,7 +185,7 @@ func (s *PullRequestsService) CreateReview(owner, repo string, number int, revie
req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
r := new(PullRequestReview)
- resp, err := s.client.Do(req, r)
+ resp, err := s.client.Do(ctx, req, r)
if err != nil {
return nil, resp, err
}
@@ -199,7 +200,7 @@ func (s *PullRequestsService) CreateReview(owner, repo string, number int, revie
// Read more about it here - https://github.com/google/go-github/issues/540
//
// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#submit-a-pull-request-review
-func (s *PullRequestsService) SubmitReview(owner, repo string, number, reviewID int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) {
+func (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo string, number, reviewID int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/events", owner, repo, number, reviewID)
req, err := s.client.NewRequest("POST", u, review)
@@ -211,7 +212,7 @@ func (s *PullRequestsService) SubmitReview(owner, repo string, number, reviewID
req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
r := new(PullRequestReview)
- resp, err := s.client.Do(req, r)
+ resp, err := s.client.Do(ctx, req, r)
if err != nil {
return nil, resp, err
}
@@ -226,7 +227,7 @@ func (s *PullRequestsService) SubmitReview(owner, repo string, number, reviewID
// Read more about it here - https://github.com/google/go-github/issues/540
//
// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#dismiss-a-pull-request-review
-func (s *PullRequestsService) DismissReview(owner, repo string, number, reviewID int, review *PullRequestReviewDismissalRequest) (*PullRequestReview, *Response, error) {
+func (s *PullRequestsService) DismissReview(ctx context.Context, owner, repo string, number, reviewID int, review *PullRequestReviewDismissalRequest) (*PullRequestReview, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d/dismissals", owner, repo, number, reviewID)
req, err := s.client.NewRequest("PUT", u, review)
@@ -238,7 +239,7 @@ func (s *PullRequestsService) DismissReview(owner, repo string, number, reviewID
req.Header.Set("Accept", mediaTypePullRequestReviewsPreview)
r := new(PullRequestReview)
- resp, err := s.client.Do(req, r)
+ resp, err := s.client.Do(ctx, req, r)
if err != nil {
return nil, resp, err
}