class NotificationResponse {
  int? totalRecord;
  bool? isSuccess;
  String? errorMesssage;
  List<NotificationData>? data;
  String? message;

  NotificationResponse({
    this.totalRecord,
    this.isSuccess,
    this.errorMesssage,
    this.data,
    this.message,
  });

  NotificationResponse.fromJson(Map<String, dynamic> json) {
    totalRecord = json["totalRecord"]?.toInt();
    isSuccess = json["isSuccess"];
    errorMesssage = json["errorMesssage"]?.toString();
    if (json["Data"] != null) {
      final v = json["Data"];
      final arr0 = <NotificationData>[];
      v.forEach((v) {
        arr0.add(NotificationData.fromJson(v));
      });
      data = arr0;
    }
    message = json["message"]?.toString();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["totalRecord"] = totalRecord;
    data["isSuccess"] = isSuccess;
    data["errorMesssage"] = errorMesssage;
    if (this.data != null) {
      final v = this.data;
      final arr0 = [];
      v!.forEach((v) {
        arr0.add(v.toJson());
      });
      data["Data"] = arr0;
    }
    data["message"] = message;
    return data;
  }
}

class NotificationData {
  NotificationData({
    this.id,
    this.type,
    this.icon,
    this.title,
    this.message,
    this.isRead,
    this.createDate,
  });

  String? id;
  int? type;
  String? icon;
  String? title;
  String? message;
  bool? isRead;
  String? createDate;

  factory NotificationData.fromJson(Map<String, dynamic> json) =>
      NotificationData(
        id: json["NotificationId"],
        type: json["NotificationType"],
        icon: json["icon"],
        title: json["Title"],
        message: json["Message"],
        isRead: json["IsRead"],
        createDate: json["CreateDate"],
      );

  Map<String, dynamic> toJson() => {
        "NotificationId": id,
        "NotificationType": type,
        "icon": icon,
        "Title": title,
        "Message": message,
        "IsRead": isRead,
        "CreateDate": createDate,
      };
}
