added talk notification levels for chats
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:http/http.dart' as http;
|
||||
|
||||
import '../../../api_params.dart';
|
||||
import '../../../api_response.dart';
|
||||
import '../room/get_room_response.dart';
|
||||
import '../talk_api.dart';
|
||||
|
||||
/// Small POST/DELETE-only Talk endpoints that have no response payload.
|
||||
@@ -105,3 +106,21 @@ class DeleteRoomAvatar extends TalkApi {
|
||||
Map<String, String>? headers,
|
||||
) => http.delete(uri, headers: headers);
|
||||
}
|
||||
|
||||
class SetNotificationLevel extends TalkApi {
|
||||
final String chatToken;
|
||||
final GetRoomResponseObjectParticipantNotificationLevel level;
|
||||
|
||||
SetNotificationLevel(this.chatToken, this.level)
|
||||
: super('v4/room/$chatToken/notify', null);
|
||||
|
||||
@override
|
||||
ApiResponse? assemble(String raw) => null;
|
||||
|
||||
@override
|
||||
Future<http.Response> request(
|
||||
Uri uri,
|
||||
ApiParams? body,
|
||||
Map<String, String>? headers,
|
||||
) => http.post(uri, headers: headers, body: {'level': '${level.apiValue}'});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user