Adds the 'twitter_username' attribute to NamedUser. (#1585)

* Adds the 'twitter_username' attribute to NamedUser.
This commit is contained in:
Daniel Haas
2020-06-27 14:43:48 +10:00
committed by GitHub
parent 1879518e2b
commit 079f75a726
4 changed files with 18 additions and 1 deletions
+13
View File
@@ -68,6 +68,14 @@ class NamedUser(github.GithubObject.CompletableGithubObject):
self._completeIfNotSet(self._node_id)
return self._node_id.value
@property
def twitter_username(self):
"""
:type: string
"""
self._completeIfNotSet(self._twitter_username)
return self._twitter_username.value
def __hash__(self):
return hash((self.id, self.login))
@@ -681,6 +689,7 @@ class NamedUser(github.GithubObject.CompletableGithubObject):
self._suspended_at = github.GithubObject.NotSet
self._team_count = github.GithubObject.NotSet
self._total_private_repos = github.GithubObject.NotSet
self._twitter_username = github.GithubObject.NotSet
self._type = github.GithubObject.NotSet
self._updated_at = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
@@ -784,6 +793,10 @@ class NamedUser(github.GithubObject.CompletableGithubObject):
self._total_private_repos = self._makeIntAttribute(
attributes["total_private_repos"]
)
if "twitter_username" in attributes: # pragma no branch
self._twitter_username = self._makeStringAttribute(
attributes["twitter_username"]
)
if "type" in attributes: # pragma no branch
self._type = self._makeStringAttribute(attributes["type"])
if "updated_at" in attributes: # pragma no branch
+2
View File
@@ -128,6 +128,8 @@ class NamedUser(CompletableGithubObject):
@property
def total_private_repos(self) -> Optional[int]: ...
@property
def twitter_username(self) -> str: ...
@property
def type(self) -> str: ...
@property
def updated_at(self) -> datetime: ...