property_sale_rent_entity.g.dart 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/property_sale_rent_entity.dart';
  3. PropertySaleRentEntity $PropertySaleRentEntityFromJson(Map<String, dynamic> json) {
  4. final PropertySaleRentEntity propertySaleRentEntity = PropertySaleRentEntity();
  5. final int? count = jsonConvert.convert<int>(json['count']);
  6. if (count != null) {
  7. propertySaleRentEntity.count = count;
  8. }
  9. final int? page = jsonConvert.convert<int>(json['page']);
  10. if (page != null) {
  11. propertySaleRentEntity.page = page;
  12. }
  13. final int? limit = jsonConvert.convert<int>(json['limit']);
  14. if (limit != null) {
  15. propertySaleRentEntity.limit = limit;
  16. }
  17. final int? countPage = jsonConvert.convert<int>(json['count_page']);
  18. if (countPage != null) {
  19. propertySaleRentEntity.countPage = countPage;
  20. }
  21. final List<PropertySaleRentList>? list = (json['list'] as List<dynamic>?)?.map(
  22. (e) => jsonConvert.convert<PropertySaleRentList>(e) as PropertySaleRentList).toList();
  23. if (list != null) {
  24. propertySaleRentEntity.list = list;
  25. }
  26. return propertySaleRentEntity;
  27. }
  28. Map<String, dynamic> $PropertySaleRentEntityToJson(PropertySaleRentEntity entity) {
  29. final Map<String, dynamic> data = <String, dynamic>{};
  30. data['count'] = entity.count;
  31. data['page'] = entity.page;
  32. data['limit'] = entity.limit;
  33. data['count_page'] = entity.countPage;
  34. data['list'] = entity.list?.map((v) => v.toJson()).toList();
  35. return data;
  36. }
  37. extension PropertySaleRentEntityExtension on PropertySaleRentEntity {
  38. PropertySaleRentEntity copyWith({
  39. int? count,
  40. int? page,
  41. int? limit,
  42. int? countPage,
  43. List<PropertySaleRentList>? list,
  44. }) {
  45. return PropertySaleRentEntity()
  46. ..count = count ?? this.count
  47. ..page = page ?? this.page
  48. ..limit = limit ?? this.limit
  49. ..countPage = countPage ?? this.countPage
  50. ..list = list ?? this.list;
  51. }
  52. }
  53. PropertySaleRentList $PropertySaleRentListFromJson(Map<String, dynamic> json) {
  54. final PropertySaleRentList propertySaleRentList = PropertySaleRentList();
  55. final int? id = jsonConvert.convert<int>(json['id']);
  56. if (id != null) {
  57. propertySaleRentList.id = id;
  58. }
  59. final int? type = jsonConvert.convert<int>(json['type']);
  60. if (type != null) {
  61. propertySaleRentList.type = type;
  62. }
  63. final String? title = jsonConvert.convert<String>(json['title']);
  64. if (title != null) {
  65. propertySaleRentList.title = title;
  66. }
  67. final String? price = jsonConvert.convert<String>(json['price']);
  68. if (price != null) {
  69. propertySaleRentList.price = price;
  70. }
  71. final String? priceShow = jsonConvert.convert<String>(json['price_show']);
  72. if (priceShow != null) {
  73. propertySaleRentList.priceShow = priceShow;
  74. }
  75. final String? units = jsonConvert.convert<String>(json['units']);
  76. if (units != null) {
  77. propertySaleRentList.units = units;
  78. }
  79. final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  80. if (createdAt != null) {
  81. propertySaleRentList.createdAt = createdAt;
  82. }
  83. return propertySaleRentList;
  84. }
  85. Map<String, dynamic> $PropertySaleRentListToJson(PropertySaleRentList entity) {
  86. final Map<String, dynamic> data = <String, dynamic>{};
  87. data['id'] = entity.id;
  88. data['type'] = entity.type;
  89. data['title'] = entity.title;
  90. data['price'] = entity.price;
  91. data['price_show'] = entity.priceShow;
  92. data['units'] = entity.units;
  93. data['created_at'] = entity.createdAt;
  94. return data;
  95. }
  96. extension PropertySaleRentListExtension on PropertySaleRentList {
  97. PropertySaleRentList copyWith({
  98. int? id,
  99. int? type,
  100. String? title,
  101. String? price,
  102. String? priceShow,
  103. String? units,
  104. String? createdAt,
  105. }) {
  106. return PropertySaleRentList()
  107. ..id = id ?? this.id
  108. ..type = type ?? this.type
  109. ..title = title ?? this.title
  110. ..price = price ?? this.price
  111. ..priceShow = priceShow ?? this.priceShow
  112. ..units = units ?? this.units
  113. ..createdAt = createdAt ?? this.createdAt;
  114. }
  115. }