osdm-sys 0.1.0-alpha.2

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

/// ReturnConstraint : a return trip with the same carrier must be sold in combination 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct ReturnConstraint {
    /// number of days after departure or start of validity of the last return 
    #[serde(rename = "latestReturn")]
    pub latest_return: i32,
    /// number of days after departure or start of validity of the earliest return 
    #[serde(rename = "earliestReturn")]
    pub earliest_return: i32,
    /// weekdays (ISO day of the week, 1 = Monday) between travel and return where travel is not allowed 
    #[serde(rename = "excludedWeekdays", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub excluded_weekdays: Option<Option<Vec<i32>>>,
}

impl ReturnConstraint {
    /// a return trip with the same carrier must be sold in combination 
    pub fn new(latest_return: i32, earliest_return: i32) -> ReturnConstraint {
        ReturnConstraint {
            latest_return,
            earliest_return,
            excluded_weekdays: None,
        }
    }
}