import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/myposts_sale_rent_entity.dart'; MypostsSaleRentEntity $MypostsSaleRentEntityFromJson( Map json) { final MypostsSaleRentEntity mypostsSaleRentEntity = MypostsSaleRentEntity(); final int? count = jsonConvert.convert(json['count']); if (count != null) { mypostsSaleRentEntity.count = count; } final int? page = jsonConvert.convert(json['page']); if (page != null) { mypostsSaleRentEntity.page = page; } final int? limit = jsonConvert.convert(json['limit']); if (limit != null) { mypostsSaleRentEntity.limit = limit; } final int? countPage = jsonConvert.convert(json['count_page']); if (countPage != null) { mypostsSaleRentEntity.countPage = countPage; } final List? list = (json['list'] as List?) ?.map( (e) => jsonConvert.convert(e) as MypostsSaleRentList) .toList(); if (list != null) { mypostsSaleRentEntity.list = list; } return mypostsSaleRentEntity; } Map $MypostsSaleRentEntityToJson( MypostsSaleRentEntity 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 MypostsSaleRentEntityExtension on MypostsSaleRentEntity { MypostsSaleRentEntity copyWith({ int? count, int? page, int? limit, int? countPage, List? list, }) { return MypostsSaleRentEntity() ..count = count ?? this.count ..page = page ?? this.page ..limit = limit ?? this.limit ..countPage = countPage ?? this.countPage ..list = list ?? this.list; } } MypostsSaleRentList $MypostsSaleRentListFromJson(Map json) { final MypostsSaleRentList mypostsSaleRentList = MypostsSaleRentList(); final int? id = jsonConvert.convert(json['id']); if (id != null) { mypostsSaleRentList.id = id; } final String? title = jsonConvert.convert(json['title']); if (title != null) { mypostsSaleRentList.title = title; } final int? price = jsonConvert.convert(json['price']); if (price != null) { mypostsSaleRentList.price = price; } final List? resources = (json['resources'] as List?)?.map( (e) => jsonConvert.convert(e) as String).toList(); if (resources != null) { mypostsSaleRentList.resources = resources; } final String? createdAt = jsonConvert.convert(json['created_at']); if (createdAt != null) { mypostsSaleRentList.createdAt = createdAt; } final int? likesCount = jsonConvert.convert(json['likes_count']); if (likesCount != null) { mypostsSaleRentList.likesCount = likesCount; } return mypostsSaleRentList; } Map $MypostsSaleRentListToJson(MypostsSaleRentList entity) { final Map data = {}; data['id'] = entity.id; data['title'] = entity.title; data['price'] = entity.price; data['resources'] = entity.resources; data['created_at'] = entity.createdAt; data['likes_count'] = entity.likesCount; return data; } extension MypostsSaleRentListExtension on MypostsSaleRentList { MypostsSaleRentList copyWith({ int? id, String? title, int? price, List? resources, String? createdAt, int? likesCount, }) { return MypostsSaleRentList() ..id = id ?? this.id ..title = title ?? this.title ..price = price ?? this.price ..resources = resources ?? this.resources ..createdAt = createdAt ?? this.createdAt ..likesCount = likesCount ?? this.likesCount; } }