summaryrefslogtreecommitdiff
path: root/docs/gl_objects/notifications.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2016-10-23 21:46:28 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2016-10-23 21:46:28 +0200
commitb15f17b6d2008ee658cf9206aa37faaf966a521b (patch)
tree0ea09ee088d28770c7bc6d0e34382ca1cb142a9f /docs/gl_objects/notifications.py
parent6d3450c4fe4a2e592b9000be309819278f519e11 (diff)
downloadgitlab-b15f17b6d2008ee658cf9206aa37faaf966a521b.tar.gz
Add support for the notification settings API
Diffstat (limited to 'docs/gl_objects/notifications.py')
-rw-r--r--docs/gl_objects/notifications.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/gl_objects/notifications.py b/docs/gl_objects/notifications.py
new file mode 100644
index 0000000..c46e36e
--- /dev/null
+++ b/docs/gl_objects/notifications.py
@@ -0,0 +1,21 @@
+# get
+# global settings
+settings = gl.notificationsettings.get()
+# for a group
+settings = gl.groups.get(group_id).notificationsettings.get()
+# for a project
+settings = gl.projects.get(project_id).notificationsettings.get()
+# end get
+
+# update
+# use a predefined level
+settings.level = gitlab.NOTIFICATION_LEVEL_WATCH
+# create a custom setup
+settings.level = gitlab.NOTIFICATION_LEVEL_CUSTOM
+settings.save() # will create additional attributes, but not mandatory
+
+settings.new_merge_request = True
+settings.new_issue = True
+settings.new_note = True
+settings.save()
+# end update