diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2018-05-28 14:09:21 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2018-05-28 14:09:21 +0200 |
commit | e901f440d787c1fd43fdba1838a1f37066329ccf (patch) | |
tree | f37c6565a8676d38941b2385619db9a2f403fe24 /gitlab/mixins.py | |
parent | 4ec8975982290f3950d629f0fd7c73f351ead84f (diff) | |
download | gitlab-e901f440d787c1fd43fdba1838a1f37066329ccf.tar.gz |
Issues: add missing attributes and methods
Diffstat (limited to 'gitlab/mixins.py')
-rw-r--r-- | gitlab/mixins.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gitlab/mixins.py b/gitlab/mixins.py index 988042b..7148ccd 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -545,3 +545,29 @@ class TimeTrackingMixin(object): """ path = '%s/%s/reset_spent_time' % (self.manager.path, self.get_id()) return self.manager.gitlab.http_post(path, **kwargs) + + +class ParticipantsMixin(object): + @cli.register_custom_action('ProjectMergeRequest', 'ProjectIssue') + @exc.on_http_error(exc.GitlabListError) + def participants(self, **kwargs): + """List the 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) |