mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
Adds the 'twitter_username' attribute to NamedUser. (#1585)
* Adds the 'twitter_username' attribute to NamedUser.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user