oanda-v20-openapi 0.2.1

The full OANDA v20 API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
Documentation
/*
 * OANDA v20 API
 *
 * The full OANDA v20 API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
 *
 * The version of the OpenAPI document: 0.2.1
 * Contact: jmicoud02@gmail.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// HomeConversions : HomeConversions represents the factors to use to convert quantities of a given currency into the Account's home currency. The conversion factor depends on the scenario the conversion is required for.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct HomeConversions {
    /// The currency to be converted into the home currency. A string containing an ISO 4217 currency (http://en.wikipedia.org/wiki/ISO_4217)
    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
    pub currency: Option<String>,
    /// The factor used to convert any gains for an Account in the specified currency into the Account's home currency. This would include positive realized P/L and positive financing amounts. Conversion is performed by multiplying the positive P/L by the conversion factor.
    #[serde(rename = "accountGain", skip_serializing_if = "Option::is_none")]
    pub account_gain: Option<f64>,
    /// The string representation of a decimal number.
    #[serde(rename = "accountLoss", skip_serializing_if = "Option::is_none")]
    pub account_loss: Option<f64>,
    /// The factor used to convert a Position or Trade Value in the specified currency into the Account's home currency. Conversion is performed by multiplying the Position or Trade Value by the conversion factor.
    #[serde(rename = "positionValue", skip_serializing_if = "Option::is_none")]
    pub position_value: Option<f64>,
}

impl HomeConversions {
    /// HomeConversions represents the factors to use to convert quantities of a given currency into the Account's home currency. The conversion factor depends on the scenario the conversion is required for.
    pub fn new() -> HomeConversions {
        HomeConversions {
            currency: None,
            account_gain: None,
            account_loss: None,
            position_value: None,
        }
    }
}