Skip to content

Commit

Permalink
Add support for project events.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mart Sõmermaa committed Nov 19, 2013
1 parent 6705928 commit 32d4224
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions gitlab.py
Expand Up @@ -683,6 +683,16 @@ class ProjectKey(GitlabObject):
requiredCreateAttrs = ['project_id', 'title', 'key']


class ProjectEvent(GitlabObject):
_url = '/projects/%(project_id)s/events'
canGet = False
canDelete = False
canUpdate = False
canCreate = False
requiredListAttrs = ['project_id']
shortPrintAttr = 'target_title'


class ProjectHook(GitlabObject):
_url = '/projects/%(project_id)s/hooks'
requiredListAttrs = ['project_id']
Expand Down Expand Up @@ -844,6 +854,11 @@ def Commit(self, id=None, **kwargs):
project_id=self.id,
**kwargs)

def Event(self, id=None, **kwargs):
return self._getListOrObject(ProjectEvent, id,
project_id=self.id,
**kwargs)

def Hook(self, id=None, **kwargs):
return self._getListOrObject(ProjectHook, id,
project_id=self.id,
Expand Down

0 comments on commit 32d4224

Please sign in to comment.