import 'dart:convert';

List<DoctorSchedule> doctorScheduleFromJson(String str) => List<DoctorSchedule>.from(json.decode(str).map((x) => DoctorSchedule.fromJson(x)));

String doctorScheduleToJson(List<DoctorSchedule> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));

class DoctorSchedule {
  int? scheduledid;
  int? status;
  String? clinicname;
  int? clinicid;
  List<Scheduleforuser>? scheduleforuser;

  DoctorSchedule({
    this.scheduledid,
    this.status,
    this.clinicname,
    this.clinicid,
    this.scheduleforuser,
  });

  factory DoctorSchedule.fromJson(Map<String, dynamic> json) => DoctorSchedule(
        scheduledid: json["scheduledid"],
        status: json["status"],
        clinicname: json["clinicname"],
        clinicid: json["clinicid"],
        scheduleforuser: List<Scheduleforuser>.from(json["scheduleforuser"].map((x) => Scheduleforuser.fromJson(x))),
      );

  Map<String, dynamic> toJson() => {
        "scheduledid": scheduledid,
        "status": status,
        "clinicname": clinicname,
        "clinicid": clinicid,
        "scheduleforuser": List<dynamic>.from(scheduleforuser!.map((x) => x.toJson())),
      };
}

class Scheduleforuser {
  DateTime? days;
  int? duration;
  List<Shiftforuser>? shiftforuser;

  Scheduleforuser({
    this.days,
    this.duration,
    this.shiftforuser,
  });

  factory Scheduleforuser.fromJson(Map<String, dynamic> json) => Scheduleforuser(
        days: DateTime.parse(json["days"]),
        duration: json["duration"],
        shiftforuser: List<Shiftforuser>.from(json["shiftforuser"].map((x) => Shiftforuser.fromJson(x))),
      );

  Map<String, dynamic> toJson() => {
        "days": days!.toIso8601String(),
        "duration": duration,
        "shiftforuser": List<dynamic>.from(shiftforuser!.map((x) => x.toJson())),
      };
}

class Shiftforuser {
  String? fromtimetext;
  String? totimetext;

  Shiftforuser({
    this.fromtimetext,
    this.totimetext,
  });

  factory Shiftforuser.fromJson(Map<String, dynamic> json) => Shiftforuser(
        fromtimetext: json["fromtimetext"],
        totimetext: json["totimetext"],
      );

  Map<String, dynamic> toJson() => {
        "fromtimetext": fromtimetext,
        "totimetext": totimetext,
      };
}
