New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for new pull request review API #497
Changes from 1 commit
354caf4
36c6f8c
a8392c4
1ce3518
5182678
178c4ed
a8df51b
cd49c5c
167e217
99df209
c60f5b3
cd5b665
109ded2
2bd08d4
87729c2
a176b03
e3b5e69
a1bf055
91cc8ae
bfda8ba
36dbd69
0c0faa4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,29 @@ func (s *PullRequestsService) GetReview(owner string, repo string, number int, r | |
return review, resp, err | ||
} | ||
|
||
// DeletePendingReview deletes the specified pull request pending review. | ||
// | ||
// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#delete-a-pending-review | ||
func (s *PullRequestsService) DeletePendingReview(owner string, repo string, number int, reviewID int) (*PullRequestReview, *Response, error) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM 馃憤 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews/%d", owner, repo, number, reviewID) | ||
|
||
req, err := s.client.NewRequest("DELETE", u, nil) | ||
if err != nil { | ||
return nil, nil, err | ||
} | ||
|
||
// TODO: remove custom Accept header when this API fully launches | ||
req.Header.Set("Accept", mediaTypePullRequestReviewsPreview) | ||
|
||
review := new(PullRequestReview) | ||
resp, err := s.client.Do(req, review) | ||
if err != nil { | ||
return nil, resp, err | ||
} | ||
|
||
return review, resp, err | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
// ListReviewComments lists all the comments for the specified review. | ||
// | ||
// GitHub API docs: https://developer.github.com/v3/pulls/reviews/#get-a-single-reviews-comments | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return review, resp, nil