diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2013-03-24 11:18:58 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2013-03-24 11:18:58 +0100 |
commit | 42bef0aa598af1517810813d1bf7e10cac121690 (patch) | |
tree | 8b26add43303cc257753716c82ac7d028bb7db3f /gitlab.py | |
parent | af84700f1168ec13ca175b0eb9e64d6bd30df0a0 (diff) | |
download | gitlab-42bef0aa598af1517810813d1bf7e10cac121690.tar.gz |
support for system hooks
Diffstat (limited to 'gitlab.py')
-rw-r--r-- | gitlab.py | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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', |