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 OnHoldOffer {
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "summary")]
    pub summary: String,
    #[serde(rename = "createdOn")]
    pub created_on: String,
    #[serde(rename = "validFrom")]
    pub valid_from: String,
    #[serde(rename = "validUntil")]
    pub valid_until: String,
    #[serde(rename = "confirmedOn", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub confirmed_on: Option<Option<String>>,
    #[serde(rename = "onHoldFee")]
    pub on_hold_fee: Box<models::Fee>,
    #[serde(rename = "deposit")]
    pub deposit: Box<models::Price>,
    /// Increased time-to-live. 
    #[serde(rename = "increasedTTL")]
    pub increased_ttl: String,
    ///  Java Property Name: 'links' 
    #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
    pub _links: Option<Vec<models::Link>>,
}

impl OnHoldOffer {
    pub fn new(id: String, summary: String, created_on: String, valid_from: String, valid_until: String, on_hold_fee: models::Fee, deposit: models::Price, increased_ttl: String) -> OnHoldOffer {
        OnHoldOffer {
            id,
            summary,
            created_on,
            valid_from,
            valid_until,
            confirmed_on: None,
            on_hold_fee: Box::new(on_hold_fee),
            deposit: Box::new(deposit),
            increased_ttl,
            _links: None,
        }
    }
}