diff options
Diffstat (limited to 'gitlab/v4/objects/projects.py')
-rw-r--r-- | gitlab/v4/objects/projects.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py index f4de18d..c78c8c9 100644 --- a/gitlab/v4/objects/projects.py +++ b/gitlab/v4/objects/projects.py @@ -1,6 +1,6 @@ from gitlab import cli, types, utils from gitlab import exceptions as exc -from gitlab.base import RESTManager, RESTObject +from gitlab.base import RequiredOptional, RESTManager, RESTObject from gitlab.mixins import ( CRUDMixin, CreateMixin, @@ -558,9 +558,8 @@ class Project(RefreshMixin, SaveMixin, ObjectDeleteMixin, RepositoryMixin, RESTO class ProjectManager(CRUDMixin, RESTManager): _path = "/projects" _obj_cls = Project - _create_attrs = ( - tuple(), - ( + _create_attrs = RequiredOptional( + optional=( "name", "path", "namespace_id", @@ -617,9 +616,8 @@ class ProjectManager(CRUDMixin, RESTManager): "packages_enabled", ), ) - _update_attrs = ( - tuple(), - ( + _update_attrs = RequiredOptional( + optional=( "name", "path", "default_branch", @@ -919,7 +917,7 @@ class ProjectForkManager(CreateMixin, ListMixin, RESTManager): "with_issues_enabled", "with_merge_requests_enabled", ) - _create_attrs = (tuple(), ("namespace",)) + _create_attrs = RequiredOptional(optional=("namespace",)) def create(self, data, **kwargs): """Creates a new object. @@ -949,5 +947,7 @@ class ProjectRemoteMirrorManager(ListMixin, CreateMixin, UpdateMixin, RESTManage _path = "/projects/%(project_id)s/remote_mirrors" _obj_cls = ProjectRemoteMirror _from_parent_attrs = {"project_id": "id"} - _create_attrs = (("url",), ("enabled", "only_protected_branches")) - _update_attrs = (tuple(), ("enabled", "only_protected_branches")) + _create_attrs = RequiredOptional( + required=("url",), optional=("enabled", "only_protected_branches") + ) + _update_attrs = RequiredOptional(optional=("enabled", "only_protected_branches")) |