23 lines
611 B
Dart
23 lines
611 B
Dart
import 'dart:convert';
|
|
|
|
import 'package:http/http.dart' as http;
|
|
import 'package:http/http.dart';
|
|
|
|
import '../talkApi.dart';
|
|
import 'getChatParams.dart';
|
|
import 'getChatResponse.dart';
|
|
|
|
class GetChat extends TalkApi<GetChatResponse> {
|
|
String chatToken;
|
|
|
|
GetChatParams params;
|
|
GetChat(this.chatToken, this.params) : super('v1/chat/$chatToken', null, getParameters: params.toJson());
|
|
|
|
@override
|
|
assemble(String raw) => GetChatResponse.fromJson(jsonDecode(raw)['ocs']);
|
|
|
|
@override
|
|
Future<Response> request(Uri uri, Object? body, Map<String, String>? headers) => http.get(uri, headers: headers);
|
|
|
|
}
|