motis_openapi_sdk/models/
step_instruction.rs

1/*
2 * MOTIS API
3 *
4 * This is the MOTIS routing API.
5 *
6 * The version of the OpenAPI document: v1
7 * Contact: felix@triptix.tech
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct StepInstruction {
16    #[serde(rename = "relativeDirection")]
17    pub relative_direction: models::Direction,
18    /// The distance in meters that this step takes.
19    #[serde(rename = "distance")]
20    pub distance: f64,
21    /// level where this segment starts, based on OpenStreetMap data
22    #[serde(rename = "fromLevel")]
23    pub from_level: f64,
24    /// level where this segment starts, based on OpenStreetMap data
25    #[serde(rename = "toLevel")]
26    pub to_level: f64,
27    /// OpenStreetMap way index
28    #[serde(rename = "osmWay", skip_serializing_if = "Option::is_none")]
29    pub osm_way: Option<i32>,
30    #[serde(rename = "polyline")]
31    pub polyline: Box<models::EncodedPolyline>,
32    /// The name of the street.
33    #[serde(rename = "streetName")]
34    pub street_name: String,
35    /// Not implemented! When exiting a highway or traffic circle, the exit name/number. 
36    #[serde(rename = "exit")]
37    pub exit: String,
38    /// Not implemented! Indicates whether or not a street changes direction at an intersection. 
39    #[serde(rename = "stayOn")]
40    pub stay_on: bool,
41    /// Not implemented! This step is on an open area, such as a plaza or train platform, and thus the directions should say something like \"cross\" 
42    #[serde(rename = "area")]
43    pub area: bool,
44}
45
46impl StepInstruction {
47    pub fn new(relative_direction: models::Direction, distance: f64, from_level: f64, to_level: f64, polyline: models::EncodedPolyline, street_name: String, exit: String, stay_on: bool, area: bool) -> StepInstruction {
48        StepInstruction {
49            relative_direction,
50            distance,
51            from_level,
52            to_level,
53            osm_way: None,
54            polyline: Box::new(polyline),
55            street_name,
56            exit,
57            stay_on,
58            area,
59        }
60    }
61}
62