@@ -181,7 +181,7 @@ class UserProject(RESTObject):
181
181
pass
182
182
183
183
184
- class UserProjectManager (CreateMixin , RESTManager ):
184
+ class UserProjectManager (ListMixin , CreateMixin , RESTManager ):
185
185
_path = '/projects/user/%(user_id)s'
186
186
_obj_cls = UserProject
187
187
_from_parent_attrs = {'user_id' : 'id' }
@@ -192,6 +192,31 @@ class UserProjectManager(CreateMixin, RESTManager):
192
192
'public' , 'visibility' , 'description' , 'builds_enabled' ,
193
193
'public_builds' , 'import_url' , 'only_allow_merge_if_build_succeeds' )
194
194
)
195
+ _list_filters = ('archived' , 'visibility' , 'order_by' , 'sort' , 'search' ,
196
+ 'simple' , 'owned' , 'membership' , 'starred' , 'statistics' ,
197
+ 'with_issues_enabled' , 'with_merge_requests_enabled' )
198
+
199
+ def list (self , ** kwargs ):
200
+ """Retrieve a list of objects.
201
+
202
+ Args:
203
+ all (bool): If True, return all the items, without pagination
204
+ per_page (int): Number of items to retrieve per request
205
+ page (int): ID of the page to return (starts with page 1)
206
+ as_list (bool): If set to False and no pagination option is
207
+ defined, return a generator instead of a list
208
+ **kwargs: Extra options to send to the Gitlab server (e.g. sudo)
209
+
210
+ Returns:
211
+ list: The list of objects, or a generator if `as_list` is False
212
+
213
+ Raises:
214
+ GitlabAuthenticationError: If authentication is not correct
215
+ GitlabListError: If the server cannot perform the request
216
+ """
217
+
218
+ path = '/users/%s/projects' % self ._parent .id
219
+ return ListMixin .list (self , path = path , ** kwargs )
195
220
196
221
197
222
class User (SaveMixin , ObjectDeleteMixin , RESTObject ):
0 commit comments