import 'dart:convert';

import '../../webuntisApi.dart';
import 'getTimetableParams.dart';
import 'getTimetableResponse.dart';

class GetTimetable extends WebuntisApi {
  GetTimetableParams params;

  GetTimetable(this.params) : super("getTimetable", params);

  @override
  Future<GetTimetableResponse> run() async {
    String rawAnswer = await query(this);
    return finalize(GetTimetableResponse.fromJson(jsonDecode(rawAnswer)));
  }

}