@@ -385,6 +385,20 @@ def User(self, id=None, **kwargs):
385
385
"""
386
386
return self ._getListOrObject (User , id , ** kwargs )
387
387
388
+ def Team (self , id = None , ** kwargs ):
389
+ """Creates/gets/lists team(s) known by the GitLab server.
390
+
391
+ If id is None, returns a list of teams.
392
+
393
+ If id is an integer, returns the matching project (or raise a
394
+ GitlabGetError if not found)
395
+
396
+ If id is a dict, create a new object using attributes provided. The
397
+ object is NOT saved on the server. Use the save() method on the object
398
+ to write it on the server.
399
+ """
400
+ return self ._getListOrObject (Team , id , ** kwargs )
401
+
388
402
389
403
class GitlabObject (object ):
390
404
_url = None
@@ -866,7 +880,7 @@ class TeamMember(GitlabObject):
866
880
867
881
class TeamProject (GitlabObject ):
868
882
_url = '/user_teams/%(team_id)s/projects'
869
- _constructorTypes = {'owner' : 'User' }
883
+ _constructorTypes = {'owner' : 'User' , 'namespace' : 'Group' }
870
884
canUpdate = False
871
885
requiredCreateAttrs = ['team_id' , 'project_id' , 'greatest_access_level' ]
872
886
requiredDeleteAttrs = ['team_id' , 'project_id' ]
@@ -881,13 +895,12 @@ class Team(GitlabObject):
881
895
requiredCreateAttrs = ['name' , 'path' ]
882
896
canUpdate = False
883
897
884
- def Members (self , id = None , ** kwargs ):
898
+ def Member (self , id = None , ** kwargs ):
885
899
return self ._getListOrObject (TeamMember , id ,
886
900
team_id = self .id ,
887
901
** kwargs )
888
902
889
- def Projects (self , id = None , ** kwargs ):
903
+ def Project (self , id = None , ** kwargs ):
890
904
return self ._getListOrObject (TeamProject , id ,
891
905
team_id = self .id ,
892
906
** kwargs )
893
-
0 commit comments