class CoursesResponseModel {
  bool? success;
  int? status;
  String? username;
  List<CourseStatus>? coursesStatus;
  int? totalCourses;

  CoursesResponseModel({
    this.success,
    this.status,
    this.username,
    this.coursesStatus,
    this.totalCourses,
  });

  CoursesResponseModel.fromJson(Map<String, dynamic> json) {
    success = json['success'];
    status = json['status'];
    username = json['username'];
    if (json['courses_status'] != null) {
      coursesStatus = <CourseStatus>[];
      json['courses_status'].forEach((v) {
        coursesStatus!.add(CourseStatus.fromJson(v));
      });
    }
    totalCourses = json['total_courses'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> data = <String, dynamic>{};
    data['success'] = success;
    data['status'] = status;
    data['username'] = username;
    if (coursesStatus != null) {
      data['courses_status'] = coursesStatus!.map((v) => v.toJson()).toList();
    }
    data['total_courses'] = totalCourses;
    return data;
  }
}

class CourseStatus {
  String? cId;
  String? cFullname;
  String? cNameAr;
  String? cShortname;
  String? cStatus;
  String? cIsMohemmAffective;
  String? cStartdate;
  String? cEnddate;
  String? cUrl;
  String? token;
  CourseStatus({
    this.cId,
    this.cFullname,
    this.cNameAr,
    this.cShortname,
    this.cStatus,
    this.cIsMohemmAffective,
    this.cStartdate,
    this.cEnddate,
    this.cUrl,
    this.token
  });

  CourseStatus.fromJson(Map<String, dynamic> json) {
    cId = json['c_id'];
    cFullname = json['c_fullname'];
    cNameAr = json['c_name_ar'];
    cShortname = json['c_shortname'];
    cStatus = json['c_status'];
    cIsMohemmAffective = json['c_is_mohemm_affective'];
    cStartdate = json['c_startdate'];
    cEnddate = json['c_enddate'];
    cUrl = json['c_url'];
    token =json['c_token'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> data = <String, dynamic>{};
    data['c_id'] = cId;
    data['c_fullname'] = cFullname;
    data['c_name_ar'] = cNameAr;
    data['c_shortname'] = cShortname;
    data['c_status'] = cStatus;
    data['c_is_mohemm_affective'] = cIsMohemmAffective;
    data['c_startdate'] = cStartdate;
    data['c_enddate'] = cEnddate;
    data['c_url'] = cUrl;
    data['c_token'] = token;
    return data;
  }
}

