8000 add time_stats to ProjectMergeRequest · uglide/python-gitlab@63a11f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 63a11f5

Browse files
committed
add time_stats to ProjectMergeRequest
1 parent c545504 commit 63a11f5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

gitlab/objects.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,6 +1837,18 @@ def todo(self, **kwargs):
18371837
r = self.gitlab._raw_post(url, **kwargs)
18381838
raise_error_from_response(r, GitlabTodoError, [201, 304])
18391839

1840+
def time_stats(self, **kwargs):
1841+
"""Get time stats for the merge request.
1842+
1843+
Raises:
1844+
GitlabConnectionError: If the server cannot be reached.
1845+
"""
1846+
url = ('/projects/%(project_id)s/merge_requests/%(mr_id)s/time_stats' %
1847+
{'project_id': self.project_id, 'mr_id': self.id})
1848+
r = self.gitlab._raw_get(url, **kwargs)
1849+
raise_error_from_response(r, GitlabGetError)
1850+
return r.json()
1851+
18401852

18411853
class ProjectMergeRequestManager(BaseManager):
18421854
obj_cls = ProjectMergeRequest

0 commit comments

Comments
 (0)
0