diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-04-17 17:21:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-17 17:21:51 +0200 |
commit | d1697d4458d40a726fdf2629735deda211be8f38 (patch) | |
tree | 6adfce79726b11f48fc2303f8280d2803f39eac3 /gitlab/v4/objects/groups.py | |
parent | a6d35568fbeb44855469279ea14b6b7d53aac37f (diff) | |
parent | aee1f496c1f414c1e30909767d53ae624fe875e7 (diff) | |
download | gitlab-d1697d4458d40a726fdf2629735deda211be8f38.tar.gz |
Merge pull request #1366 from JohnVillalovos/jlvillal/create_attrs
chore: have _create_attrs & _update_attrs be a namedtuple
Diffstat (limited to 'gitlab/v4/objects/groups.py')
-rw-r--r-- | gitlab/v4/objects/groups.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py index e859e0e..588c506 100644 --- a/gitlab/v4/objects/groups.py +++ b/gitlab/v4/objects/groups.py @@ -1,6 +1,6 @@ from gitlab import cli, types from gitlab import exceptions as exc -from gitlab.base import RESTManager, RESTObject +from gitlab.base import RequiredOptional, RESTManager, RESTObject from gitlab.mixins import CRUDMixin, ListMixin, ObjectDeleteMixin, SaveMixin from .access_requests import GroupAccessRequestManager from .audit_events import GroupAuditEventManager @@ -202,9 +202,9 @@ class GroupManager(CRUDMixin, RESTManager): "with_custom_attributes", "min_access_level", ) - _create_attrs = ( - ("name", "path"), - ( + _create_attrs = RequiredOptional( + required=("name", "path"), + optional=( "description", "membership_lock", "visibility", @@ -223,9 +223,8 @@ class GroupManager(CRUDMixin, RESTManager): "default_branch_protection", ), ) - _update_attrs = ( - tuple(), - ( + _update_attrs = RequiredOptional( + optional=( "name", "path", "description", |