Add support for 'visibility' attribute preview for Repositories (#1872)

Expose the new 'visibility' attribute for repository objects.

Fixes #1446
This commit is contained in:
Tanner
2021-11-01 21:02:16 +11:00
committed by GitHub
parent 6452ddfeb4
commit 8d1397af2f
17 changed files with 56 additions and 29 deletions
+11
View File
@@ -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