BGTargets.swift 442 B

1234567891011121314151617181920212223
  1. import Foundation
  2. struct BGTargets: JSON {
  3. let units: GlucoseUnits
  4. let userPrefferedUnits: GlucoseUnits
  5. let targets: [BGTargetEntry]
  6. }
  7. extension BGTargets {
  8. private enum CodingKeys: String, CodingKey {
  9. case units
  10. case userPrefferedUnits = "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. }