diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2018-01-20 13:43:23 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2018-01-20 13:43:23 +0100 |
commit | 08f19b3d79dd50bab5afe58fe1b3b3825ddf9c25 (patch) | |
tree | bad244b1ab8e8ca33aa609a48c924411cb94e121 /gitlab/v4/objects.py | |
parent | 638da6946d0a731aee3392b9eafc610985691855 (diff) | |
download | gitlab-08f19b3d79dd50bab5afe58fe1b3b3825ddf9c25.tar.gz |
Add support for MR participants API
Fixes #387
Diffstat (limited to 'gitlab/v4/objects.py')
-rw-r--r-- | gitlab/v4/objects.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index e4a5447..211527d 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -1557,6 +1557,30 @@ class ProjectMergeRequest(SubscribableMixin, TodoMixin, TimeTrackingMixin, **kwargs) self._update_attrs(server_data) + @cli.register_custom_action('ProjectMergeRequest') + @exc.on_http_error(exc.GitlabListError) + def participants(self, **kwargs): + """List the merge request participants. + + Args: + all (bool): If True, return all the items, without pagination + per_page (int): Number of items to retrieve per request + page (int): ID of the page to return (starts with page 1) + as_list (bool): If set to False and no pagination option is + defined, return a generator instead of a list + **kwargs: Extra options to send to the server (e.g. sudo) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabListError: If the list could not be retrieved + + Returns: + RESTObjectList: The list of participants + """ + + path = '%s/%s/participants' % (self.manager.path, self.get_id()) + return self.manager.gitlab.http_get(path, **kwargs) + class ProjectMergeRequestManager(CRUDMixin, RESTManager): _path = '/projects/%(project_id)s/merge_requests' |