strava_client/models/
summary_segment.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 SummarySegment {
16    /// The unique identifier of this segment
17    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: Option<i64>,
19    /// The name of this segment
20    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
21    pub name: Option<String>,
22    #[serde(rename = "activity_type", skip_serializing_if = "Option::is_none")]
23    pub activity_type: Option<ActivityType>,
24    /// The segment's distance, in meters
25    #[serde(rename = "distance", skip_serializing_if = "Option::is_none")]
26    pub distance: Option<f32>,
27    /// The segment's average grade, in percents
28    #[serde(rename = "average_grade", skip_serializing_if = "Option::is_none")]
29    pub average_grade: Option<f32>,
30    /// The segments's maximum grade, in percents
31    #[serde(rename = "maximum_grade", skip_serializing_if = "Option::is_none")]
32    pub maximum_grade: Option<f32>,
33    /// The segments's highest elevation, in meters
34    #[serde(rename = "elevation_high", skip_serializing_if = "Option::is_none")]
35    pub elevation_high: Option<f32>,
36    /// The segments's lowest elevation, in meters
37    #[serde(rename = "elevation_low", skip_serializing_if = "Option::is_none")]
38    pub elevation_low: Option<f32>,
39    /// A pair of latitude/longitude coordinates, represented as an array of 2 floating point numbers.
40    #[serde(rename = "start_latlng", skip_serializing_if = "Option::is_none")]
41    pub start_latlng: Option<Vec<f32>>,
42    /// A pair of latitude/longitude coordinates, represented as an array of 2 floating point numbers.
43    #[serde(rename = "end_latlng", skip_serializing_if = "Option::is_none")]
44    pub end_latlng: Option<Vec<f32>>,
45    /// The category of the climb [0, 5]. Higher is harder ie. 5 is Hors catégorie, 0 is uncategorized in climb_category.
46    #[serde(rename = "climb_category", skip_serializing_if = "Option::is_none")]
47    pub climb_category: Option<i32>,
48    /// The segments's city.
49    #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
50    pub city: Option<String>,
51    /// The segments's state or geographical region.
52    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
53    pub state: Option<String>,
54    /// The segment's country.
55    #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
56    pub country: Option<String>,
57    /// Whether this segment is private.
58    #[serde(rename = "private", skip_serializing_if = "Option::is_none")]
59    pub private: Option<bool>,
60    #[serde(rename = "athlete_pr_effort", skip_serializing_if = "Option::is_none")]
61    pub athlete_pr_effort: Option<Box<crate::models::SummarySegmentEffort>>,
62    #[serde(rename = "athlete_segment_stats", skip_serializing_if = "Option::is_none")]
63    pub athlete_segment_stats: Option<Box<crate::models::SummaryPrSegmentEffort>>,
64}
65
66impl SummarySegment {
67    pub fn new() -> SummarySegment {
68        SummarySegment {
69            id: None,
70            name: None,
71            activity_type: None,
72            distance: None,
73            average_grade: None,
74            maximum_grade: None,
75            elevation_high: None,
76            elevation_low: None,
77            start_latlng: None,
78            end_latlng: None,
79            climb_category: None,
80            city: None,
81            state: None,
82            country: None,
83            private: None,
84            athlete_pr_effort: None,
85            athlete_segment_stats: None,
86        }
87    }
88}
89
90/// 
91#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
92pub enum ActivityType {
93    #[serde(rename = "Ride")]
94    Ride,
95    #[serde(rename = "Run")]
96    Run,
97}
98
99impl Default for ActivityType {
100    fn default() -> ActivityType {
101        Self::Ride
102    }
103}
104