@@ -951,6 +951,10 @@ def remove_reaction(self, reaction_data: Dict[str, Any]) -> Dict[str, Any]:
951
951
)
952
952
953
953
def get_realm_emoji (self ) -> Dict [str , Any ]:
954
+ logger .warning ("get_realm_emoji() is deprecated." " Please use get_custom_emoji() instead." )
955
+ return self .get_custom_emoji ()
956
+
957
+ def get_custom_emoji (self ) -> Dict [str , Any ]:
954
958
"""
955
959
See examples/realm-emoji for example usage.
956
960
"""
@@ -978,6 +982,12 @@ def delete_custom_emoji(self, emoji_name: str) -> Dict[str, Any]:
978
982
)
979
983
980
984
def get_realm_linkifiers (self ) -> Dict [str , Any ]:
985
+ logger .warning (
986
+ "get_realm_linkifiers() is deprecated." " Please use get_linkifiers() instead."
987
+ )
988
+ return self .get_linkifiers ()
989
+
990
+ def get_linkifiers (self ) -> Dict [str , Any ]:
981
991
"""
982
992
Example usage:
983
993
@@ -1000,6 +1010,10 @@ def get_realm_linkifiers(self) -> Dict[str, Any]:
1000
1010
)
1001
1011
1002
1012
def add_realm_filter (self , pattern : str , url_format_string : str ) -> Dict [str , Any ]:
1013
+ logger .warning ("get_members() is deprecated." " Please use get_users() instead." )
1014
+ return self .add_linkifier (pattern , url_format_string )
1015
+
1016
+ def add_linkifier (self , pattern : str , url_format_string : str ) -> Dict [str , Any ]:
1003
1017
"""
1004
1018
Example usage:
1005
1019
@@ -1016,6 +1030,12 @@ def add_realm_filter(self, pattern: str, url_format_string: str) -> Dict[str, An
1016
1030
)
1017
1031
1018
1032
def remove_realm_filter (self , filter_id : int ) -> Dict [str , Any ]:
1033
+ logger .warning (
1034
+ "remove_realm_filter() is deprecated." " Please use remove_linkifier() instead."
1035
+ )
1036
+ return self .remove_linkifier (filter_id )
1037
+
1038
+ def remove_linkifier (self , filter_id : int ) -> Dict [str , Any ]:
1019
1039
"""
1020
1040
Example usage:
1021
1041
@@ -1028,6 +1048,13 @@ def remove_realm_filter(self, filter_id: int) -> Dict[str, Any]:
1028
1048
)
1029
1049
1030
1050
def get_realm_profile_fields (self ) -> Dict [str , Any ]:
1051
+ logger .warning (
1052
+ "get_realm_profile_fields() is deprecated."
1053
+ " Please use get_custom_profile_fields() instead."
1054
+ )
1055
+ return self .get_custom_profile_fields ()
1056
+
1057
+ def get_custom_profile_fields (self ) -> Dict [str , Any ]:
1031
1058
"""
1032
1059
Example usage:
1033
1060
@@ -1040,6 +1067,13 @@ def get_realm_profile_fields(self) -> Dict[str, Any]:
1040
1067
)
1041
1068
1042
1069
def create_realm_profile_field (self , ** request : Any ) -> Dict [str , Any ]:
1070
+ logger .warning (
1071
+ "create_realm_profile_field() is deprecated."
1072
+ " Please use create_custom_profile_field() instead."
1073
+ )
1074
+ return self .create_custom_profile_field (** request )
1075
+
1076
+ def create_custom_profile_field (self , ** request : Any ) -> Dict [str , Any ]:
1043
1077
"""
1044
1078
Example usage:
1045
1079
@@ -1065,6 +1099,13 @@ def remove_realm_profile_field(self, field_id: int) -> Dict[str, Any]:
1065
1099
)
1066
1100
1067
1101
def reorder_realm_profile_fields (self , ** request : Any ) -> Dict [str , Any ]:
1102
+ logger .warning (
1103
+ "reorder_realm_profile_fields() is deprecated."
1104
+ " Please use reorder_custom_profile_fields() instead."
1105
+ )
1106
+ return self .reorder_custom_profile_fields (** request )
1107
+
1108
+ def reorder_custom_profile_fields (self , ** request : Any ) -> Dict [str , Any ]:
1068
1109
"""
1069
1110
Example usage:
1070
1111
@@ -1078,6 +1119,12 @@ def reorder_realm_profile_fields(self, **request: Any) -> Dict[str, Any]:
1078
1119
)
1079
1120
1080
1121
def update_realm_profile_field (self , field_id : int , ** request : Any ) -> Dict [str , Any ]:
1122
+ logger .warning (
1123
+ "update_realm_profile_field() is deprecated." " Please use update_linkifier() instead."
1124
+ )
1125
+ return self .update_linkifier (field_id , ** request )
1126
+
1127
+ def update_linkifier (self , field_id : int , ** request : Any ) -> Dict [str , Any ]:
1081
1128
"""
1082
1129
Example usage:
1083
1130
@@ -1118,6 +1165,15 @@ def register(
1118
1165
event_types : Optional [Iterable [str ]] = None ,
1119
1166
narrow : Optional [List [List [str ]]] = None ,
1120
1167
** kwargs : object ,
1168
+ ) -> Dict [str , Any ]:
1169
+ logger .warning ("register() is deprecated." " Please use register_queue() instead." )
1170
+ return self .register_queue (event_types , narrow , ** kwargs )
1171
+
1172
+ def register_queue (
1173
+ self ,
1174
+ event_types : Optional [Iterable [str ]] = None ,
1175
+ narrow : Optional [List [List [str ]]] = None ,
1176
+ ** kwargs : object ,
1121
1177
) -> Dict [str , Any ]:
1122
1178
"""
1123
1179
Example usage:
@@ -1139,6 +1195,10 @@ def register(
1139
1195
)
1140
1196
1141
1197
def deregister (self , queue_id : str , timeout : Optional [float ] = None ) -> Dict [str , Any ]:
1198
+ logger .warning ("deregister() is deprecated." " Please use delete_queue() instead." )
1199
+ return self .delete_queue (queue_id , timeout )
1200
+
1201
+ def delete_queue (self , queue_id : str , timeout : Optional [float ] = None ) -> Dict [str , Any ]:
1142
1202
"""
1143
1203
Example usage:
1144
1204
@@ -1157,6 +1217,10 @@ def deregister(self, queue_id: str, timeout: Optional[float] = None) -> Dict[str
1157
1217
)
1158
1218
1159
1219
def get_profile (self , request : Optional [Dict [str , Any ]] = None ) -> Dict [str , Any ]:
1220
+ logger .warning ("get_profile() is deprecated." " Please use get_own_user() instead." )
1221
+ return self .get_own_user (request )
1222
+
1223
+ def get_own_user (self , request : Optional [Dict [str , Any ]] = None ) -> Dict [str , Any ]:
1160
1224
"""
1161
1225
Example usage:
1162
1226
@@ -1232,6 +1296,10 @@ def update_stream(self, stream_data: Dict[str, Any]) -> Dict[str, Any]:
1232
1296
)
1233
1297
1234
1298
def delete_stream (self , stream_id : int ) -> Dict [str , Any ]:
1299
+ logger .warning ("delete_stream() is deprecated." " Please use archive_stream() instead." )
1300
+ return self .archive_stream (stream_id )
1301
+
1302
+ def archive_stream (self , stream_id : int ) -> Dict [str , Any ]:
1235
1303
"""
1236
1304
See examples/delete-stream for example usage.
1237
1305
"""
@@ -1255,6 +1323,10 @@ def add_default_stream(self, stream_id: int) -> Dict[str, Any]:
1255
1323
)
1256
1324
1257
1325
def get_user_by_id (self , user_id : int , ** request : Any ) -> Dict [str , Any ]:
1326
+ logger .warning ("get_user_by_id() is deprecated." " Please use get_user() instead." )
1327
+ return self .get_user (user_id , ** request )
1328
+
1329
+ def get_user (self , user_id : int , ** request : Any ) -> Dict [str , Any ]:
1258
1330
1259
1331
"""
1260
1332
Example usage:
@@ -1269,6 +1341,12 @@ def get_user_by_id(self, user_id: int, **request: Any) -> Dict[str, Any]:
1269
1341
)
1270
1342
1271
1343
def deactivate_user_by_id (self , user_id : int ) -> Dict [str , Any ]:
1344
+ logger .warning (
1345
+ "deactivate_user_by_id() is deprecated." " Please use deactivate_user() instead."
1346
+ )
1347
+ return self .deactivate_user (user_id )
1348
+
1349
+ def deactivate_user (self , user_id : int ) -> Dict [str , Any ]:
1272
1350
1273
1351
"""
1274
1352
Example usage:
@@ -1282,6 +1360,12 @@ def deactivate_user_by_id(self, user_id: int) -> Dict[str, Any]:
1282
1360
)
1283
1361
1284
1362
def reactivate_user_by_id (self , user_id : int ) -> Dict [str , Any ]:
1363
+ logger .warning (
1364
+ "reactivate_user_by_id() is deprecated." " Please use reactivate_user() instead."
1365
+ )
1366
+ return self .reactivate_user (user_id )
1367
+
1368
+ def reactivate_user (self , user_id : int ) -> Dict [str , Any ]:
1285
1369
1286
1370
"""
1287
1371
Example usage:
@@ -1295,6 +1379,10 @@ def reactivate_user_by_id(self, user_id: int) -> Dict[str, Any]:
1295
1379
)
1296
1380
1297
1381
def update_user_by_id (self , user_id : int , ** request : Any ) -> Dict [str , Any ]:
1382
+ logger .warning ("update_user_by_id() is deprecated." " Please use update_user() instead." )
1383
+ return self .update_user (user_id , ** request )
1384
+
1385
+ def update_user (self , user_id : int , ** request : Any ) -> Dict [str , Any ]:
1298
1386
1299
1387
"""
1300
1388
Example usage:
@@ -1321,8 +1409,7 @@ def get_users(self, request: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
1321
1409
def get_members (self , request : Optional [Dict [str , Any ]] = None ) -> Dict [str , Any ]:
1322
1410
# This exists for backwards-compatibility; we renamed this
1323
1411
# function get_users for consistency with the rest of the API.
1324
- # Later, we may want to add a warning for clients using this
1325
- # legacy name.
1412
+ logger .warning ("get_members() is deprecated." " Please use get_users() instead." )
1326
1413
return self .get_users (request = request )
1327
1414
1328
1415
def get_alert_words (self ) -> Dict [str , Any ]:
@@ -1364,6 +1451,10 @@ def list_subscriptions(self, request: Optional[Dict[str, Any]] = None) -> Dict[s
1364
1451
return self .get_subscriptions (request )
1365
1452
1366
1453
def add_subscriptions (self , streams : Iterable [Dict [str , Any ]], ** kwargs : Any ) -> Dict [str , Any ]:
1454
+ logger .warning ("add_subscriptions() is deprecated." " Please use subscribe() instead." )
1455
+ return self .subscribe (streams , ** kwargs )
1456
+
1457
+ def subscribe (self , streams : Iterable [Dict [str , Any ]], ** kwargs : Any ) -> Dict [str , Any ]:
1367
1458
"""
1368
1459
See examples/subscribe for example usage.
1369
1460
"""
@@ -1376,6 +1467,12 @@ def add_subscriptions(self, streams: Iterable[Dict[str, Any]], **kwargs: Any) ->
1376
1467
1377
1468
def remove_subscriptions (
1378
1469
self , streams : Iterable [str ], principals : Union [Sequence [str ], Sequence [int ]] = []
1470
+ ) -> Dict [str , Any ]:
1471
+ logger .warning ("remove_subscriptions() is deprecated." " Please use unsubscribe() instead." )
1472
+ return self .unsubscribe (streams , principals )
1473
+
1474
+ def unsubscribe (
1475
+ self , streams : Iterable [str ], principals : Union [Sequence [str ], Sequence [int ]] = []
1379
1476
) -> Dict [str , Any ]:
1380
1477
"""
1381
1478
See examples/unsubscribe for example usage.
0 commit comments