diff options
author | John L. Villalovos <john@sodarock.com> | 2021-11-26 11:54:33 -0800 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-11-26 20:19:51 -0800 |
commit | 68ff595967a5745b369a93d9d18fef48b65ebedb (patch) | |
tree | 724ae3c4d49af69a7345a916009867c35d976b01 /gitlab/v4/objects/projects.py | |
parent | 8d4c95358c9e61c1cfb89562252498093f56d269 (diff) | |
download | gitlab-jlvillal/project_groups.tar.gz |
feat: add support for `projects.groups.list()`jlvillal/project_groups
Add support for `projects.groups.list()` endpoint.
Closes #1717
Diffstat (limited to 'gitlab/v4/objects/projects.py')
-rw-r--r-- | gitlab/v4/objects/projects.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py index c5ce717..272688a 100644 --- a/gitlab/v4/objects/projects.py +++ b/gitlab/v4/objects/projects.py @@ -109,6 +109,24 @@ class GroupProjectManager(ListMixin, RESTManager): ) +class ProjectGroup(RESTObject): + pass + + +class ProjectGroupManager(ListMixin, RESTManager): + _path = "/projects/{project_id}/groups" + _obj_cls = ProjectGroup + _from_parent_attrs = {"project_id": "id"} + _list_filters = ( + "search", + "skip_groups", + "with_shared", + "shared_min_access_level", + "shared_visible_only", + ) + _types = {"skip_groups": types.ListAttribute} + + class Project(RefreshMixin, SaveMixin, ObjectDeleteMixin, RepositoryMixin, RESTObject): _short_print_attr = "path" @@ -132,6 +150,7 @@ class Project(RefreshMixin, SaveMixin, ObjectDeleteMixin, RepositoryMixin, RESTO files: ProjectFileManager forks: "ProjectForkManager" generic_packages: GenericPackageManager + groups: ProjectGroupManager hooks: ProjectHookManager imports: ProjectImportManager issues: ProjectIssueManager |