import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';

class CheckActivationCodeForDoctorAppResponseModel {
  String? authenticationTokenID;
  List<ListDoctorsClinic>? listDoctorsClinic;
  List<DoctorProfileModel>? listDoctorProfile;
  MemberInformation? memberInformation;
  String? vidaAuthTokenID;
  String? vidaRefreshTokenID;

  CheckActivationCodeForDoctorAppResponseModel({this.authenticationTokenID, this.listDoctorsClinic, this.memberInformation, this.listDoctorProfile, this.vidaAuthTokenID, this.vidaRefreshTokenID});

  CheckActivationCodeForDoctorAppResponseModel.fromJson(Map<String, dynamic> json) {
    authenticationTokenID = json['AuthenticationTokenID'];
    if (json['List_DoctorsClinic'] != null) {
      listDoctorsClinic = <ListDoctorsClinic>[];
      json['List_DoctorsClinic'].forEach((v) {
        listDoctorsClinic!.add(new ListDoctorsClinic.fromJson(v));
      });
    }

    if (json['List_DoctorProfile'] != null) {
      listDoctorProfile = <DoctorProfileModel>[];
      json['List_DoctorProfile'].forEach((v) {
        listDoctorProfile!.add(new DoctorProfileModel.fromJson(v));
      });
    }
    vidaAuthTokenID = json['VidaAuthTokenID'];
    vidaRefreshTokenID = json['VidaRefreshTokenID'];

    memberInformation = json['memberInformation'] != null ? new MemberInformation.fromJson(json['memberInformation']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['AuthenticationTokenID'] = this.authenticationTokenID;
    if (this.listDoctorsClinic != null) {
      data['List_DoctorsClinic'] = this.listDoctorsClinic!.map((v) => v.toJson()).toList();
    }

    if (this.listDoctorProfile != null) {
      data['List_DoctorProfile'] = this.listDoctorProfile!.map((v) => v.toJson()).toList();
    }
    if (this.memberInformation != null) {
      data['memberInformation'] = this.memberInformation!.toJson();
    }
    return data;
  }
}

class ListDoctorsClinic {
  String? setupID;
  int? projectID;
  int? doctorID;
  int? clinicID;
  bool? isActive;
  String? clinicName;

  ListDoctorsClinic({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName});

  ListDoctorsClinic.fromJson(Map<String, dynamic> json) {
    setupID = json['SetupID'];
    projectID = json['ProjectID'];
    doctorID = json['DoctorID'];
    clinicID = json['ClinicID'];
    isActive = json['IsActive'];
    clinicName = json['ClinicName'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['SetupID'] = this.setupID;
    data['ProjectID'] = this.projectID;
    data['DoctorID'] = this.doctorID;
    data['ClinicID'] = this.clinicID;
    data['IsActive'] = this.isActive;
    data['ClinicName'] = this.clinicName;
    return data;
  }
}

class MemberInformation {
  List<Clinics>? clinics;
  int? doctorId;
  String? email;
  int? employeeId;
  int? memberId;
  dynamic memberName;
  dynamic memberNameArabic;
  String? preferredLanguage;
  List<Roles>? roles;

  MemberInformation({this.clinics, this.doctorId, this.email, this.employeeId, this.memberId, this.memberName, this.memberNameArabic, this.preferredLanguage, this.roles});

  MemberInformation.fromJson(Map<String, dynamic> json) {
    if (json['clinics'] != null) {
      clinics =  <Clinics>[];
      json['clinics'].forEach((v) {
        clinics!.add(new Clinics.fromJson(v));
      });
    }
    doctorId = json['doctorId'];
    email = json['email'];
    employeeId = json['employeeId'];
    memberId = json['memberId'];
    memberName = json['memberName'];
    memberNameArabic = json['memberNameArabic'];
    preferredLanguage = json['preferredLanguage'];
    if (json['roles'] != null) {
      roles =<Roles>[];
      json['roles'].forEach((v) {
        roles!.add(new Roles.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.clinics != null) {
      data['clinics'] = this.clinics!.map((v) => v.toJson()).toList();
    }
    data['doctorId'] = this.doctorId;
    data['email'] = this.email;
    data['employeeId'] = this.employeeId;
    data['memberId'] = this.memberId;
    data['memberName'] = this.memberName;
    data['memberNameArabic'] = this.memberNameArabic;
    data['preferredLanguage'] = this.preferredLanguage;
    if (this.roles != null) {
      data['roles'] = this.roles!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Clinics {
  bool? defaultClinic;
  int? id;
  String? name;

  Clinics({this.defaultClinic, this.id, this.name});

  Clinics.fromJson(Map<String, dynamic> json) {
    defaultClinic = json['defaultClinic'];
    id = json['id'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['defaultClinic'] = this.defaultClinic;
    data['id'] = this.id;
    data['name'] = this.name;
    return data;
  }
}

class Roles {
  String? name;
  int? roleId;

  Roles({this.name, this.roleId});

  Roles.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    roleId = json['roleId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['roleId'] = this.roleId;
    return data;
  }
}
