From 91135fca092ac363cb11558db9a3fe16e8aaddae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yago=20Gonz=C3=A1lez?= Date: Thu, 12 Jul 2018 13:15:27 +0530 Subject: [PATCH] api: Implement POST /users/me/subscriptions/properties. --- zulip/zulip/__init__.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index 2941e4c..9d9dc30 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -986,6 +986,29 @@ class Client(object): request=request ) + def update_subscription_settings(self, subscription_data): + # type: (List[Dict[str, Any]]) -> Dict[str, Any] + ''' + Example usage: + + >>> client.update_subscription_settings([{ + 'stream_id': 1, + 'property': 'pin_to_top', + 'value': True + }, + { + 'stream_id': 3, + 'property': 'color', + 'value': 'f00' + }]) + {'result': 'success', 'msg': '', 'subscription_data': [{...}, {...}]} + ''' + return self.call_endpoint( + url='users/me/subscriptions/properties', + method='POST', + request={'subscription_data': subscription_data} + ) + def get_stream_id(self, stream): # type: (str) -> Dict[str, Any] '''