| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,6 +72,25 @@ Remove a group: | |||
| 72 | 72 | :start-after: # delete | |
| 73 | 73 | :end-before: # end delete | |
| 74 | 74 | ||
| 75 | + Subgroups | ||
| 76 | + ========= | ||
| 77 | + | ||
| 78 | + Reference | ||
| 79 | + --------- | ||
| 80 | + | ||
| 81 | + * v4 API: | ||
| 82 | + | ||
| 83 | + + :class:`gitlab.v4.objects.GroupSubgroup` | ||
| 84 | + + :class:`gitlab.v4.objects.GroupSubgroupManager` | ||
| 85 | + + :attr:`gitlab.v4.objects.Group.subgroups` | ||
| 86 | + | ||
| 87 | + Examples | ||
| 88 | + -------- | ||
| 89 | + | ||
| 90 | + List the subgroups for a group:: | ||
| 91 | + | ||
| 92 | + subgroups = group.subgroups.list() | ||
| 93 | + | ||
| 75 | 94 | Group members | |
| 76 | 95 | ============= | |
| 77 | 96 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -554,6 +554,18 @@ class GroupProjectManager(GetFromListMixin, RESTManager): | |||
| 554 | 554 | 'ci_enabled_first') | |
| 555 | 555 | ||
| 556 | 556 | ||
| 557 | + class GroupSubgroup(RESTObject): | ||
| 558 | + pass | ||
| 559 | + | ||
| 560 | + | ||
| 561 | + class GroupSubgroupManager(GetFromListMixin, RESTManager): | ||
| 562 | + _path = '/groups/%(group_id)s/subgroups' | ||
| 563 | + _obj_cls = GroupSubgroup | ||
| 564 | + _from_parent_attrs = {'group_id': 'id'} | ||
| 565 | + _list_filters = ('skip_groups', 'all_available', 'search', 'order_by', | ||
| 566 | + 'sort', 'statistics', 'owned') | ||
| 567 | + | ||
| 568 | + | ||
| 557 | 569 | class GroupVariable(SaveMixin, ObjectDeleteMixin, RESTObject): | |
| 558 | 570 | _id_attr = 'key' | |
| 559 | 571 | ||
@@ -570,11 +582,12 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): | |||
| 570 | 582 | _short_print_attr = 'name' | |
| 571 | 583 | _managers = ( | |
| 572 | 584 | ('accessrequests', 'GroupAccessRequestManager'), | |
| 585 | + ('issues', 'GroupIssueManager'), | ||
| 573 | 586 | ('members', 'GroupMemberManager'), | |
| 574 | 587 | ('milestones', 'GroupMilestoneManager'), | |
| 575 | 588 | ('notificationsettings', 'GroupNotificationSettingsManager'), | |
| 576 | 589 | ('projects', 'GroupProjectManager'), | |
| 577 | - ('issues', 'GroupIssueManager'), | ||
| 590 | + ('subgroups', 'GroupSubgroupManager'), | ||
| 578 | 591 | ('variables', 'GroupVariableManager'), | |
| 579 | 592 | ) | |
| 580 | 593 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -206,6 +206,7 @@ | |||
| 206 | 206 | assert(len(gl.groups.list()) == 3) | |
| 207 | 207 | assert(len(gl.groups.list(search='oup1')) == 1) | |
| 208 | 208 | assert(group3.parent_id == p_id) | |
| 209 | + assert(group2.subgroups.list()[0].id == group3.id) | ||
| 209 | 210 | ||
| 210 | 211 | group1.members.create({'access_level': gitlab.Group.OWNER_ACCESS, | |
| 211 | 212 | 'user_id': user1.id}) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments