strava_client/models/power_stream.rs
1/*
2 * Strava API v3
3 *
4 * The [Swagger Playground](https://developers.strava.com/playground) is the easiest way to familiarize yourself with the Strava API by submitting HTTP requests and observing the responses before you write any client code. It will show what a response will look like with different endpoints depending on the authorization scope you receive from your athletes. To use the Playground, go to https://www.strava.com/settings/api and change your “Authorization Callback Domain” to developers.strava.com. Please note, we only support Swagger 2.0. There is a known issue where you can only select one scope at a time. For more information, please check the section “client code” at https://developers.strava.com/docs.
5 *
6 * The version of the OpenAPI document: 3.0.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct PowerStream {
16 /// The number of data points in this stream
17 #[serde(rename = "original_size", skip_serializing_if = "Option::is_none")]
18 pub original_size: Option<i32>,
19 /// The level of detail (sampling) in which this stream was returned
20 #[serde(rename = "resolution", skip_serializing_if = "Option::is_none")]
21 pub resolution: Option<Resolution>,
22 /// The base series used in the case the stream was downsampled
23 #[serde(rename = "series_type", skip_serializing_if = "Option::is_none")]
24 pub series_type: Option<SeriesType>,
25 /// The sequence of power values for this stream, in watts
26 #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
27 pub data: Option<Vec<i32>>,
28}
29
30impl PowerStream {
31 pub fn new() -> PowerStream {
32 PowerStream {
33 original_size: None,
34 resolution: None,
35 series_type: None,
36 data: None,
37 }
38 }
39}
40
41/// The level of detail (sampling) in which this stream was returned
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum Resolution {
44 #[serde(rename = "low")]
45 Low,
46 #[serde(rename = "medium")]
47 Medium,
48 #[serde(rename = "high")]
49 High,
50}
51
52impl Default for Resolution {
53 fn default() -> Resolution {
54 Self::Low
55 }
56}
57/// The base series used in the case the stream was downsampled
58#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
59pub enum SeriesType {
60 #[serde(rename = "distance")]
61 Distance,
62 #[serde(rename = "time")]
63 Time,
64}
65
66impl Default for SeriesType {
67 fn default() -> SeriesType {
68 Self::Distance
69 }
70}
71