import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/notification_page_entity.dart'; NotificationPageEntity $NotificationPageEntityFromJson(Map json) { final NotificationPageEntity notificationPageEntity = NotificationPageEntity(); final int? count = jsonConvert.convert(json['count']); if (count != null) { notificationPageEntity.count = count; } final int? page = jsonConvert.convert(json['page']); if (page != null) { notificationPageEntity.page = page; } final int? limit = jsonConvert.convert(json['limit']); if (limit != null) { notificationPageEntity.limit = limit; } final int? countPage = jsonConvert.convert(json['count_page']); if (countPage != null) { notificationPageEntity.countPage = countPage; } final List? list = (json['list'] as List?)?.map( (e) => jsonConvert.convert(e) as NotificationPageList).toList(); if (list != null) { notificationPageEntity.list = list; } return notificationPageEntity; } Map $NotificationPageEntityToJson(NotificationPageEntity entity) { final Map data = {}; data['count'] = entity.count; data['page'] = entity.page; data['limit'] = entity.limit; data['count_page'] = entity.countPage; data['list'] = entity.list?.map((v) => v.toJson()).toList(); return data; } extension NotificationPageEntityExtension on NotificationPageEntity { NotificationPageEntity copyWith({ int? count, int? page, int? limit, int? countPage, List? list, }) { return NotificationPageEntity() ..count = count ?? this.count ..page = page ?? this.page ..limit = limit ?? this.limit ..countPage = countPage ?? this.countPage ..list = list ?? this.list; } } NotificationPageList $NotificationPageListFromJson(Map json) { final NotificationPageList notificationPageList = NotificationPageList(); final String? id = jsonConvert.convert(json['id']); if (id != null) { notificationPageList.id = id; } final String? estateId = jsonConvert.convert(json['estate_id']); if (estateId != null) { notificationPageList.estateId = estateId; } final String? type = jsonConvert.convert(json['type']); if (type != null) { notificationPageList.type = type; } final String? title = jsonConvert.convert(json['title']); if (title != null) { notificationPageList.title = title; } final String? body = jsonConvert.convert(json['body']); if (body != null) { notificationPageList.body = body; } final NotificationPageListData? data = jsonConvert.convert(json['data']); if (data != null) { notificationPageList.data = data; } final bool? read = jsonConvert.convert(json['read']); if (read != null) { notificationPageList.read = read; } final String? createdAt = jsonConvert.convert(json['created_at']); if (createdAt != null) { notificationPageList.createdAt = createdAt; } return notificationPageList; } Map $NotificationPageListToJson(NotificationPageList entity) { final Map data = {}; data['id'] = entity.id; data['estate_id'] = entity.estateId; data['type'] = entity.type; data['title'] = entity.title; data['body'] = entity.body; data['data'] = entity.data?.toJson(); data['read'] = entity.read; data['created_at'] = entity.createdAt; return data; } extension NotificationPageListExtension on NotificationPageList { NotificationPageList copyWith({ String? id, String? estateId, String? type, String? title, String? body, NotificationPageListData? data, bool? read, String? createdAt, }) { return NotificationPageList() ..id = id ?? this.id ..estateId = estateId ?? this.estateId ..type = type ?? this.type ..title = title ?? this.title ..body = body ?? this.body ..data = data ?? this.data ..read = read ?? this.read ..createdAt = createdAt ?? this.createdAt; } } NotificationPageListData $NotificationPageListDataFromJson(Map json) { final NotificationPageListData notificationPageListData = NotificationPageListData(); final String? id = jsonConvert.convert(json['id']); if (id != null) { notificationPageListData.id = id; } final String? estateOnlineFormId = jsonConvert.convert(json['estate_online_form_id']); if (estateOnlineFormId != null) { notificationPageListData.estateOnlineFormId = estateOnlineFormId; } final String? onlineFormTypeId = jsonConvert.convert(json['online_form_type_id']); if (onlineFormTypeId != null) { notificationPageListData.onlineFormTypeId = onlineFormTypeId; } final String? type = jsonConvert.convert(json['type']); if (type != null) { notificationPageListData.type = type; } return notificationPageListData; } Map $NotificationPageListDataToJson(NotificationPageListData entity) { final Map data = {}; data['id'] = entity.id; data['estate_online_form_id'] = entity.estateOnlineFormId; data['online_form_type_id'] = entity.onlineFormTypeId; data['type'] = entity.type; return data; } extension NotificationPageListDataExtension on NotificationPageListData { NotificationPageListData copyWith({ String? id, String? estateOnlineFormId, String? onlineFormTypeId, String? type, }) { return NotificationPageListData() ..id = id ?? this.id ..estateOnlineFormId = estateOnlineFormId ?? this.estateOnlineFormId ..onlineFormTypeId = onlineFormTypeId ?? this.onlineFormTypeId ..type = type ?? this.type; } }