File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -1590,9 +1590,22 @@ class ProjectSnippetManager(BaseManager):
15901590
15911591class ProjectTrigger (GitlabObject ):
15921592 _url = '/projects/%(project_id)s/triggers'
1593- canUpdate = False
1594- idAttr = 'token'
1595- requiredUrlAttrs = ['project_id' , 'description' ]
1593+ requiredUrlAttrs = ['project_id' ]
1594+ requiredCreateAttrs = ['description' ]
1595+ optionalUpdateAttrs = ['description' ]
1596+
1597+ def take_ownership (self , ** kwargs ):
1598+ """Update the owner of a trigger.
1599+
1600+ Raises:
1601+ GitlabConnectionError: If the server cannot be reached.
1602+ GitlabGetError: If the server fails to perform the request.
1603+ """
1604+ url = ('/projects/%(project_id)s/triggers/%(id)s/take_ownership' %
1605+ {'project_id' : self .project_id , 'id' : self .id })
1606+ r = self .gitlab ._raw_post (url , ** kwargs )
1607+ raise_error_from_response (r , GitlabUpdateError , 200 )
1608+ self ._set_from_dict (r .json ())
15961609
15971610
15981611class ProjectTriggerManager (BaseManager ):
You can’t perform that action at this time.
0 commit comments