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

/// TripSearchCriteria : Trip request structure. Provided by OJP. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct TripSearchCriteria {
    /// Needs to be in local date time format of the stop. Exactly one of `departureTime` and `arrivalTime` must be provided. 
    #[serde(rename = "departureTime", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub departure_time: Option<Option<String>>,
    /// Needs to in be local date time format of the stop. Exactly one of `departureTime` and `arrivalTime` must be provided. 
    #[serde(rename = "arrivalTime", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub arrival_time: Option<Option<String>>,
    #[serde(rename = "origin")]
    pub origin: Box<models::PlaceRef>,
    #[serde(rename = "destination")]
    pub destination: Box<models::PlaceRef>,
    /// Ordered series of points where the journey must pass through. If more than one via point is given all of them must be obeyed - in the correct order. The server is allowed to replace a via stop by equivalent stops.  TripDataFilters given at a via apply to the section after that via. To apply a TripDataFilter for  the first section (between the origin and the first via), use the TripDataFilter within the TripParameters structure. 
    #[serde(rename = "vias", skip_serializing_if = "Option::is_none")]
    pub vias: Option<Vec<models::TripVia>>,
    #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")]
    pub parameters: Option<Box<models::TripParameters>>,
    /// Influences whether referenced resources are returned in full or as references only. Proposed default ALL 
    #[serde(rename = "embed", skip_serializing_if = "Option::is_none")]
    pub embed: Option<Vec<models::TripsCollectionResponseContent>>,
    #[serde(rename = "returnSearchParameters", skip_serializing_if = "Option::is_none")]
    pub return_search_parameters: Option<Box<models::ReturnSearchParameters>>,
    #[serde(rename = "notVias", skip_serializing_if = "Option::is_none")]
    pub not_vias: Option<Vec<models::NotVia>>,
}

impl TripSearchCriteria {
    /// Trip request structure. Provided by OJP. 
    pub fn new(origin: models::PlaceRef, destination: models::PlaceRef) -> TripSearchCriteria {
        TripSearchCriteria {
            departure_time: None,
            arrival_time: None,
            origin: Box::new(origin),
            destination: Box::new(destination),
            vias: None,
            parameters: None,
            embed: None,
            return_search_parameters: None,
            not_vias: None,
        }
    }
}