Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: zulip/python-zulip-api
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: db95b96cd83536b51fd6e0f1c4608dcca1a4ee36
Choose a base ref
..
head repository: zulip/python-zulip-api
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 899889e782ccab98f09b31ba0eaa5bba54702d2e
Choose a head ref
Showing with 15 additions and 6 deletions.
  1. +15 −6 zulip/zulip/__init__.py
21 changes: 15 additions & 6 deletions zulip/zulip/__init__.py
Original file line number Diff line number Diff line change
@@ -951,6 +951,9 @@ def remove_reaction(self, reaction_data: Dict[str, Any]) -> Dict[str, Any]:
)

def get_realm_emoji(self) -> Dict[str, Any]:
logger.warning(
"get_realm_emoji() is deprecated." " Please use get_custom_emoji() instead."
)
return self.get_custom_emoji()

def get_custom_emoji(self) -> Dict[str, Any]:
@@ -1001,7 +1004,7 @@ def get_realm_linkifiers(self) -> Dict[str, Any]:
url="realm/linkifiers",
method="GET",
)

def add_realm_filter(self, pattern: str, url_format_string: str) -> Dict[str, Any]:
logger.warning(
"get_members() is deprecated." " Please use get_users() instead."
@@ -1024,7 +1027,6 @@ def add_linkifier(self, pattern: str, url_format_string: str) -> Dict[str, Any]:
},
)


def remove_realm_filter(self, filter_id: int) -> Dict[str, Any]:
"""
Example usage:
@@ -1088,7 +1090,10 @@ def reorder_realm_profile_fields(self, **request: Any) -> Dict[str, Any]:
)

def update_realm_profile_field(self, field_id: int, **request: Any) -> Dict[str, Any]:
self.update_linkifier(field_id)
logger.warning(
"update_realm_profile_field() is deprecated." " Please use update_linkifier() instead."
)
return self.update_linkifier(field_id)

def update_linkifier(self, field_id: int, **request: Any) -> Dict[str, Any]:
"""
@@ -1170,6 +1175,9 @@ def deregister(self, queue_id: str, timeout: Optional[float] = None) -> Dict[str
)

def get_profile(self, request: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
logger.warning(
"get_profile() is deprecated." " Please use get_own_user() instead."
)
self.get_own_user(request)

def get_own_user(self, request: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
@@ -1337,8 +1345,6 @@ def get_users(self, request: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
def get_members(self, request: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
# This exists for backwards-compatibility; we renamed this
# function get_users for consistency with the rest of the API.
# Later, we may want to add a warning for clients using this
# legacy name.
logger.warning(
"get_members() is deprecated." " Please use get_users() instead."
)
@@ -1381,7 +1387,7 @@ def list_subscriptions(self, request: Optional[Dict[str, Any]] = None) -> Dict[s
"list_subscriptions() is deprecated." " Please use get_subscriptions() instead."
)
return self.get_subscriptions(request)

def add_subscriptions(self, streams: Iterable[Dict[str, Any]], **kwargs: Any) -> Dict[str, Any]:
logger.warning(
"add_subscriptions() is deprecated." " Please use subscribe() instead."
@@ -1402,6 +1408,9 @@ def subscribe(self, streams: Iterable[Dict[str, Any]], **kwargs: Any) -> Dict[st
def remove_subscriptions(
self, streams: Iterable[str], principals: Union[Sequence[str], Sequence[int]] = []
) -> Dict[str, Any]:
logger.warning(
"remove_subscriptions() is deprecated." " Please use unsubscribe() instead."
)
return self.unsubscribe(streams, principals)

def unsubscribe(