summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gitlab/__init__.py2
-rw-r--r--gitlab/objects.py12
2 files changed, 14 insertions, 0 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py
index bdee4aa..ddf6bb2 100644
--- a/gitlab/__init__.py
+++ b/gitlab/__init__.py
@@ -70,6 +70,7 @@ class Gitlab(object):
groups (GroupManager): Manager for GitLab members
hooks (HookManager): Manager for GitLab hooks
issues (IssueManager): Manager for GitLab issues
+ licenses (LicenseManager): Manager for licenses
project_branches (ProjectBranchManager): Manager for GitLab projects
branches
project_commits (ProjectCommitManager): Manager for GitLab projects
@@ -133,6 +134,7 @@ class Gitlab(object):
self.groups = GroupManager(self)
self.hooks = HookManager(self)
self.issues = IssueManager(self)
+ self.licenses = LicenseManager(self)
self.project_branches = ProjectBranchManager(self)
self.project_commits = ProjectCommitManager(self)
self.project_keys = ProjectKeyManager(self)
diff --git a/gitlab/objects.py b/gitlab/objects.py
index 60ca43a..7c76d53 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -747,6 +747,18 @@ class IssueManager(BaseManager):
obj_cls = Issue
+class License(GitlabObject):
+ _url = '/licenses'
+ canDelete = False
+ canUpdate = False
+ canCreate = False
+ idAttr = 'key'
+
+
+class LicenseManager(BaseManager):
+ obj_cls = License
+
+
class ProjectBranch(GitlabObject):
_url = '/projects/%(project_id)s/repository/branches'
_constructorTypes = {'author': 'User', "committer": "User"}