Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit29e735d

Browse files
author
Gauvain Pocentek
committed
[v4] Triggers: update object
* Add support for the description attribute* Add ``take_ownership`` support* Triggers now use ``id`` as identifier
1 parent5ea7f84 commit29e735d

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

‎gitlab/v4/objects.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,9 +1590,22 @@ class ProjectSnippetManager(BaseManager):
15901590

15911591
classProjectTrigger(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+
deftake_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

15981611
classProjectTriggerManager(BaseManager):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp