import 'package:json_annotation/json_annotation.dart';
import 'package:marianum_mobile/api/apiResponse.dart';

part 'getTimetableResponse.g.dart';

@JsonSerializable(explicitToJson: true)
class GetTimetableResponse extends ApiResponse {
  Set<GetTimetableResponseObject> result;

  GetTimetableResponse(this.result);

  factory GetTimetableResponse.fromJson(Map<String, dynamic> json) => _$GetTimetableResponseFromJson(json);
  Map<String, dynamic> toJson() => _$GetTimetableResponseToJson(this);

}

@JsonSerializable(explicitToJson: true)
class GetTimetableResponseObject {
  int id;
  int date;
  int startTime;
  int endTime;
  String? lstype;
  String? code;
  String? info;
  String? substText;
  String? lstext;
  int? lsnumber;
  String? statflags;
  String? activityType;
  String? sg;
  String? bkRemark;
  String? bkText;
  List<dynamic> kl;
  List<dynamic> te;
  List<dynamic> su;
  List<dynamic> ro;

  GetTimetableResponseObject({
    required this.id,
    required this.date,
    required this.startTime,
    required this.endTime,
    this.lstype,
    this.code,
    this.info,
    this.substText,
    this.lstext,
    this.lsnumber,
    this.statflags,
    this.activityType,
    this.sg,
    this.bkRemark,
    required this.kl,
    required this.te,
    required this.su,
    required this.ro
  });

  factory GetTimetableResponseObject.fromJson(Map<String, dynamic> json) => _$GetTimetableResponseObjectFromJson(json);
  Map<String, dynamic> toJson() => _$GetTimetableResponseObjectToJson(this);
}

@JsonSerializable(explicitToJson: true)
class GetTimetableResponseObjectFields {
  List<GetTimetableResponseObjectFieldsObject>? te;

  GetTimetableResponseObjectFields(this.te);

  factory GetTimetableResponseObjectFields.fromJson(Map<String, dynamic> json) => _$GetTimetableResponseObjectFieldsFromJson(json);
  Map<String, dynamic> toJson() => _$GetTimetableResponseObjectFieldsToJson(this);
}

@JsonSerializable()
class GetTimetableResponseObjectFieldsObject {
  int? id;
  String? name;
  String? longname;
  String? externalkey;

  GetTimetableResponseObjectFieldsObject({this.id, this.name, this.longname, this.externalkey});

  factory GetTimetableResponseObjectFieldsObject.fromJson(Map<String, dynamic> json) => _$GetTimetableResponseObjectFieldsObjectFromJson(json);
  Map<String, dynamic> toJson() => _$GetTimetableResponseObjectFieldsObjectToJson(this);
}