import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/join_estate_success_entity.dart'; JoinEstateSuccessEntity $JoinEstateSuccessEntityFromJson(Map json) { final JoinEstateSuccessEntity joinEstateSuccessEntity = JoinEstateSuccessEntity(); final String? sn = jsonConvert.convert(json['sn']); if (sn != null) { joinEstateSuccessEntity.sn = sn; } final String? userId = jsonConvert.convert(json['user_id']); if (userId != null) { joinEstateSuccessEntity.userId = userId; } final String? stateId = jsonConvert.convert(json['state_id']); if (stateId != null) { joinEstateSuccessEntity.stateId = stateId; } final String? type = jsonConvert.convert(json['type']); if (type != null) { joinEstateSuccessEntity.type = type; } final int? status = jsonConvert.convert(json['status']); if (status != null) { joinEstateSuccessEntity.status = status; } final List? files = (json['files'] as List?)?.map( (e) => jsonConvert.convert(e) as String).toList(); if (files != null) { joinEstateSuccessEntity.files = files; } final String? updatedAt = jsonConvert.convert(json['updated_at']); if (updatedAt != null) { joinEstateSuccessEntity.updatedAt = updatedAt; } final String? createdAt = jsonConvert.convert(json['created_at']); if (createdAt != null) { joinEstateSuccessEntity.createdAt = createdAt; } final String? id = jsonConvert.convert(json['id']); if (id != null) { joinEstateSuccessEntity.id = id; } final JoinEstateSuccessEstate? estate = jsonConvert.convert(json['estate']); if (estate != null) { joinEstateSuccessEntity.estate = estate; } return joinEstateSuccessEntity; } Map $JoinEstateSuccessEntityToJson(JoinEstateSuccessEntity entity) { final Map data = {}; data['sn'] = entity.sn; data['user_id'] = entity.userId; data['state_id'] = entity.stateId; data['type'] = entity.type; data['status'] = entity.status; data['files'] = entity.files; data['updated_at'] = entity.updatedAt; data['created_at'] = entity.createdAt; data['id'] = entity.id; data['estate'] = entity.estate?.toJson(); return data; } extension JoinEstateSuccessEntityExtension on JoinEstateSuccessEntity { JoinEstateSuccessEntity copyWith({ String? sn, String? userId, String? stateId, String? type, int? status, List? files, String? updatedAt, String? createdAt, String? id, JoinEstateSuccessEstate? estate, }) { return JoinEstateSuccessEntity() ..sn = sn ?? this.sn ..userId = userId ?? this.userId ..stateId = stateId ?? this.stateId ..type = type ?? this.type ..status = status ?? this.status ..files = files ?? this.files ..updatedAt = updatedAt ?? this.updatedAt ..createdAt = createdAt ?? this.createdAt ..id = id ?? this.id ..estate = estate ?? this.estate; } } JoinEstateSuccessEstate $JoinEstateSuccessEstateFromJson(Map json) { final JoinEstateSuccessEstate joinEstateSuccessEstate = JoinEstateSuccessEstate(); final String? id = jsonConvert.convert(json['id']); if (id != null) { joinEstateSuccessEstate.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { joinEstateSuccessEstate.name = name; } final JoinEstateSuccessEstateInformation? information = jsonConvert.convert(json['information']); if (information != null) { joinEstateSuccessEstate.information = information; } return joinEstateSuccessEstate; } Map $JoinEstateSuccessEstateToJson(JoinEstateSuccessEstate entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['information'] = entity.information?.toJson(); return data; } extension JoinEstateSuccessEstateExtension on JoinEstateSuccessEstate { JoinEstateSuccessEstate copyWith({ String? id, String? name, JoinEstateSuccessEstateInformation? information, }) { return JoinEstateSuccessEstate() ..id = id ?? this.id ..name = name ?? this.name ..information = information ?? this.information; } } JoinEstateSuccessEstateInformation $JoinEstateSuccessEstateInformationFromJson(Map json) { final JoinEstateSuccessEstateInformation joinEstateSuccessEstateInformation = JoinEstateSuccessEstateInformation(); final String? id = jsonConvert.convert(json['id']); if (id != null) { joinEstateSuccessEstateInformation.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { joinEstateSuccessEstateInformation.name = name; } final String? email = jsonConvert.convert(json['email']); if (email != null) { joinEstateSuccessEstateInformation.email = email; } final String? address = jsonConvert.convert(json['address']); if (address != null) { joinEstateSuccessEstateInformation.address = address; } final String? contactNumber = jsonConvert.convert(json['contact_number']); if (contactNumber != null) { joinEstateSuccessEstateInformation.contactNumber = contactNumber; } return joinEstateSuccessEstateInformation; } Map $JoinEstateSuccessEstateInformationToJson(JoinEstateSuccessEstateInformation entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['email'] = entity.email; data['address'] = entity.address; data['contact_number'] = entity.contactNumber; return data; } extension JoinEstateSuccessEstateInformationExtension on JoinEstateSuccessEstateInformation { JoinEstateSuccessEstateInformation copyWith({ String? id, String? name, String? email, String? address, String? contactNumber, }) { return JoinEstateSuccessEstateInformation() ..id = id ?? this.id ..name = name ?? this.name ..email = email ?? this.email ..address = address ?? this.address ..contactNumber = contactNumber ?? this.contactNumber; } }