rewards_my_detail_entity.g.dart 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/rewards_my_detail_entity.dart';
  3. RewardsMyDetailEntity $RewardsMyDetailEntityFromJson(
  4. Map<String, dynamic> json) {
  5. final RewardsMyDetailEntity rewardsMyDetailEntity = RewardsMyDetailEntity();
  6. final int? id = jsonConvert.convert<int>(json['id']);
  7. if (id != null) {
  8. rewardsMyDetailEntity.id = id;
  9. }
  10. final int? redemptionCode = jsonConvert.convert<int>(json['redemption_code']);
  11. if (redemptionCode != null) {
  12. rewardsMyDetailEntity.redemptionCode = redemptionCode;
  13. }
  14. final String? usedAt = jsonConvert.convert<String>(json['used_at']);
  15. if (usedAt != null) {
  16. rewardsMyDetailEntity.usedAt = usedAt;
  17. }
  18. final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  19. if (createdAt != null) {
  20. rewardsMyDetailEntity.createdAt = createdAt;
  21. }
  22. final String? expiredAt = jsonConvert.convert<String>(json['expired_at']);
  23. if (expiredAt != null) {
  24. rewardsMyDetailEntity.expiredAt = expiredAt;
  25. }
  26. final int? quantity = jsonConvert.convert<int>(json['quantity']);
  27. if (quantity != null) {
  28. rewardsMyDetailEntity.quantity = quantity;
  29. }
  30. final RewardsMyDetailReward? reward = jsonConvert.convert<
  31. RewardsMyDetailReward>(json['reward']);
  32. if (reward != null) {
  33. rewardsMyDetailEntity.reward = reward;
  34. }
  35. final RewardsMyDetailAccount? account = jsonConvert.convert<
  36. RewardsMyDetailAccount>(json['account']);
  37. if (account != null) {
  38. rewardsMyDetailEntity.account = account;
  39. }
  40. return rewardsMyDetailEntity;
  41. }
  42. Map<String, dynamic> $RewardsMyDetailEntityToJson(
  43. RewardsMyDetailEntity entity) {
  44. final Map<String, dynamic> data = <String, dynamic>{};
  45. data['id'] = entity.id;
  46. data['redemption_code'] = entity.redemptionCode;
  47. data['used_at'] = entity.usedAt;
  48. data['created_at'] = entity.createdAt;
  49. data['expired_at'] = entity.expiredAt;
  50. data['quantity'] = entity.quantity;
  51. data['reward'] = entity.reward.toJson();
  52. data['account'] = entity.account.toJson();
  53. return data;
  54. }
  55. extension RewardsMyDetailEntityExtension on RewardsMyDetailEntity {
  56. RewardsMyDetailEntity copyWith({
  57. int? id,
  58. int? redemptionCode,
  59. String? usedAt,
  60. String? createdAt,
  61. String? expiredAt,
  62. int? quantity,
  63. RewardsMyDetailReward? reward,
  64. RewardsMyDetailAccount? account,
  65. }) {
  66. return RewardsMyDetailEntity()
  67. ..id = id ?? this.id
  68. ..redemptionCode = redemptionCode ?? this.redemptionCode
  69. ..usedAt = usedAt ?? this.usedAt
  70. ..createdAt = createdAt ?? this.createdAt
  71. ..expiredAt = expiredAt ?? this.expiredAt
  72. ..quantity = quantity ?? this.quantity
  73. ..reward = reward ?? this.reward
  74. ..account = account ?? this.account;
  75. }
  76. }
  77. RewardsMyDetailAccount $RewardsMyDetailAccountFromJson(
  78. Map<String, dynamic> json) {
  79. final RewardsMyDetailAccount rewardsMyDetailAccount = RewardsMyDetailAccount();
  80. final int? id = jsonConvert.convert<int>(json['id']);
  81. if (id != null) {
  82. rewardsMyDetailAccount.id = id;
  83. }
  84. final String? name = jsonConvert.convert<String>(json['name']);
  85. if (name != null) {
  86. rewardsMyDetailAccount.name = name;
  87. }
  88. final int? phone = jsonConvert.convert<int>(json['phone']);
  89. if (phone != null) {
  90. rewardsMyDetailAccount.phone = phone;
  91. }
  92. return rewardsMyDetailAccount;
  93. }
  94. Map<String, dynamic> $RewardsMyDetailAccountToJson(
  95. RewardsMyDetailAccount entity) {
  96. final Map<String, dynamic> data = <String, dynamic>{};
  97. data['id'] = entity.id;
  98. data['name'] = entity.name;
  99. data['phone'] = entity.phone;
  100. return data;
  101. }
  102. extension RewardsMyDetailAccountExtension on RewardsMyDetailAccount {
  103. RewardsMyDetailAccount copyWith({
  104. int? id,
  105. String? name,
  106. int? phone,
  107. }) {
  108. return RewardsMyDetailAccount()
  109. ..id = id ?? this.id
  110. ..name = name ?? this.name
  111. ..phone = phone ?? this.phone;
  112. }
  113. }
  114. RewardsMyDetailReward $RewardsMyDetailRewardFromJson(
  115. Map<String, dynamic> json) {
  116. final RewardsMyDetailReward rewardsMyDetailReward = RewardsMyDetailReward();
  117. final int? id = jsonConvert.convert<int>(json['id']);
  118. if (id != null) {
  119. rewardsMyDetailReward.id = id;
  120. }
  121. final String? title = jsonConvert.convert<String>(json['title']);
  122. if (title != null) {
  123. rewardsMyDetailReward.title = title;
  124. }
  125. final List<String>? resources = (json['resources'] as List<dynamic>?)?.map(
  126. (e) => jsonConvert.convert<String>(e) as String).toList();
  127. if (resources != null) {
  128. rewardsMyDetailReward.resources = resources;
  129. }
  130. final int? originalPoint = jsonConvert.convert<int>(json['original_point']);
  131. if (originalPoint != null) {
  132. rewardsMyDetailReward.originalPoint = originalPoint;
  133. }
  134. final int? point = jsonConvert.convert<int>(json['point']);
  135. if (point != null) {
  136. rewardsMyDetailReward.point = point;
  137. }
  138. final String? redeemedStart = jsonConvert.convert<String>(
  139. json['redeemed_start']);
  140. if (redeemedStart != null) {
  141. rewardsMyDetailReward.redeemedStart = redeemedStart;
  142. }
  143. final String? redeemedEnd = jsonConvert.convert<String>(json['redeemed_end']);
  144. if (redeemedEnd != null) {
  145. rewardsMyDetailReward.redeemedEnd = redeemedEnd;
  146. }
  147. return rewardsMyDetailReward;
  148. }
  149. Map<String, dynamic> $RewardsMyDetailRewardToJson(
  150. RewardsMyDetailReward entity) {
  151. final Map<String, dynamic> data = <String, dynamic>{};
  152. data['id'] = entity.id;
  153. data['title'] = entity.title;
  154. data['resources'] = entity.resources;
  155. data['original_point'] = entity.originalPoint;
  156. data['point'] = entity.point;
  157. data['redeemed_start'] = entity.redeemedStart;
  158. data['redeemed_end'] = entity.redeemedEnd;
  159. return data;
  160. }
  161. extension RewardsMyDetailRewardExtension on RewardsMyDetailReward {
  162. RewardsMyDetailReward copyWith({
  163. int? id,
  164. String? title,
  165. List<String>? resources,
  166. int? originalPoint,
  167. int? point,
  168. String? redeemedStart,
  169. String? redeemedEnd,
  170. }) {
  171. return RewardsMyDetailReward()
  172. ..id = id ?? this.id
  173. ..title = title ?? this.title
  174. ..resources = resources ?? this.resources
  175. ..originalPoint = originalPoint ?? this.originalPoint
  176. ..point = point ?? this.point
  177. ..redeemedStart = redeemedStart ?? this.redeemedStart
  178. ..redeemedEnd = redeemedEnd ?? this.redeemedEnd;
  179. }
  180. }