From c6b123016ecd6bb695a5c9a1633c8853e468137c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yago=20Gonz=C3=A1lez?= Date: Fri, 10 Aug 2018 01:46:00 +0200 Subject: [PATCH] api: Implement PATCH /settings/notifications. --- zulip/zulip/__init__.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index 5ab4e6a..72a38e8 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -1125,6 +1125,23 @@ class Client(object): request={'subscription_data': subscription_data} ) + def update_notification_settings(self, notification_settings): + # type: (Dict[str, Any]) -> Dict[str, Any] + ''' + Example usage: + + >>> client.update_notification_settings({ + 'enable_stream_push_notifications': True, + 'enable_offline_push_notifications': False, + }) + {'enable_offline_push_notifications': False, 'enable_stream_push_notifications': True, 'msg': '', 'result': 'success'} + ''' + return self.call_endpoint( + url='settings/notifications', + method='PATCH', + request=notification_settings, + ) + def get_stream_id(self, stream): # type: (str) -> Dict[str, Any] '''