Skip to main content

osdm_sys/models/
stop_behavior.rs

1/*
2 * UIC 90918-10 - OSDM
3 *
4 * Specifications for the OSDM API standard. The OSDM specification supports two modes of operation: Retailer Mode and Distributor Mode. The API works identically in both modes, except that in distributor mode the API also returns fare information.  The following resources are key to get started:    -  [Processes](https://osdm.io/spec/processes/)   -  [Models](https://osdm.io/spec/models/)   -  [Getting started](https://osdm.io/spec/getting-started/) 
5 *
6 * The version of the OpenAPI document: 3.7.0
7 * Contact: osdm@uic.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// StopBehavior : Influences what stops are to be returned in response (ORIGIN_DESTINATION_ONLY returns no intermediate stops; REAL_BOARDING_ALIGHTING returns all stops except virtual stops). Default value: ORIGIN_DESTINATION_ONLY 
15/// Influences what stops are to be returned in response (ORIGIN_DESTINATION_ONLY returns no intermediate stops; REAL_BOARDING_ALIGHTING returns all stops except virtual stops). Default value: ORIGIN_DESTINATION_ONLY 
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
18pub enum StopBehavior {
19    #[serde(rename = "ORIGIN_DESTINATION_ONLY")]
20    OriginDestinationOnly,
21    #[serde(rename = "REAL_BOARDING_ALIGHTING")]
22    RealBoardingAlighting,
23
24}
25
26impl std::fmt::Display for StopBehavior {
27    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28        match self {
29            Self::OriginDestinationOnly => write!(f, "ORIGIN_DESTINATION_ONLY"),
30            Self::RealBoardingAlighting => write!(f, "REAL_BOARDING_ALIGHTING"),
31        }
32    }
33}
34
35impl Default for StopBehavior {
36    fn default() -> StopBehavior {
37        Self::OriginDestinationOnly
38    }
39}
40