Merge Permissions type stub back to source (#2648)

Co-authored-by: Enrico Minack <github@enrico.minack.dev>
This commit is contained in:
Trim21
2023-08-17 21:41:02 +02:00
committed by GitHub
co-authored by Enrico Minack
parent 22c208ac1c
commit 09025b97b3
2 changed files with 14 additions and 48 deletions
+14 -30
View File
@@ -27,17 +27,23 @@
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
# #
################################################################################
from typing import Any, Dict
import github.GithubObject
from github.GithubObject import Attribute, NonCompletableGithubObject, NotSet
class Permissions(github.GithubObject.NonCompletableGithubObject):
class Permissions(NonCompletableGithubObject):
"""
This class represents Permissions
"""
def _initAttributes(self) -> None:
self._admin: Attribute[bool] = NotSet
self._maintain: Attribute[bool] = NotSet
self._pull: Attribute[bool] = NotSet
self._push: Attribute[bool] = NotSet
self._triage: Attribute[bool] = NotSet
def __repr__(self) -> str:
return self.get__repr__(
{
@@ -50,47 +56,25 @@ class Permissions(github.GithubObject.NonCompletableGithubObject):
)
@property
def admin(self):
"""
:type: bool
"""
def admin(self) -> bool:
return self._admin.value
@property
def maintain(self):
"""
:type: bool
"""
def maintain(self) -> bool:
return self._maintain.value
@property
def pull(self):
"""
:type: bool
"""
def pull(self) -> bool:
return self._pull.value
@property
def push(self):
"""
:type: bool
"""
def push(self) -> bool:
return self._push.value
@property
def triage(self):
"""
:type: bool
"""
def triage(self) -> bool:
return self._triage.value
def _initAttributes(self) -> None:
self._admin = github.GithubObject.NotSet
self._maintain = github.GithubObject.NotSet
self._pull = github.GithubObject.NotSet
self._push = github.GithubObject.NotSet
self._triage = github.GithubObject.NotSet
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
if "admin" in attributes: # pragma no branch
self._admin = self._makeBoolAttribute(attributes["admin"])
-18
View File
@@ -1,18 +0,0 @@
from typing import Any, Dict
from github.GithubObject import NonCompletableGithubObject
class Permissions(NonCompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def admin(self) -> bool: ...
@property
def maintain(self) -> bool: ...
@property
def pull(self) -> bool: ...
@property
def push(self) -> bool: ...
@property
def triage(self) -> bool: ...