osdm-sys 0.1.0-alpha.3

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/)
Documentation
/*
 * UIC 90918-10 - OSDM
 *
 * 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/) 
 *
 * The version of the OpenAPI document: 3.7.0
 * Contact: osdm@uic.org
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct TrainLink {
    #[serde(rename = "fromStation")]
    pub from_station: Box<models::StopPlaceRef>,
    #[serde(rename = "toStation")]
    pub to_station: Box<models::StopPlaceRef>,
    #[serde(rename = "train")]
    pub train: String,
    /// date and time of the departure where the train link starts 
    #[serde(rename = "travelDate")]
    pub travel_date: String,
    /// Service brand codes. For public transport, a code list can be found in OSDM's code list. E.g., '163' denotes TGV Lyria and '175' denotes Glacier Express. 
    #[serde(rename = "serviceBrandCode", skip_serializing_if = "Option::is_none")]
    pub service_brand_code: Option<String>,
    /// Abbreviation of the service brand, e.g. 'IC', 'TGV'. See the OSDM code list. Needs to match the service brand code. 
    #[serde(rename = "serviceBrandAbbreviation")]
    pub service_brand_abbreviation: String,
}

impl TrainLink {
    pub fn new(from_station: models::StopPlaceRef, to_station: models::StopPlaceRef, train: String, travel_date: String, service_brand_abbreviation: String) -> TrainLink {
        TrainLink {
            from_station: Box::new(from_station),
            to_station: Box::new(to_station),
            train,
            travel_date,
            service_brand_code: None,
            service_brand_abbreviation,
        }
    }
}