osdm_sys/models/
section.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/// Section : Allows to indicate the sub-part of the trip. LegIds are only relevant if a trip can be referenced. When absent, the totality of the trip is priced. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Section {
17    #[serde(rename = "startPlace", skip_serializing_if = "Option::is_none")]
18    pub start_place: Option<Box<models::PlaceRef>>,
19    #[serde(rename = "startLegId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub start_leg_id: Option<Option<String>>,
21    #[serde(rename = "endPlace", skip_serializing_if = "Option::is_none")]
22    pub end_place: Option<Box<models::PlaceRef>>,
23    #[serde(rename = "endLegId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub end_leg_id: Option<Option<String>>,
25    /// reference to a trip in case multiple trips are provided
26    #[serde(rename = "externalTripRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub external_trip_ref: Option<Option<String>>,
28}
29
30impl Section {
31    /// Allows to indicate the sub-part of the trip. LegIds are only relevant if a trip can be referenced. When absent, the totality of the trip is priced. 
32    pub fn new() -> Section {
33        Section {
34            start_place: None,
35            start_leg_id: None,
36            end_place: None,
37            end_leg_id: None,
38            external_trip_ref: None,
39        }
40    }
41}
42