From b2de1e8e67b85838346aa4183c28917c75061970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yago=20Gonz=C3=A1lez?= Date: Tue, 14 Aug 2018 02:26:07 +0200 Subject: [PATCH] api: Implement POST /realm/filters. --- zulip/zulip/__init__.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index 11a855c..deb3ec8 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -877,6 +877,23 @@ class Client(object): method='GET', ) + def add_realm_filter(self, pattern, url_format_string): + # type: (str, str) -> Dict[str, Any] + ''' + Example usage: + + >>> client.add_realm_filter('#(?P[0-9]+)', 'https://github.com/zulip/zulip/issues/%(id)s') + {'result': 'success', 'msg': '', 'id': 42} + ''' + return self.call_endpoint( + url='realm/filters', + method='POST', + request={ + 'pattern': pattern, + 'url_format_string': url_format_string, + }, + ) + def get_server_settings(self): # type: () -> Dict[str, Any] '''