Skip to content

Commit f05a24b

Browse files
author
Gauvain Pocentek
authored
Merge pull request #245 from TimNN/mr-time-stats
Add time_stats to ProjectMergeRequest
2 parents c545504 + 63a11f5 commit f05a24b

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)