summaryrefslogtreecommitdiff
path: root/gitlab
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2017-12-31 16:55:19 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2017-12-31 16:55:19 +0100
commit928865ef3533401163192faa0889019bc6b0cd2a (patch)
tree7e42a50b3c3c3da9dd507ac4401a3298dbdcc299 /gitlab
parent81c9d1f95ef710ccd2472bc9fe4267d8a8be4ae1 (diff)
downloadgitlab-928865ef3533401163192faa0889019bc6b0cd2a.tar.gz
Add support for subgroups listing
Closes #390
Diffstat (limited to 'gitlab')
-rw-r--r--gitlab/v4/objects.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 4cd1401..4bf6776 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -554,6 +554,18 @@ class GroupProjectManager(GetFromListMixin, RESTManager):
'ci_enabled_first')
+class GroupSubgroup(RESTObject):
+ pass
+
+
+class GroupSubgroupManager(GetFromListMixin, RESTManager):
+ _path = '/groups/%(group_id)s/subgroups'
+ _obj_cls = GroupSubgroup
+ _from_parent_attrs = {'group_id': 'id'}
+ _list_filters = ('skip_groups', 'all_available', 'search', 'order_by',
+ 'sort', 'statistics', 'owned')
+
+
class GroupVariable(SaveMixin, ObjectDeleteMixin, RESTObject):
_id_attr = 'key'
@@ -570,11 +582,12 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
_short_print_attr = 'name'
_managers = (
('accessrequests', 'GroupAccessRequestManager'),
+ ('issues', 'GroupIssueManager'),
('members', 'GroupMemberManager'),
('milestones', 'GroupMilestoneManager'),
('notificationsettings', 'GroupNotificationSettingsManager'),
('projects', 'GroupProjectManager'),
- ('issues', 'GroupIssueManager'),
+ ('subgroups', 'GroupSubgroupManager'),
('variables', 'GroupVariableManager'),
)