Add function to delete pending reviews on a pull request (#1897)

Add a delete method to PullRequestReview to allow dismissing them.

Fixes #1856 

Co-authored-by: bagashvilit <bagashvilit@allegheny.edu>
Co-authored-by: WonjoonC <chos@allegheny.edu>
This commit is contained in:
Claire Johns
2021-10-24 15:15:31 +11:00
committed by GitHub
co-authored by bagashvilit WonjoonC
parent f1faf941ec
commit c8a945bb42
6 changed files with 69 additions and 0 deletions
+9
View File
@@ -105,6 +105,15 @@ class PullRequestReview(github.GithubObject.NonCompletableGithubObject):
input=post_parameters,
)
def delete(self):
"""
:calls: `DELETE /repos/:owner/:repo/pulls/:number/reviews/:review_id <https://developer.github.com/v3/pulls/reviews/>`_
:rtype: None
"""
headers, data = self._requester.requestJsonAndCheck(
"DELETE", f"{self.pull_request_url}/reviews/{self.id}"
)
def _initAttributes(self):
self._id = github.GithubObject.NotSet
self._user = github.GithubObject.NotSet
+1
View File
@@ -13,6 +13,7 @@ class PullRequestReview(CompletableGithubObject):
@property
def commit_id(self) -> str: ...
def dismiss(self, message: str) -> None: ...
def delete(self) -> None: ...
@property
def html_url(self) -> str: ...
@property