strava_data/models/
detailed_activity.rs

1use serde::{Deserialize, Serialize};
2use super::super::models;
3
4#[derive(Debug, Serialize, Deserialize)]
5pub struct DetailedActivity {
6  /// The unique identifier of the activity
7  #[serde(rename = "id")]
8  pub id: Option<i64>,
9  /// The identifier provided at upload time
10  #[serde(rename = "external_id")]
11  pub external_id: Option<String>,
12  
13  /// The identifier of the upload that resulted in this activity
14  #[serde(rename = "upload_id")]
15  pub upload_id: Option<i64>,
16  
17  #[serde(rename = "athlete")]
18  pub athlete: Option<models::MetaAthlete>,
19  
20  /// The name of the activity
21  #[serde(rename = "name")]
22  pub name: Option<String>,
23  
24  /// The activity's distance, in meters
25  #[serde(rename = "distance")]
26  pub distance: Option<f32>,
27  
28  /// The activity's moving time, in seconds
29  #[serde(rename = "moving_time")]
30  pub moving_time: Option<i32>,
31  
32  /// The activity's elapsed time, in seconds
33  #[serde(rename = "elapsed_time")]
34  pub elapsed_time: Option<i32>,
35  
36  /// The activity's total elevation gain.
37  #[serde(rename = "total_elevation_gain")]
38  pub total_elevation_gain: Option<f32>,
39  
40  /// The activity's highest elevation, in meters
41  #[serde(rename = "elev_high")]
42  pub elev_high: Option<f32>,
43  
44  /// The activity's lowest elevation, in meters
45  #[serde(rename = "elev_low")]
46  pub elev_low: Option<f32>,
47  
48  #[serde(rename = "type")]
49  pub activity_type: Option<models::ActivityType>,
50  
51  /// The time at which the activity was started.
52  #[serde(rename = "start_date")]
53  pub start_date: Option<String>,
54  
55  /// The time at which the activity was started in the local timezone.
56  #[serde(rename = "start_date_local")]
57  pub start_date_local: Option<String>,
58  
59  /// The timezone of the activity
60  #[serde(rename = "timezone")]
61  pub timezone: Option<String>,
62
63  /// The UTC offset of the local timezone
64  #[serde(rename = "utc_offset")]
65  pub utc_offset: Option<f32>,
66  
67  //#[serde(rename = "start_latlng")]
68  //start_latlng: Option<models::LatLng>,
69  //#[serde(rename = "end_latlng")]
70  //end_latlng: Option<models::LatLng>,
71  
72  /// The number of achievements gained during this activity
73  #[serde(rename = "achievement_count")]
74  pub achievement_count: Option<i32>,
75  
76  /// The number of kudos given for this activity
77  #[serde(rename = "kudos_count")]
78  pub kudos_count: Option<i32>,
79  
80  /// The number of comments for this activity
81  #[serde(rename = "comment_count")]
82  pub comment_count: Option<i32>,
83  
84  /// The number of athletes for taking part in a group activity
85  #[serde(rename = "athlete_count")]
86  pub athlete_count: Option<i32>,
87  
88  /// The number of Instagram photos for this activity
89  #[serde(rename = "photo_count")]
90  pub photo_count: Option<i32>,
91  
92  /// The number of Instagram and Strava photos for this activity
93  #[serde(rename = "total_photo_count")]
94  pub total_photo_count: Option<i32>,
95  
96  #[serde(rename = "map")]
97  pub map: Option<models::PolylineMap>,
98  
99  /// Whether this activity was recorded on a training machine
100  #[serde(rename = "trainer")]
101  pub trainer: Option<bool>,
102  
103  /// Whether this activity is a commute
104  #[serde(rename = "commute")]
105  pub commute: Option<bool>,
106  
107  /// Whether this activity was created manually
108  #[serde(rename = "manual")]
109  pub manual: Option<bool>,
110  
111  /// Whether this activity is private
112  #[serde(rename = "private")]
113  pub private: Option<bool>,
114  
115  /// Whether this activity is flagged
116  #[serde(rename = "flagged")]
117  pub flagged: Option<bool>,
118  
119  /// The activity's workout type
120  #[serde(rename = "workout_type")]
121  pub workout_type: Option<i32>,
122  
123  /// The unique identifier of the upload in string format
124  #[serde(rename = "upload_id_str")]
125  pub upload_id_str: Option<String>,
126  
127  /// The activity's average speed, in meters per second
128  #[serde(rename = "average_speed")]
129  pub average_speed: Option<f32>,
130  
131  /// The activity's max speed, in meters per second
132  #[serde(rename = "max_speed")]
133  pub max_speed: Option<f32>,
134  
135  /// Whether the logged-in athlete has kudoed this activity
136  #[serde(rename = "has_kudoed")]
137  pub has_kudoed: Option<bool>,
138  
139  /// The id of the gear for the activity
140  #[serde(rename = "gear_id")]
141  pub gear_id: Option<String>,
142  
143  /// The total work done in kilojoules during this activity. Rides only
144  #[serde(rename = "kilojoules")]
145  pub kilojoules: Option<f32>,
146  
147  /// Average power output in watts during this activity. Rides only
148  #[serde(rename = "average_watts")]
149  pub average_watts: Option<f32>,
150  
151  /// Whether the watts are from a power meter, false if estimated
152  #[serde(rename = "device_watts")]
153  pub device_watts: Option<bool>,
154  
155  /// Rides with power meter data only
156  #[serde(rename = "max_watts")]
157  pub max_watts: Option<i32>,
158  
159  /// Similar to Normalized Power. Rides with power meter data only
160  #[serde(rename = "weighted_average_watts")]
161  weighted_average_watts: Option<i32>,
162  
163  /// The description of the activity
164  #[serde(rename = "description")]
165  pub description: Option<String>,
166  
167  /*#[serde(rename = "photos")] //TODO
168  photos: Option<models::PhotosSummary>,
169  #[serde(rename = "gear")]
170  gear: Option<models::SummaryGear>,*/
171  
172  /// The number of kilocalories consumed during this activity
173  #[serde(rename = "calories")]
174  pub calories: Option<f32>,
175  
176  //#[serde(rename = "segment_efforts")]  //TODO: Do we need this?
177  //segment_efforts: Option<Vec<::models::DetailedSegmentEffort>>,
178  
179  /// The name of the device used to record the activity
180  #[serde(rename = "device_name")]
181  pub device_name: Option<String>,
182  
183  /// The token used to embed a Strava activity
184  #[serde(rename = "embed_token")]
185  pub embed_token: Option<String>,
186  
187  //TODO: Complete these
188  /*/// The splits of this activity in metric units (for runs)
189  #[serde(rename = "splits_metric")]
190  splits_metric: Option<Vec<::models::Split>>,
191  /// The splits of this activity in imperial units (for runs)
192  #[serde(rename = "splits_standard")]
193  splits_standard: Option<Vec<::models::Split>>,
194  #[serde(rename = "laps")]
195  laps: Option<Vec<::models::Lap>>,
196  #[serde(rename = "best_efforts")]
197  best_efforts: Option<Vec<::models::DetailedSegmentEffort>>*/
198}