Added api for custom timetable events
This commit is contained in:
@ -0,0 +1,22 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:http/http.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import '../../mhslApi.dart';
|
||||
import 'removeCustomTimetableEventParams.dart';
|
||||
|
||||
class RemoveCustomTimetableEvent extends MhslApi<void> {
|
||||
RemoveCustomTimetableEventParams params;
|
||||
|
||||
RemoveCustomTimetableEvent(this.params) : super('server/timetable/customEvents');
|
||||
|
||||
@override
|
||||
void assemble(String raw) {}
|
||||
|
||||
@override
|
||||
Future<Response>? request(Uri uri) {
|
||||
return http.delete(uri, body: jsonEncode(params.toJson()));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'removeCustomTimetableEventParams.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class RemoveCustomTimetableEventParams {
|
||||
String id;
|
||||
|
||||
RemoveCustomTimetableEventParams(this.id);
|
||||
|
||||
factory RemoveCustomTimetableEventParams.fromJson(Map<String, dynamic> json) => _$RemoveCustomTimetableEventParamsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$RemoveCustomTimetableEventParamsToJson(this);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'removeCustomTimetableEventParams.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
RemoveCustomTimetableEventParams _$RemoveCustomTimetableEventParamsFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
RemoveCustomTimetableEventParams(
|
||||
json['id'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RemoveCustomTimetableEventParamsToJson(
|
||||
RemoveCustomTimetableEventParams instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
};
|
Reference in New Issue
Block a user