import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/response/hotel_info_entity.dart'; HotelInfoEntity $HotelInfoEntityFromJson(Map json) { final HotelInfoEntity hotelInfoEntity = HotelInfoEntity(); final int? adminId = jsonConvert.convert(json['admin_id']); if (adminId != null) { hotelInfoEntity.adminId = adminId; } final String? name = jsonConvert.convert(json['name']); if (name != null) { hotelInfoEntity.name = name; } final int? hotelId = jsonConvert.convert(json['hotel_id']); if (hotelId != null) { hotelInfoEntity.hotelId = hotelId; } final String? hotelName = jsonConvert.convert(json['hotel_name']); if (hotelName != null) { hotelInfoEntity.hotelName = hotelName; } final List? menus = (json['menus'] as List?)?.map( (e) => jsonConvert.convert(e) as HotelInfoMenus).toList(); if (menus != null) { hotelInfoEntity.menus = menus; } final String? token = jsonConvert.convert(json['token']); if (token != null) { hotelInfoEntity.token = token; } return hotelInfoEntity; } Map $HotelInfoEntityToJson(HotelInfoEntity entity) { final Map data = {}; data['admin_id'] = entity.adminId; data['name'] = entity.name; data['hotel_id'] = entity.hotelId; data['hotel_name'] = entity.hotelName; data['menus'] = entity.menus?.map((v) => v.toJson()).toList(); data['token'] = entity.token; return data; } extension HotelInfoEntityExtension on HotelInfoEntity { HotelInfoEntity copyWith({ int? adminId, String? name, int? hotelId, String? hotelName, List? menus, String? token, }) { return HotelInfoEntity() ..adminId = adminId ?? this.adminId ..name = name ?? this.name ..hotelId = hotelId ?? this.hotelId ..hotelName = hotelName ?? this.hotelName ..menus = menus ?? this.menus ..token = token ?? this.token; } } HotelInfoMenus $HotelInfoMenusFromJson(Map json) { final HotelInfoMenus hotelInfoMenus = HotelInfoMenus(); final String? key = jsonConvert.convert(json['key']); if (key != null) { hotelInfoMenus.key = key; } final String? name = jsonConvert.convert(json['name']); if (name != null) { hotelInfoMenus.name = name; } final List? children = (json['children'] as List?)?.map( (e) => jsonConvert.convert(e) as HotelInfoMenusChildren).toList(); if (children != null) { hotelInfoMenus.children = children; } return hotelInfoMenus; } Map $HotelInfoMenusToJson(HotelInfoMenus entity) { final Map data = {}; data['key'] = entity.key; data['name'] = entity.name; data['children'] = entity.children?.map((v) => v.toJson()).toList(); return data; } extension HotelInfoMenusExtension on HotelInfoMenus { HotelInfoMenus copyWith({ String? key, String? name, List? children, }) { return HotelInfoMenus() ..key = key ?? this.key ..name = name ?? this.name ..children = children ?? this.children; } } HotelInfoMenusChildren $HotelInfoMenusChildrenFromJson(Map json) { final HotelInfoMenusChildren hotelInfoMenusChildren = HotelInfoMenusChildren(); final String? key = jsonConvert.convert(json['key']); if (key != null) { hotelInfoMenusChildren.key = key; } final String? name = jsonConvert.convert(json['name']); if (name != null) { hotelInfoMenusChildren.name = name; } return hotelInfoMenusChildren; } Map $HotelInfoMenusChildrenToJson(HotelInfoMenusChildren entity) { final Map data = {}; data['key'] = entity.key; data['name'] = entity.name; return data; } extension HotelInfoMenusChildrenExtension on HotelInfoMenusChildren { HotelInfoMenusChildren copyWith({ String? key, String? name, }) { return HotelInfoMenusChildren() ..key = key ?? this.key ..name = name ?? this.name; } }