Last active
June 17, 2022 03:41
-
-
Save jeffutter/c9bf729fe2052adb1417f318dfc6758e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "data": { | |
| "metrics": [ | |
| { | |
| "units": "kcal", | |
| "data": [ | |
| { | |
| "qty": 0.207, | |
| "date": "2022-06-14 00:13:00 -0500" | |
| }, | |
| { | |
| "date": "2022-06-14 00:14:00 -0500", | |
| "qty": 0.32599999999999996 | |
| } | |
| ], | |
| "name": "active_energy" | |
| }, | |
| { | |
| "data": [ | |
| { | |
| "qty": 1, | |
| "date": "2022-06-14 23:02:00 -0500" | |
| } | |
| ], | |
| "name": "apple_exercise_time", | |
| "units": "min" | |
| }, | |
| { | |
| "data": [ | |
| { | |
| "Min": 64, | |
| "Avg": 64, | |
| "date": "2022-06-14 00:02:29 -0500", | |
| "Max": 64 | |
| }, | |
| { | |
| "date": "2022-06-14 00:07:29 -0500", | |
| "Avg": 64, | |
| "Max": 64, | |
| "Min": 64 | |
| } | |
| ], | |
| "units": "count/min", | |
| "name": "heart_rate" | |
| } | |
| ] | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Root{ | |
| data: Data{ | |
| metrics: Vec< | |
| ActiveEnergy(CommonMetric{qty: 0.207, date: 2022-06-14 00:13:00 -0500, unit: "kcal"}), | |
| ActiveEnergy(CommonMetric{qty: 0.32599999999999996, date: 2022-06-14 00:13:00 -0500, unit: "kcal"}), | |
| ... | |
| AppleExerciseTime(CommonMetric{qty: 1, date: 2022-06-14 23:02:00 -0500, unit: "min"}), | |
| ... | |
| HeartRate(HeartRateMetric{min: 64, avg: 64, max: 64, date: 2022-06-14 00:02:29 -0500, unit: "count/min"}), | |
| ... | |
| > | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct Root { | |
| data: Data | |
| } | |
| struct Data { | |
| metrics: Vec<Metric> | |
| } | |
| enum Metric { | |
| ActiveEnergy(CommonMetric), | |
| AppleExerciseTime(CommonMetric), | |
| HeartRate(HeartRateMetric) | |
| } | |
| struct CommonMetric { | |
| unit: String, | |
| date: DateTime<Utc>, | |
| qty: f64 | |
| } | |
| struct HeartRateMetric { | |
| unit: String, | |
| date: DateTime<Utc>, | |
| min: f64, | |
| max: f64, | |
| avg: f64 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment