BGTargets.swift 442 B

1234567891011121314151617181920212223
  1. import Foundation
  2. struct BGTargets: JSON {
  3. var units: GlucoseUnits
  4. var userPreferredUnits: GlucoseUnits
  5. var targets: [BGTargetEntry]
  6. }
  7. extension BGTargets {
  8. private enum CodingKeys: String, CodingKey {
  9. case units
  10. case userPreferredUnits = "user_preferred_units"
  11. case targets
  12. }
  13. }
  14. struct BGTargetEntry: JSON {
  15. let low: Decimal
  16. let high: Decimal
  17. let start: String
  18. let offset: Int
  19. }