// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'widget_data.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

_WidgetLesson _$WidgetLessonFromJson(Map<String, dynamic> json) =>
    _WidgetLesson(
      start: DateTime.parse(json['start'] as String),
      end: DateTime.parse(json['end'] as String),
      subjectShort: json['subjectShort'] as String,
      subjectLong: json['subjectLong'] as String?,
      room: json['room'] as String?,
      teacher: json['teacher'] as String?,
      originalTeacher: json['originalTeacher'] as String?,
      status: $enumDecode(_$WidgetLessonStatusEnumMap, json['status']),
      customColor: json['customColor'] as String?,
      siblingCount: (json['siblingCount'] as num?)?.toInt() ?? 0,
    );

Map<String, dynamic> _$WidgetLessonToJson(_WidgetLesson instance) =>
    <String, dynamic>{
      'start': instance.start.toIso8601String(),
      'end': instance.end.toIso8601String(),
      'subjectShort': instance.subjectShort,
      'subjectLong': instance.subjectLong,
      'room': instance.room,
      'teacher': instance.teacher,
      'originalTeacher': instance.originalTeacher,
      'status': _$WidgetLessonStatusEnumMap[instance.status]!,
      'customColor': instance.customColor,
      'siblingCount': instance.siblingCount,
    };

const _$WidgetLessonStatusEnumMap = {
  WidgetLessonStatus.regular: 'regular',
  WidgetLessonStatus.ongoing: 'ongoing',
  WidgetLessonStatus.past: 'past',
  WidgetLessonStatus.cancelled: 'cancelled',
  WidgetLessonStatus.irregular: 'irregular',
  WidgetLessonStatus.teacherChanged: 'teacherChanged',
  WidgetLessonStatus.event: 'event',
  WidgetLessonStatus.duty: 'duty',
};

_WidgetPeriod _$WidgetPeriodFromJson(Map<String, dynamic> json) =>
    _WidgetPeriod(
      name: json['name'] as String,
      startMinutes: (json['startMinutes'] as num).toInt(),
      endMinutes: (json['endMinutes'] as num).toInt(),
      virtualStartMinutes: (json['virtualStartMinutes'] as num).toInt(),
      virtualEndMinutes: (json['virtualEndMinutes'] as num).toInt(),
    );

Map<String, dynamic> _$WidgetPeriodToJson(_WidgetPeriod instance) =>
    <String, dynamic>{
      'name': instance.name,
      'startMinutes': instance.startMinutes,
      'endMinutes': instance.endMinutes,
      'virtualStartMinutes': instance.virtualStartMinutes,
      'virtualEndMinutes': instance.virtualEndMinutes,
    };

_WidgetDayInfo _$WidgetDayInfoFromJson(Map<String, dynamic> json) =>
    _WidgetDayInfo(
      date: DateTime.parse(json['date'] as String),
      isHoliday: json['isHoliday'] as bool? ?? false,
      holidayName: json['holidayName'] as String?,
    );

Map<String, dynamic> _$WidgetDayInfoToJson(_WidgetDayInfo instance) =>
    <String, dynamic>{
      'date': instance.date.toIso8601String(),
      'isHoliday': instance.isHoliday,
      'holidayName': instance.holidayName,
    };

_WidgetTimetableData _$WidgetTimetableDataFromJson(Map<String, dynamic> json) =>
    _WidgetTimetableData(
      fetchedAt: DateTime.parse(json['fetchedAt'] as String),
      anchorDate: DateTime.parse(json['anchorDate'] as String),
      lessons: (json['lessons'] as List<dynamic>)
          .map((e) => WidgetLesson.fromJson(e as Map<String, dynamic>))
          .toList(),
      periods:
          (json['periods'] as List<dynamic>?)
              ?.map((e) => WidgetPeriod.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const <WidgetPeriod>[],
      isHoliday: json['isHoliday'] as bool? ?? false,
      holidayName: json['holidayName'] as String?,
      days:
          (json['days'] as List<dynamic>?)
              ?.map((e) => WidgetDayInfo.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const <WidgetDayInfo>[],
    );

Map<String, dynamic> _$WidgetTimetableDataToJson(
  _WidgetTimetableData instance,
) => <String, dynamic>{
  'fetchedAt': instance.fetchedAt.toIso8601String(),
  'anchorDate': instance.anchorDate.toIso8601String(),
  'lessons': instance.lessons,
  'periods': instance.periods,
  'isHoliday': instance.isHoliday,
  'holidayName': instance.holidayName,
  'days': instance.days,
};
