mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Merge Permissions type stub back to source (#2648)
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
This commit is contained in:
+14
-30
@@ -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"])
|
||||
|
||||
@@ -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: ...
|
||||
Reference in New Issue
Block a user