Skip to main content

motis_openapi_sdk/models/
time_range.rs

1/*
2 * MOTIS API
3 *
4 * This is the MOTIS routing API.  Overview of MOTIS API versions:  MOTIS 0.x - deprecated/discontinued  MOTIS 2.x - current, providing:  * /api/v5/{plan,trip,stoptimes,map/trips} renamed METRO mode to SUBURBAN, AREAL_LIFT to AERIAL_LIFT; since MOTIS 2.5.0 * /api/v4/{plan,trip,stoptimes,map/trips} new displayName property, routeShortName only contains actual route short name from source; since MOTIS 2.2.0 * /api/v3/plan with correct maxTransfers API parameter (transfers actually corresponding to number of changes between transit legs (and not to number of transit legs), i.e. maxTransfers=0 returns direct public transit connections, as expected); since MOTIS 2.0.84  * /api/v2/{plan,trip} returns Google polylines with precision=6; since MOTIS 2.0.60 * /api/v1/{plan,trip} returns Google polylines with precision=7 (not defined for |longitude|>107) * /api/v1/_* all other endpoints  If you use the JS client lib https://www.npmjs.com/package/@motis-project/motis-client, endpoint versions will be taken into account automatically (i.e. the newest one available will be used). 
5 *
6 * The version of the OpenAPI document: v5
7 * Contact: felix@triptix.tech
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// TimeRange : A time interval. The interval is considered active at time t if t is greater than or equal to the start time and less than the end time. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TimeRange {
17    /// If missing, the interval starts at minus infinity. If a TimeRange is provided, either start or end must be provided - both fields cannot be empty. 
18    #[serde(rename = "start")]
19    pub start: String,
20    /// If missing, the interval ends at plus infinity. If a TimeRange is provided, either start or end must be provided - both fields cannot be empty. 
21    #[serde(rename = "end")]
22    pub end: String,
23}
24
25impl TimeRange {
26    /// A time interval. The interval is considered active at time t if t is greater than or equal to the start time and less than the end time. 
27    pub fn new(start: String, end: String) -> TimeRange {
28        TimeRange {
29            start,
30            end,
31        }
32    }
33}
34