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

import '../../nextcloud_ocs.dart';
import '../talk_api.dart';
import 'get_room_params.dart';
import 'get_room_response.dart';

class GetRoom extends TalkApi<GetRoomResponse> {
  GetRoomParams params;
  GetRoom(this.params) : super('v4/room', null, getParameters: params.toJson());

  @override
  GetRoomResponse assemble(String raw) =>
      GetRoomResponse.fromJson(NextcloudOcs.decode(raw));

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