File tree 1 file changed +16
-3
lines changed
1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -1590,9 +1590,22 @@ class ProjectSnippetManager(BaseManager):
1590
1590
1591
1591
class ProjectTrigger (GitlabObject ):
1592
1592
_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 ())
1596
1609
1597
1610
1598
1611
class ProjectTriggerManager (BaseManager ):
You can’t perform that action at this time.
0 commit comments