
import 'package:json_annotation/json_annotation.dart';

import '../apiResponse.dart';

part 'getHolidaysResponse.g.dart';

@JsonSerializable(explicitToJson: true)
class GetHolidaysResponse extends ApiResponse {
  List<GetHolidaysResponseObject> data;

  GetHolidaysResponse(this.data);

  factory GetHolidaysResponse.fromJson(Map<String, dynamic> json) => _$GetHolidaysResponseFromJson(json);
  Map<String, dynamic> toJson() => _$GetHolidaysResponseToJson(this);
}

@JsonSerializable()
class GetHolidaysResponseObject {
  String start;
  String end;
  int year;
  String stateCode;
  String name;
  String slug;

  GetHolidaysResponseObject({
    required this.start,
    required this.end,
    required this.year,
    required this.stateCode,
    required this.name,
    required this.slug
  });

  factory GetHolidaysResponseObject.fromJson(Map<String, dynamic> json) => _$GetHolidaysResponseObjectFromJson(json);
  Map<String, dynamic> toJson() => _$GetHolidaysResponseObjectToJson(this);
}