Add permissions field to NamedUser (#676)

This commit is contained in:
Iraquitan Cordeiro Filho
2018-01-16 13:52:52 -08:00
committed by Jason White
parent 6bc804dc15
commit 6cfe46b712
3 changed files with 20 additions and 3 deletions
+12
View File
@@ -32,6 +32,7 @@ import github.PaginatedList
import github.Gist
import github.Repository
import github.NamedUser
import github.Permissions
import github.Plan
import github.Organization
import github.Event
@@ -237,6 +238,14 @@ class NamedUser(github.GithubObject.CompletableGithubObject):
self._completeIfNotSet(self._owned_private_repos)
return self._owned_private_repos.value
@property
def permissions(self):
"""
:type: :class:`github.Permissions.Permissions`
"""
self._completeIfNotSet(self._permissions)
return self._permissions.value
@property
def plan(self):
"""
@@ -558,6 +567,7 @@ class NamedUser(github.GithubObject.CompletableGithubObject):
self._name = github.GithubObject.NotSet
self._organizations_url = github.GithubObject.NotSet
self._owned_private_repos = github.GithubObject.NotSet
self._permissions = github.GithubObject.NotSet
self._plan = github.GithubObject.NotSet
self._private_gists = github.GithubObject.NotSet
self._public_gists = github.GithubObject.NotSet
@@ -620,6 +630,8 @@ class NamedUser(github.GithubObject.CompletableGithubObject):
self._organizations_url = self._makeStringAttribute(attributes["organizations_url"])
if "owned_private_repos" in attributes: # pragma no branch
self._owned_private_repos = self._makeIntAttribute(attributes["owned_private_repos"])
if "permissions" in attributes: # pragma no branch
self._permissions = self._makeClassAttribute(github.Permissions.Permissions, attributes["permissions"])
if "plan" in attributes: # pragma no branch
self._plan = self._makeClassAttribute(github.Plan.Plan, attributes["plan"])
if "private_gists" in attributes: # pragma no branch