MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / get_protection

Method get_protection

github/Branch.py:151–160  ·  view source on GitHub ↗

:calls: `GET /repos/{owner}/{repo}/branches/{branch}/protection `_

(self)

Source from the content-addressed store, hash-verified

149 return self._url.value
150
151 def get_protection(self) -> BranchProtection:
152 """
153 :calls: `GET /repos/{owner}/{repo}/branches/{branch}/protection <https://docs.github.com/en/rest/reference/repos#branches>`_
154 """
155 headers, data = self._requester.requestJsonAndCheck(
156 "GET",
157 self.protection_url,
158 headers={"Accept": Consts.mediaTypeRequireMultipleApprovingReviews},
159 )
160 return github.BranchProtection.BranchProtection(self._requester, headers, data, completed=True)
161
162 def edit_protection(
163 self,

Callers 5

protectionMethod · 0.95
setUpMethod · 0.80
testEditProtectionMethod · 0.80
testRemoveProtectionMethod · 0.80

Calls 1

requestJsonAndCheckMethod · 0.80

Tested by

no test coverage detected