import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/user_me_entity.dart'; UserMeEntity $UserMeEntityFromJson(Map json) { final UserMeEntity userMeEntity = UserMeEntity(); final String? id = jsonConvert.convert(json['id']); if (id != null) { userMeEntity.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { userMeEntity.name = name; } final String? avatar = jsonConvert.convert(json['avatar']); if (avatar != null) { userMeEntity.avatar = avatar; } final String? phone = jsonConvert.convert(json['phone']); if (phone != null) { userMeEntity.phone = phone; } final String? email = jsonConvert.convert(json['email']); if (email != null) { userMeEntity.email = email; } final String? followsCount = jsonConvert.convert( json['follows_count']); if (followsCount != null) { userMeEntity.followsCount = followsCount; } final String? flowersCount = jsonConvert.convert( json['flowers_count']); if (flowersCount != null) { userMeEntity.flowersCount = flowersCount; } final String? postsCount = jsonConvert.convert(json['posts_count']); if (postsCount != null) { userMeEntity.postsCount = postsCount; } final List? households = (json['households'] as List< dynamic>?) ?.map( (e) => jsonConvert.convert(e) as UserMeHouseholds) .toList(); if (households != null) { userMeEntity.households = households; } final List? estates = (json['estates'] as List?) ?.map( (e) => jsonConvert.convert(e) as UserMeEstates) .toList(); if (estates != null) { userMeEntity.estates = estates; } final UserMeDefaultUnit? defaultUnit = jsonConvert.convert( json['default_unit']); if (defaultUnit != null) { userMeEntity.defaultUnit = defaultUnit; } final UserMeInformation? information = jsonConvert.convert( json['information']); if (information != null) { userMeEntity.information = information; } return userMeEntity; } Map $UserMeEntityToJson(UserMeEntity entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['avatar'] = entity.avatar; data['phone'] = entity.phone; data['email'] = entity.email; data['follows_count'] = entity.followsCount; data['flowers_count'] = entity.flowersCount; data['posts_count'] = entity.postsCount; data['households'] = entity.households?.map((v) => v.toJson()).toList(); data['estates'] = entity.estates?.map((v) => v.toJson()).toList(); data['default_unit'] = entity.defaultUnit?.toJson(); data['information'] = entity.information?.toJson(); return data; } extension UserMeEntityExtension on UserMeEntity { UserMeEntity copyWith({ String? id, String? name, String? avatar, String? phone, String? email, String? followsCount, String? flowersCount, String? postsCount, List? households, List? estates, UserMeDefaultUnit? defaultUnit, UserMeInformation? information, }) { return UserMeEntity() ..id = id ?? this.id ..name = name ?? this.name ..avatar = avatar ?? this.avatar ..phone = phone ?? this.phone ..email = email ?? this.email ..followsCount = followsCount ?? this.followsCount ..flowersCount = flowersCount ?? this.flowersCount ..postsCount = postsCount ?? this.postsCount ..households = households ?? this.households ..estates = estates ?? this.estates ..defaultUnit = defaultUnit ?? this.defaultUnit ..information = information ?? this.information; } } UserMeHouseholds $UserMeHouseholdsFromJson(Map json) { final UserMeHouseholds userMeHouseholds = UserMeHouseholds(); final String? id = jsonConvert.convert(json['id']); if (id != null) { userMeHouseholds.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { userMeHouseholds.name = name; } final String? avatar = jsonConvert.convert(json['avatar']); if (avatar != null) { userMeHouseholds.avatar = avatar; } return userMeHouseholds; } Map $UserMeHouseholdsToJson(UserMeHouseholds entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['avatar'] = entity.avatar; return data; } extension UserMeHouseholdsExtension on UserMeHouseholds { UserMeHouseholds copyWith({ String? id, String? name, String? avatar, }) { return UserMeHouseholds() ..id = id ?? this.id ..name = name ?? this.name ..avatar = avatar ?? this.avatar; } } UserMeEstates $UserMeEstatesFromJson(Map json) { final UserMeEstates userMeEstates = UserMeEstates(); final String? id = jsonConvert.convert(json['id']); if (id != null) { userMeEstates.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { userMeEstates.name = name; } final List? accounts = (json['accounts'] as List< dynamic>?) ?.map( (e) => jsonConvert.convert(e) as UserMeEstatesAccounts) .toList(); if (accounts != null) { userMeEstates.accounts = accounts; } return userMeEstates; } Map $UserMeEstatesToJson(UserMeEstates entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['accounts'] = entity.accounts?.map((v) => v.toJson()).toList(); return data; } extension UserMeEstatesExtension on UserMeEstates { UserMeEstates copyWith({ String? id, String? name, List? accounts, }) { return UserMeEstates() ..id = id ?? this.id ..name = name ?? this.name ..accounts = accounts ?? this.accounts; } } UserMeEstatesAccounts $UserMeEstatesAccountsFromJson( Map json) { final UserMeEstatesAccounts userMeEstatesAccounts = UserMeEstatesAccounts(); final String? id = jsonConvert.convert(json['id']); if (id != null) { userMeEstatesAccounts.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { userMeEstatesAccounts.name = name; } final String? avatar = jsonConvert.convert(json['avatar']); if (avatar != null) { userMeEstatesAccounts.avatar = avatar; } final String? type = jsonConvert.convert(json['type']); if (type != null) { userMeEstatesAccounts.type = type; } final int? isDefault = jsonConvert.convert(json['default']); if (isDefault != null) { userMeEstatesAccounts.isDefault = isDefault; } final String? status = jsonConvert.convert(json['status']); if (status != null) { userMeEstatesAccounts.status = status; } final UserMeEstatesAccountsUnit? unit = jsonConvert.convert< UserMeEstatesAccountsUnit>(json['unit']); if (unit != null) { userMeEstatesAccounts.unit = unit; } return userMeEstatesAccounts; } Map $UserMeEstatesAccountsToJson( UserMeEstatesAccounts entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['avatar'] = entity.avatar; data['type'] = entity.type; data['default'] = entity.isDefault; data['status'] = entity.status; data['unit'] = entity.unit?.toJson(); return data; } extension UserMeEstatesAccountsExtension on UserMeEstatesAccounts { UserMeEstatesAccounts copyWith({ String? id, String? name, String? avatar, String? type, int? isDefault, String? status, UserMeEstatesAccountsUnit? unit, }) { return UserMeEstatesAccounts() ..id = id ?? this.id ..name = name ?? this.name ..avatar = avatar ?? this.avatar ..type = type ?? this.type ..isDefault = isDefault ?? this.isDefault ..status = status ?? this.status ..unit = unit ?? this.unit; } } UserMeEstatesAccountsUnit $UserMeEstatesAccountsUnitFromJson( Map json) { final UserMeEstatesAccountsUnit userMeEstatesAccountsUnit = UserMeEstatesAccountsUnit(); final String? id = jsonConvert.convert(json['id']); if (id != null) { userMeEstatesAccountsUnit.id = id; } final String? block = jsonConvert.convert(json['block']); if (block != null) { userMeEstatesAccountsUnit.block = block; } final String? street = jsonConvert.convert(json['street']); if (street != null) { userMeEstatesAccountsUnit.street = street; } final String? unit = jsonConvert.convert(json['unit']); if (unit != null) { userMeEstatesAccountsUnit.unit = unit; } final String? address = jsonConvert.convert(json['address']); if (address != null) { userMeEstatesAccountsUnit.address = address; } return userMeEstatesAccountsUnit; } Map $UserMeEstatesAccountsUnitToJson( UserMeEstatesAccountsUnit entity) { final Map data = {}; data['id'] = entity.id; data['block'] = entity.block; data['street'] = entity.street; data['unit'] = entity.unit; data['address'] = entity.address; return data; } extension UserMeEstatesAccountsUnitExtension on UserMeEstatesAccountsUnit { UserMeEstatesAccountsUnit copyWith({ String? id, String? block, String? street, String? unit, String? address, }) { return UserMeEstatesAccountsUnit() ..id = id ?? this.id ..block = block ?? this.block ..street = street ?? this.street ..unit = unit ?? this.unit ..address = address ?? this.address; } } UserMeDefaultUnit $UserMeDefaultUnitFromJson(Map json) { final UserMeDefaultUnit userMeDefaultUnit = UserMeDefaultUnit(); final String? id = jsonConvert.convert(json['id']); if (id != null) { userMeDefaultUnit.id = id; } final String? estateId = jsonConvert.convert(json['estate_id']); if (estateId != null) { userMeDefaultUnit.estateId = estateId; } final String? block = jsonConvert.convert(json['block']); if (block != null) { userMeDefaultUnit.block = block; } final String? street = jsonConvert.convert(json['street']); if (street != null) { userMeDefaultUnit.street = street; } final String? unit = jsonConvert.convert(json['unit']); if (unit != null) { userMeDefaultUnit.unit = unit; } final String? address = jsonConvert.convert(json['address']); if (address != null) { userMeDefaultUnit.address = address; } final int? type = jsonConvert.convert(json['type']); if (type != null) { userMeDefaultUnit.type = type; } return userMeDefaultUnit; } Map $UserMeDefaultUnitToJson(UserMeDefaultUnit entity) { final Map data = {}; data['id'] = entity.id; data['estate_id'] = entity.estateId; data['block'] = entity.block; data['street'] = entity.street; data['unit'] = entity.unit; data['address'] = entity.address; data['type'] = entity.type; return data; } extension UserMeDefaultUnitExtension on UserMeDefaultUnit { UserMeDefaultUnit copyWith({ String? id, String? estateId, String? block, String? street, String? unit, String? address, int? type, }) { return UserMeDefaultUnit() ..id = id ?? this.id ..estateId = estateId ?? this.estateId ..block = block ?? this.block ..street = street ?? this.street ..unit = unit ?? this.unit ..address = address ?? this.address ..type = type ?? this.type; } } UserMeInformation $UserMeInformationFromJson(Map json) { final UserMeInformation userMeInformation = UserMeInformation(); final String? firstName = jsonConvert.convert(json['first_name']); if (firstName != null) { userMeInformation.firstName = firstName; } final String? lastName = jsonConvert.convert(json['last_name']); if (lastName != null) { userMeInformation.lastName = lastName; } final String? countryCode = jsonConvert.convert(json['country_code']); if (countryCode != null) { userMeInformation.countryCode = countryCode; } final String? phone = jsonConvert.convert(json['phone']); if (phone != null) { userMeInformation.phone = phone; } return userMeInformation; } Map $UserMeInformationToJson(UserMeInformation entity) { final Map data = {}; data['first_name'] = entity.firstName; data['last_name'] = entity.lastName; data['country_code'] = entity.countryCode; data['phone'] = entity.phone; return data; } extension UserMeInformationExtension on UserMeInformation { UserMeInformation copyWith({ String? firstName, String? lastName, String? countryCode, String? phone, }) { return UserMeInformation() ..firstName = firstName ?? this.firstName ..lastName = lastName ?? this.lastName ..countryCode = countryCode ?? this.countryCode ..phone = phone ?? this.phone; } }