summaryrefslogtreecommitdiff
path: root/gitlab.py
diff options
context:
space:
mode:
authorDaniel Kimsey <dekimsey@ufl.edu>2013-07-02 17:09:00 -0400
committerDaniel Kimsey <dekimsey@ufl.edu>2013-07-02 17:09:00 -0400
commitcb5b7542edde926f73be6e7a2ab55f944ccbca00 (patch)
tree67d15a336b10d819ff32fc10553439e823b57852 /gitlab.py
parent8a22958e20a622400daecb288135793544ad01ad (diff)
parent5388d19f8885d3ca2f93c5e07ed58a1b84a87475 (diff)
downloadgitlab-cb5b7542edde926f73be6e7a2ab55f944ccbca00.tar.gz
Merge remote-tracking branch 'samcday/teams' into team-api
Conflicts: gitlab.py
Diffstat (limited to 'gitlab.py')
-rw-r--r--gitlab.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/gitlab.py b/gitlab.py
index 522bf18..5b9a592 100644
--- a/gitlab.py
+++ b/gitlab.py
@@ -385,6 +385,20 @@ class Gitlab(object):
"""
return self._getListOrObject(User, id, **kwargs)
+ def Team(self, id=None, **kwargs):
+ """Creates/gets/lists team(s) known by the GitLab server.
+
+ If id is None, returns a list of teams.
+
+ If id is an integer, returns the matching project (or raise a
+ GitlabGetError if not found)
+
+ If id is a dict, create a new object using attributes provided. The
+ object is NOT saved on the server. Use the save() method on the object
+ to write it on the server.
+ """
+ return self._getListOrObject(Team, id, **kwargs)
+
class GitlabObject(object):
_url = None
@@ -866,7 +880,7 @@ class TeamMember(GitlabObject):
class TeamProject(GitlabObject):
_url = '/user_teams/%(team_id)s/projects'
- _constructorTypes = {'owner': 'User'}
+ _constructorTypes = {'owner': 'User', 'namespace': 'Group'}
canUpdate = False
requiredCreateAttrs = ['team_id', 'project_id', 'greatest_access_level']
requiredDeleteAttrs = ['team_id', 'project_id']
@@ -881,13 +895,12 @@ class Team(GitlabObject):
requiredCreateAttrs = ['name', 'path']
canUpdate = False
- def Members(self, id=None, **kwargs):
+ def Member(self, id=None, **kwargs):
return self._getListOrObject(TeamMember, id,
team_id=self.id,
**kwargs)
- def Projects(self, id=None, **kwargs):
+ def Project(self, id=None, **kwargs):
return self._getListOrObject(TeamProject, id,
team_id=self.id,
**kwargs)
-