summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects
diff options
context:
space:
mode:
authorJacob Henner <code@ventricle.us>2021-03-10 20:30:57 -0500
committerJacob Henner <code@ventricle.us>2021-03-10 20:30:57 -0500
commitb9d469bc4e847ae0301be28a0c70019a7f6ab8b6 (patch)
tree9c9ea39fcf7c229bab53ae3e2726bcda001c9641 /gitlab/v4/objects
parent6fde2437e82aeb8af903f81e351790b4695074a1 (diff)
downloadgitlab-b9d469bc4e847ae0301be28a0c70019a7f6ab8b6.tar.gz
feat: add ProjectPackageFile
Add ProjectPackageFile and the ability to list project package package_files. Fixes #1372
Diffstat (limited to 'gitlab/v4/objects')
-rw-r--r--gitlab/v4/objects/packages.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/gitlab/v4/objects/packages.py b/gitlab/v4/objects/packages.py
index 3e64685..f5ca081 100644
--- a/gitlab/v4/objects/packages.py
+++ b/gitlab/v4/objects/packages.py
@@ -1,12 +1,13 @@
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import DeleteMixin, GetMixin, ListMixin, ObjectDeleteMixin
-
__all__ = [
"GroupPackage",
"GroupPackageManager",
"ProjectPackage",
"ProjectPackageManager",
+ "ProjectPackageFile",
+ "ProjectPackageFileManager",
]
@@ -28,7 +29,7 @@ class GroupPackageManager(ListMixin, RESTManager):
class ProjectPackage(ObjectDeleteMixin, RESTObject):
- pass
+ _managers = (("package_files", "ProjectPackageFileManager"),)
class ProjectPackageManager(ListMixin, GetMixin, DeleteMixin, RESTManager):
@@ -41,3 +42,13 @@ class ProjectPackageManager(ListMixin, GetMixin, DeleteMixin, RESTManager):
"package_type",
"package_name",
)
+
+
+class ProjectPackageFile(RESTObject):
+ pass
+
+
+class ProjectPackageFileManager(ListMixin, RESTManager):
+ _path = "/projects/%(project_id)s/packages/%(package_id)s/package_files"
+ _obj_cls = ProjectPackageFile
+ _from_parent_attrs = {"project_id": "project_id", "package_id": "id"}