import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/garage_sale_rent_entity.dart'; GarageSaleRentEntity $GarageSaleRentEntityFromJson(Map json) { final GarageSaleRentEntity garageSaleRentEntity = GarageSaleRentEntity(); final int? count = jsonConvert.convert(json['count']); if (count != null) { garageSaleRentEntity.count = count; } final int? page = jsonConvert.convert(json['page']); if (page != null) { garageSaleRentEntity.page = page; } final int? limit = jsonConvert.convert(json['limit']); if (limit != null) { garageSaleRentEntity.limit = limit; } final int? countPage = jsonConvert.convert(json['count_page']); if (countPage != null) { garageSaleRentEntity.countPage = countPage; } final List? list = (json['list'] as List?)?.map( (e) => jsonConvert.convert(e) as GarageSaleRentList).toList(); if (list != null) { garageSaleRentEntity.list = list; } return garageSaleRentEntity; } Map $GarageSaleRentEntityToJson(GarageSaleRentEntity 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 GarageSaleRentEntityExtension on GarageSaleRentEntity { GarageSaleRentEntity copyWith({ int? count, int? page, int? limit, int? countPage, List? list, }) { return GarageSaleRentEntity() ..count = count ?? this.count ..page = page ?? this.page ..limit = limit ?? this.limit ..countPage = countPage ?? this.countPage ..list = list ?? this.list; } } GarageSaleRentList $GarageSaleRentListFromJson(Map json) { final GarageSaleRentList garageSaleRentList = GarageSaleRentList(); final int? id = jsonConvert.convert(json['id']); if (id != null) { garageSaleRentList.id = id; } final String? title = jsonConvert.convert(json['title']); if (title != null) { garageSaleRentList.title = title; } final int? price = jsonConvert.convert(json['price']); if (price != null) { garageSaleRentList.price = price; } final List? resources = (json['resources'] as List?)?.map( (e) => jsonConvert.convert(e) as String).toList(); if (resources != null) { garageSaleRentList.resources = resources; } final String? createdAt = jsonConvert.convert(json['created_at']); if (createdAt != null) { garageSaleRentList.createdAt = createdAt; } final bool? liked = jsonConvert.convert(json['liked']); if (liked != null) { garageSaleRentList.liked = liked; } final int? likesCount = jsonConvert.convert(json['likes_count']); if (likesCount != null) { garageSaleRentList.likesCount = likesCount; } final GarageSaleRentListAccount? account = jsonConvert.convert(json['account']); if (account != null) { garageSaleRentList.account = account; } return garageSaleRentList; } Map $GarageSaleRentListToJson(GarageSaleRentList 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['liked'] = entity.liked; data['likes_count'] = entity.likesCount; data['account'] = entity.account?.toJson(); return data; } extension GarageSaleRentListExtension on GarageSaleRentList { GarageSaleRentList copyWith({ int? id, String? title, int? price, List? resources, String? createdAt, bool? liked, int? likesCount, GarageSaleRentListAccount? account, }) { return GarageSaleRentList() ..id = id ?? this.id ..title = title ?? this.title ..price = price ?? this.price ..resources = resources ?? this.resources ..createdAt = createdAt ?? this.createdAt ..liked = liked ?? this.liked ..likesCount = likesCount ?? this.likesCount ..account = account ?? this.account; } } GarageSaleRentListAccount $GarageSaleRentListAccountFromJson(Map json) { final GarageSaleRentListAccount garageSaleRentListAccount = GarageSaleRentListAccount(); final int? id = jsonConvert.convert(json['id']); if (id != null) { garageSaleRentListAccount.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { garageSaleRentListAccount.name = name; } final String? avatar = jsonConvert.convert(json['avatar']); if (avatar != null) { garageSaleRentListAccount.avatar = avatar; } return garageSaleRentListAccount; } Map $GarageSaleRentListAccountToJson(GarageSaleRentListAccount entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['avatar'] = entity.avatar; return data; } extension GarageSaleRentListAccountExtension on GarageSaleRentListAccount { GarageSaleRentListAccount copyWith({ int? id, String? name, String? avatar, }) { return GarageSaleRentListAccount() ..id = id ?? this.id ..name = name ?? this.name ..avatar = avatar ?? this.avatar; } }