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