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};

/// TripSummary : Trip summary. Provided by OJP. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct TripSummary {
    /// Id of this trip for referencing purposes. Unique within trip response. 
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub summary: Option<Option<String>>,
    #[serde(rename = "externalRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub external_ref: Option<Option<String>>,
    /// Departure time at origin. 
    #[serde(rename = "startTime", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub start_time: Option<Option<String>>,
    /// Arrival time at destination. 
    #[serde(rename = "endTime", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub end_time: Option<Option<String>>,
    /// Overall duration of the trip. 
    #[serde(rename = "duration", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub duration: Option<Option<String>>,
    #[serde(rename = "origin", skip_serializing_if = "Option::is_none")]
    pub origin: Option<Box<models::PlaceRef>>,
    /// Name of the origin place
    #[serde(rename = "originName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub origin_name: Option<Option<String>>,
    #[serde(rename = "destination", skip_serializing_if = "Option::is_none")]
    pub destination: Option<Box<models::PlaceRef>>,
    /// Name of the destination place
    #[serde(rename = "destinationName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub destination_name: Option<Option<String>>,
    #[serde(rename = "transfers", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub transfers: Option<Option<i32>>,
    #[serde(rename = "distance", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub distance: Option<Option<i32>>,
}

impl TripSummary {
    /// Trip summary. Provided by OJP. 
    pub fn new(id: String) -> TripSummary {
        TripSummary {
            id,
            summary: None,
            external_ref: None,
            start_time: None,
            end_time: None,
            duration: None,
            origin: None,
            origin_name: None,
            destination: None,
            destination_name: None,
            transfers: None,
            distance: None,
        }
    }
}