mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 10:51:14 +00:00
Merge RequiredStatusChecks type stub back to source (#2647)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from github.GithubObject import CompletableGithubObject
|
||||
|
||||
class RequiredStatusChecks(CompletableGithubObject):
|
||||
def __repr__(self) -> str: ...
|
||||
def _initAttributes(self) -> None: ...
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
|
||||
@property
|
||||
def contexts(self) -> List[str]: ...
|
||||
@property
|
||||
def strict(self) -> bool: ...
|
||||
@property
|
||||
def url(self) -> str: ...
|
||||
Reference in New Issue
Block a user