Skip to content

api: Implement PATCH /realm endpoint. #605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions zulip/zulip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,19 @@ def upload_custom_emoji(self, emoji_name: str, file_obj: IO[Any]) -> Dict[str, A
files=[file_obj]
)

def update_realm(self, **request: Any) -> Dict[str, Any]:
'''
Example usage:

>>> client.update_realm({'digest_weekday': 0', 'signup_notifications_stream_id': -1})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quoting here seems likely hand-written and wrong. E.g. the 0 with a quote on only one side of it.

Please be sure to test your examples!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, sorry! I write it by hand indeed, actually, I copy/paste the example of the /realm documentation on zulip.yaml. I'll do an actual request and copy the result here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this still isn't resolved.

{'result': 'success', 'msg': '', 'digest_weekday': 0', 'signup_notifications_stream_id': -1}
'''
return self.call_endpoint(
url='realm',
method='PATCH',
request=request,
)

def get_realm_filters(self) -> Dict[str, Any]:
'''
Example usage:
Expand Down