From 59b025d2e461fc4fd448327e0326df5ed7c127fe Mon Sep 17 00:00:00 2001 From: akashaviator Date: Wed, 1 Apr 2020 20:25:51 +0530 Subject: [PATCH] api: Implement PATCH /users/{user_id} endpoint. --- zulip/zulip/__init__.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index 79205d0..6f06db7 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -1110,6 +1110,25 @@ class Client(object): method='DELETE', ) + def update_user_by_id(self, user_id, **request): + # type: (int, **Any) -> Dict[str, Any] + + ''' + Example usage: + + >>> client.update_user_by_id(8, full_name="New Name") + {'result': 'success', 'msg': ''} + ''' + + for key, value in request.items(): + request[key] = json.dumps(value) + + return self.call_endpoint( + url='users/{}'.format(user_id), + method='PATCH', + request=request + ) + def get_members(self, request=None): # type: (Optional[Dict[str, Any]]) -> Dict[str, Any] '''