-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAthleteStats.swift
59 lines (50 loc) · 1.66 KB
/
AthleteStats.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// AthleteStats.swift
// StravaAPIClient
//
// Created by Carlos Santos on 21/02/2018.
// Copyright © 2018 crsantos.info. All rights reserved.
//
import Foundation
struct AthleteStats: Codable {
let biggestRideDistance: Double
let biggestClimbElevationGain: Double
let recentRideTotals: StatsTotals
let recentRunTotals: StatsTotals
let recentSwimTotals: StatsTotals
let ytdRideTotals: StatsTotals
let ytdRunTotals: StatsTotals
let ytdSwimTotals: StatsTotals
let allRideTotals: StatsTotals
let allRunTotals: StatsTotals
let allSwimTotals: StatsTotals
enum CodingKeys: String, CodingKey {
case biggestRideDistance = "biggest_ride_distance"
case biggestClimbElevationGain = "biggest_climb_elevation_gain"
case recentRideTotals = "recent_ride_totals"
case recentRunTotals = "recent_run_totals"
case recentSwimTotals = "recent_swim_totals"
case ytdRideTotals = "ytd_ride_totals"
case ytdRunTotals = "ytd_run_totals"
case ytdSwimTotals = "ytd_swim_totals"
case allRideTotals = "all_ride_totals"
case allRunTotals = "all_run_totals"
case allSwimTotals = "all_swim_totals"
}
}
struct StatsTotals: Codable {
let count: Int
let distance: Double
let movingTime: Int
let elapsedTime: Int
let elevationGain: Int
let achievementCount: Int?
enum CodingKeys: String, CodingKey {
case count = "count"
case distance = "distance"
case movingTime = "moving_time"
case elapsedTime = "elapsed_time"
case elevationGain = "elevation_gain"
case achievementCount = "achievement_count"
}
}