import 'NotificationDTO.dart';

class NotificationObjectDTO {
  int? numberUnreadPage;
  int? numberReadPage;
  int? numberUnreadTotal;
  int? numberReadTotal;
  List<NotificationDTO>? notificationDTO;

  NotificationObjectDTO({this.numberUnreadPage, this.numberReadPage, this.numberUnreadTotal, this.numberReadTotal, this.notificationDTO});

  NotificationObjectDTO.fromJson(Map<String, dynamic> json) {
    numberUnreadPage = json['numberUnreadPage'];
    numberReadPage = json['numberReadPage'];
    numberUnreadTotal = json['numberUnreadTotal'];
    numberReadTotal = json['numberReadTotal'];
    if (json['tbnotificationDTOs'] != null) {
      notificationDTO = <NotificationDTO>[];
      json['tbnotificationDTOs'].forEach((v) {
        notificationDTO?.add(NotificationDTO.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final data = <String, dynamic>{};
    data['numberUnreadPage'] = numberUnreadPage;
    data['numberReadPage'] = numberReadPage;
    data['numberUnreadTotal'] = numberUnreadTotal;
    data['numberReadTotal'] = numberReadTotal;
    if (notificationDTO != null) {
      data['tbnotificationDTOs'] = notificationDTO?.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
