summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects.py
diff options
context:
space:
mode:
authorMaxime Guyot <maxime.guyot@elits.com>2018-05-23 14:40:44 +0200
committerMaxime Guyot <maxime.guyot@elits.com>2018-05-27 19:20:51 +0200
commite00cad4f73c43d28799ec6e79e32fd03e58e79b4 (patch)
treeceecfa317b6e8549efe34f2544ec91790bf1ea7c /gitlab/v4/objects.py
parent97c8619c5b07abc714417d6e5be2f553270b54a6 (diff)
downloadgitlab-e00cad4f73c43d28799ec6e79e32fd03e58e79b4.tar.gz
Add support for Project badges
Diffstat (limited to 'gitlab/v4/objects.py')
-rw-r--r--gitlab/v4/objects.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 6f40dc8..a15e3cb 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -1250,6 +1250,18 @@ class ProjectKeyManager(CRUDMixin, RESTManager):
self.gitlab.http_post(path, **kwargs)
+class ProjectBadge(SaveMixin, ObjectDeleteMixin, RESTObject):
+ pass
+
+
+class ProjectBadgeManager(CRUDMixin, RESTManager):
+ _path = '/projects/%(project_id)s/badges'
+ _obj_cls = ProjectBadge
+ _from_parent_attrs = {'project_id': 'id'}
+ _create_attrs = (('link_url', 'image_url'), tuple())
+ _update_attrs = (('link_url', 'image_url'), tuple())
+
+
class ProjectEvent(Event):
pass
@@ -2472,6 +2484,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
_short_print_attr = 'path'
_managers = (
('accessrequests', 'ProjectAccessRequestManager'),
+ ('badges', 'ProjectBadgeManager'),
('boards', 'ProjectBoardManager'),
('branches', 'ProjectBranchManager'),
('jobs', 'ProjectJobManager'),