mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Add support for 'visibility' attribute preview for Repositories (#1872)
Expose the new 'visibility' attribute for repository objects. Fixes #1446
This commit is contained in:
@@ -787,6 +787,14 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._url.value
|
||||
|
||||
@property
|
||||
def visibility(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._visibility)
|
||||
return self._visibility.value
|
||||
|
||||
@property
|
||||
def watchers(self):
|
||||
"""
|
||||
@@ -3759,6 +3767,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
self._trees_url = github.GithubObject.NotSet
|
||||
self._updated_at = github.GithubObject.NotSet
|
||||
self._url = github.GithubObject.NotSet
|
||||
self._visibility = github.GithubObject.NotSet
|
||||
self._watchers = github.GithubObject.NotSet
|
||||
self._watchers_count = github.GithubObject.NotSet
|
||||
|
||||
@@ -3965,6 +3974,8 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
|
||||
if "url" in attributes: # pragma no branch
|
||||
self._url = self._makeStringAttribute(attributes["url"])
|
||||
if "visibility" in attributes: # pragma no branch
|
||||
self._visibility = self._makeStringAttribute(attributes["visibility"])
|
||||
if "watchers" in attributes: # pragma no branch
|
||||
self._watchers = self._makeIntAttribute(attributes["watchers"])
|
||||
if "watchers_count" in attributes: # pragma no branch
|
||||
|
||||
Reference in New Issue
Block a user