From 0e98533186a605725c00ecfa1a6c055ffb340d7a Mon Sep 17 00:00:00 2001 From: Kartik Srivastava Date: Fri, 14 Aug 2020 21:40:43 +0530 Subject: [PATCH] api: Implement GET /users/{user_id}/subscriptions/{stream_id} endpoint. --- zulip/zulip/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index 4c95d8b..3ed7168 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -1317,6 +1317,18 @@ class Client: request=request, ) + def get_subscription_status(self, user_id: int, stream_id: int) -> Dict[str, Any]: + ''' + Example usage: + + >>> client.get_subscription_status(user_id=7, stream_id=1) + {'result': 'success', 'msg': '', 'is_subscribed': False} + ''' + return self.call_endpoint( + url='users/{}/subscriptions/{}'.format(user_id, stream_id), + method='GET', + ) + def mute_topic(self, request: Dict[str, Any]) -> Dict[str, Any]: ''' See examples/mute-topic for example usage.