import 'dart:convert';

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

import '../../mhslApi.dart';
import 'getCustomTimetableEventParams.dart';
import 'getCustomTimetableEventResponse.dart';

class GetCustomTimetableEvent extends MhslApi<GetCustomTimetableEventResponse> {
  GetCustomTimetableEventParams params;
  GetCustomTimetableEvent(this.params) : super('server/timetable/customEvents?user=${params.user}');

  @override
  GetCustomTimetableEventResponse assemble(String raw) => GetCustomTimetableEventResponse.fromJson({'events': jsonDecode(raw)});

  @override
  Future<Response>? request(Uri uri) => http.get(uri);
}
