osdm_sys/models/leg_attribute.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/// LegAttribute : Attributes that are not valid on the whole service, but only on section of a trip made on a single mode without interchange between boarding and alighting.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct LegAttribute {
17 /// Text of the attribute to be shown to the user.
18 #[serde(rename = "text")]
19 pub text: String,
20 /// Internal code of the attribute. Can be used for detection of double occurrences. Refers to Service Facilities / Leg Attributes from the Catalog of Code Lists
21 #[serde(rename = "code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22 pub code: Option<Option<String>>,
23 /// The attribute is valid from the stop point with this sequence number within the leg. If missing it is valid from the beginning of the leg.
24 #[serde(rename = "fromStopSeqNumber", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25 pub from_stop_seq_number: Option<Option<i32>>,
26 /// The attribute is valid to the stop point (inclusively) with this sequence number within the leg. If missing it is valid to the end of the leg.
27 #[serde(rename = "toStopSeqNumber", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28 pub to_stop_seq_number: Option<Option<i32>>,
29}
30
31impl LegAttribute {
32 /// Attributes that are not valid on the whole service, but only on section of a trip made on a single mode without interchange between boarding and alighting.
33 pub fn new(text: String) -> LegAttribute {
34 LegAttribute {
35 text,
36 code: None,
37 from_stop_seq_number: None,
38 to_stop_seq_number: None,
39 }
40 }
41}
42