Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. class Exercise {
  2. String code;
  3. String product;
  4. String name;
  5. int system;
  6. int isometric;
  7. int bilateral;
  8. int durationInSeconds;
  9. List<ExerciseExecution> exerciseExecution;
  10. List<EvaluationProtocolExercises> evaluationProtocolExercises;
  11.  
  12. Exercise(
  13. {this.code,
  14. this.product,
  15. this.name,
  16. this.system,
  17. this.isometric,
  18. this.bilateral,
  19. this.durationInSeconds,
  20. this.exerciseExecution,
  21. this.evaluationProtocolExercises});
  22.  
  23. Exercise.fromJson(Map<String, dynamic> json) {
  24. code = json['Code'];
  25. product = json['Product'];
  26. name = json['Name'];
  27. system = json['System'];
  28. isometric = json['Isometric'];
  29. bilateral = json['Bilateral'];
  30. durationInSeconds = json['DurationInSeconds'];
  31. if (json['ExerciseExecution'] != null) {
  32. exerciseExecution = new List<ExerciseExecution>();
  33. json['ExerciseExecution'].forEach((v) {
  34. exerciseExecution.add(new ExerciseExecution.fromJson(v));
  35. });
  36. }
  37. if (json['EvaluationProtocolExercises'] != null) {
  38. evaluationProtocolExercises = new List<EvaluationProtocolExercises>();
  39. json['EvaluationProtocolExercises'].forEach((v) {
  40. evaluationProtocolExercises
  41. .add(new EvaluationProtocolExercises.fromJson(v));
  42. });
  43. }
  44. }
  45.  
  46. Map<String, dynamic> toJson() {
  47. final Map<String, dynamic> data = new Map<String, dynamic>();
  48. data['Code'] = this.code;
  49. data['Product'] = this.product;
  50. data['Name'] = this.name;
  51. data['System'] = this.system;
  52. data['Isometric'] = this.isometric;
  53. data['Bilateral'] = this.bilateral;
  54. data['DurationInSeconds'] = this.durationInSeconds;
  55. if (this.exerciseExecution != null) {
  56. data['ExerciseExecution'] =
  57. this.exerciseExecution.map((v) => v.toJson()).toList();
  58. }
  59. if (this.evaluationProtocolExercises != null) {
  60. data['EvaluationProtocolExercises'] =
  61. this.evaluationProtocolExercises.map((v) => v.toJson()).toList();
  62. }
  63. return data;
  64. }
  65. }
  66.  
  67. class ExerciseExecution {
  68. List<Session> session;
  69. List<Reading> reading;
  70. int profileId;
  71.  
  72. ExerciseExecution({this.session, this.reading, this.profileId});
  73.  
  74. ExerciseExecution.fromJson(Map<String, dynamic> json) {
  75. if (json['Session'] != null) {
  76. session = new List<Session>();
  77. json['Session'].forEach((v) {
  78. session.add(new Session.fromJson(v));
  79. });
  80. }
  81. if (json['Reading'] != null) {
  82. reading = new List<Reading>();
  83. json['Reading'].forEach((v) {
  84. reading.add(new Reading.fromJson(v));
  85. });
  86. }
  87. profileId = json['ProfileId'];
  88. }
  89.  
  90. Map<String, dynamic> toJson() {
  91. final Map<String, dynamic> data = new Map<String, dynamic>();
  92. if (this.session != null) {
  93. data['Session'] = this.session.map((v) => v.toJson()).toList();
  94. }
  95. if (this.reading != null) {
  96. data['Reading'] = this.reading.map((v) => v.toJson()).toList();
  97. }
  98. data['ProfileId'] = this.profileId;
  99. return data;
  100. }
  101. }
  102.  
  103. class Session {
  104. String description;
  105.  
  106. Session({this.description});
  107.  
  108. Session.fromJson(Map<String, dynamic> json) {
  109. description = json['Description'];
  110. }
  111.  
  112. Map<String, dynamic> toJson() {
  113. final Map<String, dynamic> data = new Map<String, dynamic>();
  114. data['Description'] = this.description;
  115. return data;
  116. }
  117. }
  118.  
  119. class Reading {
  120. int exerciseSessionId;
  121. int elapsedTime;
  122. int value1;
  123. int value2;
  124.  
  125. Reading({this.exerciseSessionId, this.elapsedTime, this.value1, this.value2});
  126.  
  127. Reading.fromJson(Map<String, dynamic> json) {
  128. exerciseSessionId = json['ExerciseSessionId'];
  129. elapsedTime = json['ElapsedTime'];
  130. value1 = json['value1'];
  131. value2 = json['value2'];
  132. }
  133.  
  134. Map<String, dynamic> toJson() {
  135. final Map<String, dynamic> data = new Map<String, dynamic>();
  136. data['ExerciseSessionId'] = this.exerciseSessionId;
  137. data['ElapsedTime'] = this.elapsedTime;
  138. data['value1'] = this.value1;
  139. data['value2'] = this.value2;
  140. return data;
  141. }
  142. }
  143.  
  144. class EvaluationProtocolExercises {
  145. String code;
  146. String product;
  147. String name;
  148.  
  149. EvaluationProtocolExercises({this.code, this.product, this.name});
  150.  
  151. EvaluationProtocolExercises.fromJson(Map<String, dynamic> json) {
  152. code = json['Code'];
  153. product = json['Product'];
  154. name = json['Name'];
  155. }
  156.  
  157. Map<String, dynamic> toJson() {
  158. final Map<String, dynamic> data = new Map<String, dynamic>();
  159. data['Code'] = this.code;
  160. data['Product'] = this.product;
  161. data['Name'] = this.name;
  162. return data;
  163. }
  164. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement