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? id = jsonConvert.convert(json['id']); if (id != null) { mypostsSaleRentEntity.id = id; } final String? title = jsonConvert.convert(json['title']); if (title != null) { mypostsSaleRentEntity.title = title; } final int? price = jsonConvert.convert(json['price']); if (price != null) { mypostsSaleRentEntity.price = price; } final List? resources = (json['resources'] as List?)?.map( (e) => jsonConvert.convert(e) as String).toList(); if (resources != null) { mypostsSaleRentEntity.resources = resources; } final String? createdAt = jsonConvert.convert(json['created_at']); if (createdAt != null) { mypostsSaleRentEntity.createdAt = createdAt; } final int? likesCount = jsonConvert.convert(json['likes_count']); if (likesCount != null) { mypostsSaleRentEntity.likesCount = likesCount; } return mypostsSaleRentEntity; } Map $MypostsSaleRentEntityToJson(MypostsSaleRentEntity 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 MypostsSaleRentEntityExtension on MypostsSaleRentEntity { MypostsSaleRentEntity copyWith({ int? id, String? title, int? price, List? resources, String? createdAt, int? likesCount, }) { return MypostsSaleRentEntity() ..id = id ?? this.id ..title = title ?? this.title ..price = price ?? this.price ..resources = resources ?? this.resources ..createdAt = createdAt ?? this.createdAt ..likesCount = likesCount ?? this.likesCount; } }