Commit graph

176 commits

Author SHA1 Message Date
rht
57e8886dfe API: Rename list_subscriptions to get_subscriptions. 2021-03-11 00:00:56 -08:00
Anders Kaseorg
30f241a126 mypy: Remove unused type: ignore comments.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-04 15:09:58 -08:00
Anders Kaseorg
5b5fda2354 Fix % formatting without a tuple.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-04 15:04:38 -08:00
LoopThrough-i-j
3887ad102e python-zulip-api: Drop python3.5 support.
Fixes Part of #655
2021-02-26 07:32:47 -08:00
LoopThrough-i-j
3e28506607 zulip-apis: Update reaction_data type.
Update `reaction_data` type in add_reaction and
remove_reaction, from Dict[str, str] to Dict[str, Any]
2021-02-23 08:58:23 -08:00
Eeshan Garg
befbb953dd pypi: Release version 0.7.1. 2020-10-09 15:50:43 -02:30
Thomas Michelat
3630208389
api: Add binding for moving topics between streams.
Adds the method move_topic to the class Client that allows moving
topics between streams.

- The topic can be renamed if the new_topic argument is given
- Partial topic can be moved givent the proper message_id and
  propagate_mode arguments.
- notification to old/new stream can be silenced (active by default)
2020-09-14 15:13:10 -07:00
Kartik Srivastava
1df19c0665 api: update_user_group_members should have a user_group_id parameter.
This avoids weirdly passing an extra field in the request, and also
makes the bindings better align with the API.
2020-08-27 12:55:21 -07:00
Preet Mishra
9a4abb9f87 zulip: Add hash_util_decode() to decode server encoded URL excerpts.
This adds hash_util_decode() to decode a hash_util_encode() [present in
zulip/zulip's zerver/lib/url_encoding.py [1]] encoded string.

The intent is to facilitate code sharing among various python clients
(primarily, Zulip Terminal).

The string replacement before the `unquote` is to recoup for the custom
string replacements in zulip/zulip's zerver/lib/url_encoding.py [1].

Test added.

[1] See hash_util_encode() in https://github.com/zulip/zulip/blob/master/zerver/lib/url_encoding.py.
2020-08-25 16:08:32 -07:00
Kartik Srivastava
0e98533186 api: Implement GET /users/{user_id}/subscriptions/{stream_id} endpoint. 2020-08-14 16:22:12 -07:00
Kartik Srivastava
36071821c3 api: Update type annotation in 'remove_subscriptions'.
This updates the type annotation for the 'principals' argument
to accept a list of email addresses as well as user ids.
2020-08-10 16:38:39 -07:00
Alex Vandiver
9745ec9ceb doc: Document the backoff class better. 2020-08-10 15:07:01 -07:00
Kartik Srivastava
20e7f197e3 api: Implement DELETE /realm/emoji/{emoji_name}. 2020-08-03 10:29:38 -07:00
Kartik Srivastava
9e9b1efdae api: Implement PATCH /realm/profile_fields/{field_id} endpoint. 2020-05-29 17:18:25 -07:00
Kartik Srivastava
e25ebce27b api: Implement PATCH /realm/profile_fields endpoint. 2020-05-29 17:18:25 -07:00
Kartik Srivastava
a85ac15d2d api: Implement DELETE /realm/profile_fields/{field_id} endpoint. 2020-05-29 17:18:25 -07:00
Kartik Srivastava
22392779a3 api: Implement POST /realm/profile_fields endpoint. 2020-05-29 17:18:25 -07:00
Kartik Srivastava
30fa7c5d2f api: Implement GET /realm/profile_fields endpoint. 2020-05-29 17:18:25 -07:00
Kartik Srivastava
16737e4ed3 api: Add get_members wrapper for get_users for backwards compatibility. 2020-05-14 11:37:23 -07:00
Kartik Srivastava
d2b9976015 api: Rename get_members to get_users. 2020-05-14 11:36:17 -07:00
Eeshan Garg
1dac75f979 pypi: Release version 0.7.0. 2020-04-20 23:23:58 -02:30
Anders Kaseorg
17cf26aa1f cleanup: Move line breaks before binary operators.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:31:14 -07:00
Anders Kaseorg
2f6623bbc4 cleanup: Remove unused imports.
Generated by autoflake.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:31:14 -07:00
Anders Kaseorg
5428c5f296 typing: Convert function type annotations to Python 3 style.
Generated by com2ann (slightly patched to avoid also converting
assignment type annotations, which require Python 3.6), followed by
some manual whitespace adjustment, and two fixes for use-before-define
issues:

-    def set_zulip_client(self, zulipToJabberClient: ZulipToJabberBot) -> None:
+    def set_zulip_client(self, zulipToJabberClient: 'ZulipToJabberBot') -> None:

-def init_from_options(options: Any, client: Optional[str] = None) -> Client:
+def init_from_options(options: Any, client: Optional[str] = None) -> 'Client':

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:31:14 -07:00
Anders Kaseorg
ddb05ea7eb add_default_arguments: Correct custom_error_handling type annotation.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:31:14 -07:00
Kartik Srivastava
f9d6c085a1 api: Implement POST /default_streams api endpoint. 2020-04-18 15:05:53 -07:00
akashaviator
ef730b2c1b api: Implement GET /messages/matches_narrow endpoint. 2020-04-18 15:05:36 -07:00
Anders Kaseorg
e30b3b094b Modernize legacy Python 2 syntax with pyupgrade.
Generated by `pyupgrade --py3-plus --keep-percent-format` followed by
manual indentation fixes.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 15:04:36 -07:00
Kartik Srivastava
04e43b95bc api: Implement /users/{user_id}/reactivate api endpoint. 2020-04-15 17:18:00 -07:00
akashaviator
59b025d2e4 api: Implement PATCH /users/{user_id} endpoint. 2020-04-09 17:17:59 -07:00
Kartik Srivastava
ed706c24ce api: Implement GET /realm/presence endpoint. 2020-04-09 17:17:29 -07:00
Kartik Srivastava
8b0fa6bfee
api: Implement GET /attachments endpoint. 2020-04-07 16:44:49 -07:00
Kartik Srivastava
6dd52439bf
api: Implement DELETE /users/{user_id} api endpoint. 2020-04-07 16:12:59 -07:00
Kartik Srivastava
8d7eb0fea3
api: Refactor get_user_by_id to take keyword arguments.
This refactors get_user_by_id to take arguments like
`include_custom_profile_fields = True` instead of
{include_custom_profile_fields: True}.
2020-04-07 16:12:11 -07:00
rht
d7c52c9a74 zulip/zulip/__init__.py: Remove shebang and add version assertion. 2020-04-05 07:28:13 -04:00
rht
439c096eac Remove all remaining six imports. 2020-04-03 08:18:08 -04:00
rht
f34540d26d Add explicit python3 shebang to __init__.py. 2020-04-03 08:18:08 -04:00
rht
4600ce59a3 Remove all remaining from __future__ imports. 2020-04-03 08:18:08 -04:00
rht
204871b518 Finish the remaining migration of shebang to python3. 2020-04-03 08:18:08 -04:00
rht
d174e589bf examples/upload-file: Use python3-specific import of StringIO. 2020-04-02 09:56:59 -04:00
rht
87198501dc examples: Remove from __future__ imports. 2020-04-02 09:56:59 -04:00
rht
e5144b8503 examples: Switch to python3. 2020-04-02 09:56:59 -04:00
Eeshan Garg
ce73dab121 pypi: Release version 0.6.4. 2020-03-26 19:52:46 -02:30
akashaviator
2cf49788fd api: Implement GET users/{id} endpoint. 2020-03-25 17:00:52 -07:00
rht
8a74f576a3 python: Remove per-file copyright notices.
These notices are redundant and obscure what are often very short
example scripts.
2020-03-23 12:52:52 -07:00
Mateusz Mandera
8fc5b777db api: Fix undefined variable reference from previous commit. 2020-03-14 11:36:34 -07:00
orientor
056963bedd api: Add delay_cap as class variable of CountingBackoff class. 2020-03-05 13:33:50 -08:00
Steve Howell
dd37e27b36 docstring: Use user_ids for typing endpoint. 2020-02-23 07:45:33 -05:00
Eeshan Garg
957b5e7ad8 pypi: Release version 0.6.3. 2019-12-16 11:48:56 -03:30
Eeshan Garg
efcc89da9d pypi: Release version 0.6.2. 2019-12-14 16:38:48 -03:30