mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
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:
co-authored by
bagashvilit
WonjoonC
parent
f1faf941ec
commit
c8a945bb42
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user