diff options
| author | Nejc Habjan <hab.nejc@gmail.com> | 2021-05-29 23:47:46 +0200 |
|---|---|---|
| committer | John Villalovos <john@sodarock.com> | 2021-05-29 21:06:15 -0700 |
| commit | 1b70580020825adf2d1f8c37803bc4655a97be41 (patch) | |
| tree | 8e754db6fb365ce7c7fa01e51e527e5fdded630f /gitlab | |
| parent | 237b97ceb0614821e59ea041f43a9806b65cdf8c (diff) | |
| download | gitlab-1b70580020825adf2d1f8c37803bc4655a97be41.tar.gz | |
feat(objects): add support for descendant groups API
Diffstat (limited to 'gitlab')
| -rw-r--r-- | gitlab/v4/objects/groups.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py index e29edc8..860a056 100644 --- a/gitlab/v4/objects/groups.py +++ b/gitlab/v4/objects/groups.py @@ -31,6 +31,8 @@ from .variables import GroupVariableManager # noqa: F401 __all__ = [ "Group", "GroupManager", + "GroupDescendantGroup", + "GroupDescendantGroupManager", "GroupSubgroup", "GroupSubgroupManager", ] @@ -45,6 +47,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): ("billable_members", "GroupBillableMemberManager"), ("boards", "GroupBoardManager"), ("customattributes", "GroupCustomAttributeManager"), + ("descendant_groups", "GroupDescendantGroupManager"), ("exports", "GroupExportManager"), ("epics", "GroupEpicManager"), ("imports", "GroupImportManager"), @@ -310,3 +313,17 @@ class GroupSubgroupManager(ListMixin, RESTManager): "min_access_level", ) _types = {"skip_groups": types.ListAttribute} + + +class GroupDescendantGroup(RESTObject): + pass + + +class GroupDescendantGroupManager(GroupSubgroupManager): + """ + This manager inherits from GroupSubgroupManager as descendant groups + share all attributes with subgroups, except the path and object class. + """ + + _path = "/groups/%(group_id)s/descendant_groups" + _obj_cls = GroupDescendantGroup |
