mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 10:51:14 +00:00
Make Branch.edit_* functions return objects (#2748)
This commit is contained in:
+9
-3
@@ -134,7 +134,7 @@ class Branch(NonCompletableGithubObject):
|
||||
teams_bypass_pull_request_allowances: Opt[list[str]] = NotSet,
|
||||
apps_bypass_pull_request_allowances: Opt[list[str]] = NotSet,
|
||||
block_creations: Opt[bool] = NotSet,
|
||||
) -> None:
|
||||
) -> BranchProtection:
|
||||
"""
|
||||
:calls: `PUT /repos/{owner}/{repo}/branches/{branch}/protection <https://docs.github.com/en/rest/reference/repos#get-branch-protection>`_
|
||||
|
||||
@@ -276,6 +276,8 @@ class Branch(NonCompletableGithubObject):
|
||||
input=post_parameters,
|
||||
)
|
||||
|
||||
return github.BranchProtection.BranchProtection(self._requester, headers, data, completed=True)
|
||||
|
||||
def remove_protection(self) -> None:
|
||||
"""
|
||||
:calls: `DELETE /repos/{owner}/{repo}/branches/{branch}/protection <https://docs.github.com/en/rest/reference/repos#branches>`_
|
||||
@@ -297,7 +299,7 @@ class Branch(NonCompletableGithubObject):
|
||||
self,
|
||||
strict: Opt[bool] = NotSet,
|
||||
contexts: Opt[list[str]] = NotSet,
|
||||
) -> None:
|
||||
) -> RequiredStatusChecks:
|
||||
"""
|
||||
:calls: `PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks <https://docs.github.com/en/rest/reference/repos#branches>`_
|
||||
"""
|
||||
@@ -311,6 +313,8 @@ class Branch(NonCompletableGithubObject):
|
||||
input=post_parameters,
|
||||
)
|
||||
|
||||
return github.RequiredStatusChecks.RequiredStatusChecks(self._requester, headers, data, completed=True)
|
||||
|
||||
def remove_required_status_checks(self) -> None:
|
||||
"""
|
||||
:calls: `DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks <https://docs.github.com/en/rest/reference/repos#branches>`_
|
||||
@@ -341,7 +345,7 @@ class Branch(NonCompletableGithubObject):
|
||||
dismiss_stale_reviews: Opt[bool] = NotSet,
|
||||
require_code_owner_reviews: Opt[bool] = NotSet,
|
||||
required_approving_review_count: Opt[int] = NotSet,
|
||||
) -> None:
|
||||
) -> RequiredStatusChecks:
|
||||
"""
|
||||
:calls: `PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews <https://docs.github.com/en/rest/reference/repos#branches>`_
|
||||
"""
|
||||
@@ -373,6 +377,8 @@ class Branch(NonCompletableGithubObject):
|
||||
input=post_parameters,
|
||||
)
|
||||
|
||||
return github.RequiredStatusChecks.RequiredStatusChecks(self._requester, headers, data, completed=True)
|
||||
|
||||
def remove_required_pull_request_reviews(self) -> None:
|
||||
"""
|
||||
:calls: `DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews <https://docs.github.com/en/rest/reference/repos#branches>`_
|
||||
|
||||
Reference in New Issue
Block a user