@@ -348,6 +348,13 @@ def Project(self, id=None, **kwargs):
348
348
"""
349
349
return self ._getListOrObject (Project , id , ** kwargs )
350
350
351
+ def UserProject (self , id = None , ** kwargs ):
352
+ """Creates a project for a user.
353
+
354
+ id must be a dict.
355
+ """
356
+ return self ._getListOrObject (UserProject , id , ** kwargs )
357
+
351
358
def _list_projects (self , url ):
352
359
r = self .rawGet (url )
353
360
if r .status_code != 200 :
@@ -892,6 +899,20 @@ def Note(self, id=None, **kwargs):
892
899
** kwargs )
893
900
894
901
902
+ class UserProject (GitlabObject ):
903
+ _url = '/projects/user/%(user_id)s'
904
+ _constructorTypes = {'owner' : 'User' , 'namespace' : 'Group' }
905
+ canUpdate = False
906
+ canDelete = False
907
+ canList = False
908
+ canGet = False
909
+ requiredCreateAttrs = ['name' , 'user_id' ]
910
+ optionalCreateAttrs = ['default_branch' , 'issues_enabled' , 'wall_enabled' ,
911
+ 'merge_requests_enabled' , 'wiki_enabled' ,
912
+ 'snippets_enabled' , 'public' , 'visibility_level' ,
913
+ 'description' ]
914
+
915
+
895
916
class Project (GitlabObject ):
896
917
_url = '/projects'
897
918
_constructorTypes = {'owner' : 'User' , 'namespace' : 'Group' }
@@ -900,7 +921,8 @@ class Project(GitlabObject):
900
921
requiredCreateAttrs = ['name' ]
901
922
optionalCreateAttrs = ['default_branch' , 'issues_enabled' , 'wall_enabled' ,
902
923
'merge_requests_enabled' , 'wiki_enabled' ,
903
- 'namespace_id' ]
924
+ 'snippets_enabled' , 'public' , 'visibility_level' ,
925
+ 'namespace_id' , 'description' ]
904
926
shortPrintAttr = 'path'
905
927
906
928
def Branch (self , id = None , ** kwargs ):
0 commit comments