summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2017-08-12 09:47:33 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2017-09-02 15:43:52 +0200
commiteb191dfaa42eb39d9d1b5acc21fc0c4c0fb99427 (patch)
treef047567b6b7d85e9581ea96eb00f5d474da2423a /gitlab/v4/objects.py
parent4057644f03829e4439ec8ab1feacf90c65d976eb (diff)
downloadgitlab-eb191dfaa42eb39d9d1b5acc21fc0c4c0fb99427.tar.gz
Add support for group variables
Diffstat (limited to 'gitlab/v4/objects.py')
-rw-r--r--gitlab/v4/objects.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index e3780a9..8399383 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -2121,6 +2121,18 @@ class GroupProjectManager(GetFromListMixin, RESTManager):
'ci_enabled_first')
+class GroupVariable(SaveMixin, ObjectDeleteMixin, RESTObject):
+ _id_attr = 'key'
+
+
+class GroupVariableManager(CRUDMixin, RESTManager):
+ _path = '/groups/%(group_id)s/variables'
+ _obj_cls = GroupVariable
+ _from_parent_attrs = {'group_id': 'id'}
+ _create_attrs = (('key', 'value'), ('protected',))
+ _update_attrs = (('key', 'value'), ('protected',))
+
+
class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
_short_print_attr = 'name'
_managers = (
@@ -2129,6 +2141,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
('notificationsettings', 'GroupNotificationSettingsManager'),
('projects', 'GroupProjectManager'),
('issues', 'GroupIssueManager'),
+ ('variables', 'GroupVariableManager'),
)
@exc.on_http_error(exc.GitlabTransferProjectError)