import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/notice_board_documents_entity.dart'; NoticeBoardDocumentsEntity $NoticeBoardDocumentsEntityFromJson(Map json) { final NoticeBoardDocumentsEntity noticeBoardDocumentsEntity = NoticeBoardDocumentsEntity(); final int? count = jsonConvert.convert(json['count']); if (count != null) { noticeBoardDocumentsEntity.count = count; } final int? page = jsonConvert.convert(json['page']); if (page != null) { noticeBoardDocumentsEntity.page = page; } final int? limit = jsonConvert.convert(json['limit']); if (limit != null) { noticeBoardDocumentsEntity.limit = limit; } final int? countPage = jsonConvert.convert(json['count_page']); if (countPage != null) { noticeBoardDocumentsEntity.countPage = countPage; } final List? list = (json['list'] as List?)?.map( (e) => jsonConvert.convert(e) as NoticeBoardDocumentsList).toList(); if (list != null) { noticeBoardDocumentsEntity.list = list; } return noticeBoardDocumentsEntity; } Map $NoticeBoardDocumentsEntityToJson(NoticeBoardDocumentsEntity 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 NoticeBoardDocumentsEntityExtension on NoticeBoardDocumentsEntity { NoticeBoardDocumentsEntity copyWith({ int? count, int? page, int? limit, int? countPage, List? list, }) { return NoticeBoardDocumentsEntity() ..count = count ?? this.count ..page = page ?? this.page ..limit = limit ?? this.limit ..countPage = countPage ?? this.countPage ..list = list ?? this.list; } } NoticeBoardDocumentsList $NoticeBoardDocumentsListFromJson(Map json) { final NoticeBoardDocumentsList noticeBoardDocumentsList = NoticeBoardDocumentsList(); final int? id = jsonConvert.convert(json['id']); if (id != null) { noticeBoardDocumentsList.id = id; } final int? parentId = jsonConvert.convert(json['parent_id']); if (parentId != null) { noticeBoardDocumentsList.parentId = parentId; } final String? name = jsonConvert.convert(json['name']); if (name != null) { noticeBoardDocumentsList.name = name; } final String? url = jsonConvert.convert(json['url']); if (url != null) { noticeBoardDocumentsList.url = url; } return noticeBoardDocumentsList; } Map $NoticeBoardDocumentsListToJson(NoticeBoardDocumentsList entity) { final Map data = {}; data['id'] = entity.id; data['parent_id'] = entity.parentId; data['name'] = entity.name; data['url'] = entity.url; return data; } extension NoticeBoardDocumentsListExtension on NoticeBoardDocumentsList { NoticeBoardDocumentsList copyWith({ int? id, int? parentId, String? name, String? url, }) { return NoticeBoardDocumentsList() ..id = id ?? this.id ..parentId = parentId ?? this.parentId ..name = name ?? this.name ..url = url ?? this.url; } }