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

/// CurrencyConversion : details on a currency conversion applied 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct CurrencyConversion {
    /// description of the conversion, e.g. rate, rounding rules, reference to rules 
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// ISO 4217 currency codes 
    #[serde(rename = "originalCurrency")]
    pub original_currency: String,
    /// amount in cents 
    #[serde(rename = "originalAmount")]
    pub original_amount: i32,
    /// scale of the amount - the number of positions after the comma 
    #[serde(rename = "scale", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub scale: Option<Option<i32>>,
    #[serde(rename = "appliedRate", skip_serializing_if = "Option::is_none")]
    pub applied_rate: Option<f64>,
    #[serde(rename = "originalVats", skip_serializing_if = "Option::is_none")]
    pub original_vats: Option<Vec<models::Vat>>,
}

impl CurrencyConversion {
    /// details on a currency conversion applied 
    pub fn new(original_currency: String, original_amount: i32) -> CurrencyConversion {
        CurrencyConversion {
            description: None,
            original_currency,
            original_amount,
            scale: None,
            applied_rate: None,
            original_vats: None,
        }
    }
}