rewards_detail_entity.g.dart 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/rewards_detail_entity.dart';
  3. RewardsDetailEntity $RewardsDetailEntityFromJson(Map<String, dynamic> json) {
  4. final RewardsDetailEntity rewardsDetailEntity = RewardsDetailEntity();
  5. final int? id = jsonConvert.convert<int>(json['id']);
  6. if (id != null) {
  7. rewardsDetailEntity.id = id;
  8. }
  9. final String? title = jsonConvert.convert<String>(json['title']);
  10. if (title != null) {
  11. rewardsDetailEntity.title = title;
  12. }
  13. final List<String>? resources = (json['resources'] as List<dynamic>?)?.map(
  14. (e) => jsonConvert.convert<String>(e) as String).toList();
  15. if (resources != null) {
  16. rewardsDetailEntity.resources = resources;
  17. }
  18. final int? originalPoint = jsonConvert.convert<int>(json['original_point']);
  19. if (originalPoint != null) {
  20. rewardsDetailEntity.originalPoint = originalPoint;
  21. }
  22. final int? point = jsonConvert.convert<int>(json['point']);
  23. if (point != null) {
  24. rewardsDetailEntity.point = point;
  25. }
  26. final String? description = jsonConvert.convert<String>(json['description']);
  27. if (description != null) {
  28. rewardsDetailEntity.description = description;
  29. }
  30. final bool? reservation = jsonConvert.convert<bool>(json['reservation']);
  31. if (reservation != null) {
  32. rewardsDetailEntity.reservation = reservation;
  33. }
  34. final String? start = jsonConvert.convert<String>(json['start']);
  35. if (start != null) {
  36. rewardsDetailEntity.start = start;
  37. }
  38. final String? end = jsonConvert.convert<String>(json['end']);
  39. if (end != null) {
  40. rewardsDetailEntity.end = end;
  41. }
  42. final String? redeemedStart = jsonConvert.convert<String>(
  43. json['redeemed_start']);
  44. if (redeemedStart != null) {
  45. rewardsDetailEntity.redeemedStart = redeemedStart;
  46. }
  47. final String? redeemedEnd = jsonConvert.convert<String>(json['redeemed_end']);
  48. if (redeemedEnd != null) {
  49. rewardsDetailEntity.redeemedEnd = redeemedEnd;
  50. }
  51. final String? package = jsonConvert.convert<String>(json['package']);
  52. if (package != null) {
  53. rewardsDetailEntity.package = package;
  54. }
  55. final String? notice = jsonConvert.convert<String>(json['notice']);
  56. if (notice != null) {
  57. rewardsDetailEntity.notice = notice;
  58. }
  59. final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  60. if (createdAt != null) {
  61. rewardsDetailEntity.createdAt = createdAt;
  62. }
  63. final List<RewardsDetailRedeemable>? redeemable = (json['redeemable'] as List<
  64. dynamic>?)?.map(
  65. (e) =>
  66. jsonConvert.convert<RewardsDetailRedeemable>(
  67. e) as RewardsDetailRedeemable).toList();
  68. if (redeemable != null) {
  69. rewardsDetailEntity.redeemable = redeemable;
  70. }
  71. return rewardsDetailEntity;
  72. }
  73. Map<String, dynamic> $RewardsDetailEntityToJson(RewardsDetailEntity entity) {
  74. final Map<String, dynamic> data = <String, dynamic>{};
  75. data['id'] = entity.id;
  76. data['title'] = entity.title;
  77. data['resources'] = entity.resources;
  78. data['original_point'] = entity.originalPoint;
  79. data['point'] = entity.point;
  80. data['description'] = entity.description;
  81. data['reservation'] = entity.reservation;
  82. data['start'] = entity.start;
  83. data['end'] = entity.end;
  84. data['redeemed_start'] = entity.redeemedStart;
  85. data['redeemed_end'] = entity.redeemedEnd;
  86. data['package'] = entity.package;
  87. data['notice'] = entity.notice;
  88. data['created_at'] = entity.createdAt;
  89. data['redeemable'] = entity.redeemable.map((v) => v.toJson()).toList();
  90. return data;
  91. }
  92. extension RewardsDetailEntityExtension on RewardsDetailEntity {
  93. RewardsDetailEntity copyWith({
  94. int? id,
  95. String? title,
  96. List<String>? resources,
  97. int? originalPoint,
  98. int? point,
  99. String? description,
  100. bool? reservation,
  101. String? start,
  102. String? end,
  103. String? redeemedStart,
  104. String? redeemedEnd,
  105. String? package,
  106. String? notice,
  107. String? createdAt,
  108. List<RewardsDetailRedeemable>? redeemable,
  109. }) {
  110. return RewardsDetailEntity()
  111. ..id = id ?? this.id
  112. ..title = title ?? this.title
  113. ..resources = resources ?? this.resources
  114. ..originalPoint = originalPoint ?? this.originalPoint
  115. ..point = point ?? this.point
  116. ..description = description ?? this.description
  117. ..reservation = reservation ?? this.reservation
  118. ..start = start ?? this.start
  119. ..end = end ?? this.end
  120. ..redeemedStart = redeemedStart ?? this.redeemedStart
  121. ..redeemedEnd = redeemedEnd ?? this.redeemedEnd
  122. ..package = package ?? this.package
  123. ..notice = notice ?? this.notice
  124. ..createdAt = createdAt ?? this.createdAt
  125. ..redeemable = redeemable ?? this.redeemable;
  126. }
  127. }
  128. RewardsDetailRedeemable $RewardsDetailRedeemableFromJson(
  129. Map<String, dynamic> json) {
  130. final RewardsDetailRedeemable rewardsDetailRedeemable = RewardsDetailRedeemable();
  131. final String? day = jsonConvert.convert<String>(json['day']);
  132. if (day != null) {
  133. rewardsDetailRedeemable.day = day;
  134. }
  135. final String? time = jsonConvert.convert<String>(json['time']);
  136. if (time != null) {
  137. rewardsDetailRedeemable.time = time;
  138. }
  139. return rewardsDetailRedeemable;
  140. }
  141. Map<String, dynamic> $RewardsDetailRedeemableToJson(
  142. RewardsDetailRedeemable entity) {
  143. final Map<String, dynamic> data = <String, dynamic>{};
  144. data['day'] = entity.day;
  145. data['time'] = entity.time;
  146. return data;
  147. }
  148. extension RewardsDetailRedeemableExtension on RewardsDetailRedeemable {
  149. RewardsDetailRedeemable copyWith({
  150. String? day,
  151. String? time,
  152. }) {
  153. return RewardsDetailRedeemable()
  154. ..day = day ?? this.day
  155. ..time = time ?? this.time;
  156. }
  157. }