Added "assignees" attribute to PullRequest object.

This commit is contained in:
@tmshn
2016-11-22 20:03:30 +09:00
parent ba007dc8a8
commit c0de6be5ea
3 changed files with 18 additions and 1 deletions
+16
View File
@@ -63,6 +63,14 @@ class PullRequest(github.GithubObject.CompletableGithubObject):
self._completeIfNotSet(self._assignee)
return self._assignee.value
@property
def assignees(self):
"""
:type: list of :class:`github.NamedUser.NamedUser`
"""
self._completeIfNotSet(self._assignees)
return self._assignees.value
@property
def base(self):
"""
@@ -518,6 +526,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject):
def _initAttributes(self):
self._additions = github.GithubObject.NotSet
self._assignee = github.GithubObject.NotSet
self._assignees = github.GithubObject.NotSet
self._base = github.GithubObject.NotSet
self._body = github.GithubObject.NotSet
self._changed_files = github.GithubObject.NotSet
@@ -556,6 +565,13 @@ class PullRequest(github.GithubObject.CompletableGithubObject):
self._additions = self._makeIntAttribute(attributes["additions"])
if "assignee" in attributes: # pragma no branch
self._assignee = self._makeClassAttribute(github.NamedUser.NamedUser, attributes["assignee"])
if "assignees" in attributes: # pragma no branch
self._assignees = self._makeListOfClassesAttribute(github.NamedUser.NamedUser, attributes["assignees"])
elif "assignee" in attributes:
if attributes["assignee"] is not None:
self._assignees = self._makeListOfClassesAttribute(github.NamedUser.NamedUser, [attributes["assignee"]])
else:
self._assignees = self._makeListOfClassesAttribute(github.NamedUser.NamedUser, [])
if "base" in attributes: # pragma no branch
self._base = self._makeClassAttribute(github.PullRequestPart.PullRequestPart, attributes["base"])
if "body" in attributes: # pragma no branch