Merge RequiredStatusChecks type stub back to source (#2647)

This commit is contained in:
Trim21
2023-08-17 21:35:41 +02:00
committed by GitHub
parent bc9e829434
commit 22c208ac1c
2 changed files with 13 additions and 35 deletions
+13 -21
View File
@@ -19,50 +19,42 @@
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
# #
################################################################################
from __future__ import annotations
from typing import Any, Dict
from typing import Any
import github.GithubObject
from github.GithubObject import Attribute, CompletableGithubObject, NotSet
class RequiredStatusChecks(github.GithubObject.CompletableGithubObject):
class RequiredStatusChecks(CompletableGithubObject):
"""
This class represents Required Status Checks. The reference can be found here https://docs.github.com/en/rest/reference/repos#get-status-checks-protection
"""
def _initAttributes(self) -> None:
self._strict: Attribute[bool] = NotSet
self._contexts: Attribute[list[str]] = NotSet
self._url: Attribute[str] = NotSet
def __repr__(self) -> str:
return self.get__repr__({"strict": self._strict.value, "url": self._url.value})
@property
def strict(self):
"""
:type: bool
"""
def strict(self) -> bool:
self._completeIfNotSet(self._strict)
return self._strict.value
@property
def contexts(self):
"""
:type: list of string
"""
def contexts(self) -> list[str]:
self._completeIfNotSet(self._contexts)
return self._contexts.value
@property
def url(self):
"""
:type: string
"""
def url(self) -> str:
self._completeIfNotSet(self._url)
return self._url.value
def _initAttributes(self) -> None:
self._strict = github.GithubObject.NotSet
self._contexts = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
def _useAttributes(self, attributes: dict[str, Any]) -> None:
if "strict" in attributes: # pragma no branch
self._strict = self._makeBoolAttribute(attributes["strict"])
if "contexts" in attributes: # pragma no branch