import 'dart:convert';

import 'package:http/http.dart' as http;
import 'package:http/http.dart';

import '../../../apiParams.dart';
import '../talkApi.dart';
import 'getReactionsResponse.dart';

class GetReactions extends TalkApi<GetReactionsResponse> {
  String chatToken;
  int messageId;
  GetReactions({required this.chatToken, required this.messageId}) : super("v1/reaction/$chatToken/$messageId", null);

  @override
  assemble(String raw) {
    return GetReactionsResponse.fromJson(jsonDecode(raw)['ocs']);
  }

  @override
  Future<Response>? request(Uri uri, ApiParams? body, Map<String, String>? headers) {
    return http.get(uri, headers: headers);
  }

}