feat: add allow_forking to Repository (#2380)

* chore(dependency): flake8 has moved to github

* feat: add allow_forking to Repository

* chore: linting

Co-authored-by: hussaiia <ibrahim.hussaini@cba.com.au>
This commit is contained in:
Ibrahim Hussaini
2022-12-15 11:05:02 +08:00
committed by GitHub
co-authored by hussaiia
parent 7902351d4f
commit 6c53e5442a
4 changed files with 22 additions and 3 deletions
+17
View File
@@ -158,6 +158,14 @@ class Repository(github.GithubObject.CompletableGithubObject):
def __repr__(self):
return self.get__repr__({"full_name": self._full_name.value})
@property
def allow_forking(self):
"""
:type: bool
"""
self._completeIfNotSet(self._allow_forking)
return self._allow_forking.value
@property
def allow_merge_commit(self):
"""
@@ -1552,6 +1560,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
has_wiki=github.GithubObject.NotSet,
has_downloads=github.GithubObject.NotSet,
default_branch=github.GithubObject.NotSet,
allow_forking=github.GithubObject.NotSet,
allow_squash_merge=github.GithubObject.NotSet,
allow_merge_commit=github.GithubObject.NotSet,
allow_rebase_merge=github.GithubObject.NotSet,
@@ -1603,6 +1612,9 @@ class Repository(github.GithubObject.CompletableGithubObject):
assert default_branch is github.GithubObject.NotSet or isinstance(
default_branch, str
), default_branch
assert allow_forking is github.GithubObject.NotSet or isinstance(
allow_forking, bool
), allow_forking
assert allow_squash_merge is github.GithubObject.NotSet or isinstance(
allow_squash_merge, bool
), allow_squash_merge
@@ -1639,6 +1651,8 @@ class Repository(github.GithubObject.CompletableGithubObject):
post_parameters["default_branch"] = default_branch
if allow_squash_merge is not github.GithubObject.NotSet:
post_parameters["allow_squash_merge"] = allow_squash_merge
if allow_forking is not github.GithubObject.NotSet:
post_parameters["allow_forking"] = allow_forking
if allow_merge_commit is not github.GithubObject.NotSet:
post_parameters["allow_merge_commit"] = allow_merge_commit
if allow_rebase_merge is not github.GithubObject.NotSet:
@@ -3787,6 +3801,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
)
def _initAttributes(self):
self._allow_forking = github.GithubObject.NotSet
self._allow_merge_commit = github.GithubObject.NotSet
self._allow_rebase_merge = github.GithubObject.NotSet
self._allow_squash_merge = github.GithubObject.NotSet
@@ -3873,6 +3888,8 @@ class Repository(github.GithubObject.CompletableGithubObject):
self._watchers_count = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "allow_forking" in attributes: # pragma no branch
self._allow_forking = self._makeBoolAttribute(attributes["allow_forking"])
if "allow_merge_commit" in attributes: # pragma no branch
self._allow_merge_commit = self._makeBoolAttribute(
attributes["allow_merge_commit"]