api: Implement DELETE /streams/<stream_id>.
This commit is contained in:
parent
6151f2db40
commit
bf752a860c
|
@ -1043,6 +1043,16 @@ class Client(object):
|
||||||
request=stream_data,
|
request=stream_data,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def delete_stream(self, stream_id):
|
||||||
|
# type: (int) -> Dict[str, Any]
|
||||||
|
'''
|
||||||
|
See examples/delete-stream for example usage.
|
||||||
|
'''
|
||||||
|
return self.call_endpoint(
|
||||||
|
url='streams/{}'.format(stream_id),
|
||||||
|
method='DELETE',
|
||||||
|
)
|
||||||
|
|
||||||
def get_members(self, request=None):
|
def get_members(self, request=None):
|
||||||
# type: (Optional[Dict[str, Any]]) -> Dict[str, Any]
|
# type: (Optional[Dict[str, Any]]) -> Dict[str, Any]
|
||||||
'''
|
'''
|
||||||
|
|
20
zulip/zulip/examples/delete-stream
Executable file
20
zulip/zulip/examples/delete-stream
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
import zulip
|
||||||
|
|
||||||
|
usage = """delete-stream <stream_id>
|
||||||
|
|
||||||
|
Example: delete-stream 42
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
parser = zulip.add_default_arguments(argparse.ArgumentParser(usage=usage))
|
||||||
|
parser.add_argument('stream_id', type=int)
|
||||||
|
options = parser.parse_args()
|
||||||
|
|
||||||
|
client = zulip.init_from_options(options)
|
||||||
|
|
||||||
|
print(client.delete_stream(options.stream_id))
|
Loading…
Reference in a new issue