summaryrefslogtreecommitdiff
path: root/gitlab.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2013-03-24 11:18:58 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2013-03-24 11:18:58 +0100
commit42bef0aa598af1517810813d1bf7e10cac121690 (patch)
tree8b26add43303cc257753716c82ac7d028bb7db3f /gitlab.py
parentaf84700f1168ec13ca175b0eb9e64d6bd30df0a0 (diff)
downloadgitlab-42bef0aa598af1517810813d1bf7e10cac121690.tar.gz
support for system hooks
Diffstat (limited to 'gitlab.py')
-rw-r--r--gitlab.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/gitlab.py b/gitlab.py
index b28bd51..84e7ac7 100644
--- a/gitlab.py
+++ b/gitlab.py
@@ -264,6 +264,19 @@ class Gitlab(object):
else:
return cls(self, id, **kwargs)
+ def Hook(self, id=None, **kwargs):
+ """Creates/tests/lists system hook(s) known by the GitLab server.
+
+ If id is None, returns a list of hooks.
+
+ If id is an integer, test the matching hook.
+
+ If id is a dict, create a new object using attributes provided. The
+ object is NOT saved on the server. Use the save() method on the object
+ to write it on the server.
+ """
+ return self._getListOrObject(Hook, id, **kwargs)
+
def Project(self, id=None, **kwargs):
"""Creates/gets/lists project(s) known by the GitLab server.
@@ -433,6 +446,10 @@ class Group(GitlabObject):
_constructorTypes = {'projects': 'Project'}
+class Hook(GitlabObject):
+ _url = '/hooks'
+
+
class Issue(GitlabObject):
_url = '/issues'
_constructorTypes = {'author': 'User', 'assignee': 'User',