Skip to content

Commit 71495d1

Browse files
committed
feat(api): add support for Packages API
1 parent f245ffb commit 71495d1

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

gitlab/v4/objects.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,23 @@ class GroupNotificationSettingsManager(NotificationSettingsManager):
12911291
_from_parent_attrs = {"group_id": "id"}
12921292

12931293

1294+
class GroupPackage(RESTObject):
1295+
pass
1296+
1297+
1298+
class GroupPackageManager(ListMixin, RESTManager):
1299+
_path = "/groups/%(group_id)s/packages"
1300+
_obj_cls = GroupPackage
1301+
_from_parent_attrs = {"group_id": "id"}
1302+
_list_filters = (
1303+
"exclude_subgroups",
1304+
"order_by",
1305+
"sort",
1306+
"package_type",
1307+
"package_name",
1308+
)
1309+
1310+
12941311
class GroupProject(RESTObject):
12951312
pass
12961313

@@ -1377,6 +1394,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
13771394
("mergerequests", "GroupMergeRequestManager"),
13781395
("milestones", "GroupMilestoneManager"),
13791396
("notificationsettings", "GroupNotificationSettingsManager"),
1397+
("packages", "GroupPackageManager"),
13801398
("projects", "GroupProjectManager"),
13811399
("runners", "GroupRunnerManager"),
13821400
("subgroups", "GroupSubgroupManager"),
@@ -2852,6 +2870,22 @@ class ProjectNotificationSettingsManager(NotificationSettingsManager):
28522870
_from_parent_attrs = {"project_id": "id"}
28532871

28542872

2873+
class ProjectPackage(ObjectDeleteMixin, RESTObject):
2874+
pass
2875+
2876+
2877+
class ProjectPackageManager(ListMixin, GetMixin, DeleteMixin, RESTManager):
2878+
_path = "/projects/%(project_id)s/packages"
2879+
_obj_cls = ProjectPackage
2880+
_from_parent_attrs = {"project_id": "id"}
2881+
_list_filters = (
2882+
"order_by",
2883+
"sort",
2884+
"package_type",
2885+
"package_name",
2886+
)
2887+
2888+
28552889
class ProjectPagesDomain(SaveMixin, ObjectDeleteMixin, RESTObject):
28562890
_id_attr = "domain"
28572891

@@ -4548,6 +4582,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
45484582
("milestones", "ProjectMilestoneManager"),
45494583
("notes", "ProjectNoteManager"),
45504584
("notificationsettings", "ProjectNotificationSettingsManager"),
4585+
("packages", "ProjectPackageManager"),
45514586
("pagesdomains", "ProjectPagesDomainManager"),
45524587
("pipelines", "ProjectPipelineManager"),
45534588
("protectedbranches", "ProjectProtectedBranchManager"),

0 commit comments

Comments
 (0)