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

/// ClientPrice : The specification of an Account-specific Price.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClientPrice {
    /// The string \"PRICE\". Used to identify the a Price object when found in a stream.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    #[serde(rename = "instrument", skip_serializing_if = "Option::is_none")]
    pub instrument: Option<models::InstrumentName>,
    /// A date and time value using either RFC3339 or UNIX time representation. The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).
    #[serde(rename = "time", skip_serializing_if = "Option::is_none")]
    pub time: Option<String>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<models::PriceStatus>,
    /// Flag indicating if the Price is tradeable or not
    #[serde(rename = "tradeable", skip_serializing_if = "Option::is_none")]
    pub tradeable: Option<bool>,
    /// The list of prices and liquidity available on the Instrument's bid side. It is possible for this list to be empty if there is no bid liquidity currently available for the Instrument in the Account.
    #[serde(rename = "bids", skip_serializing_if = "Option::is_none")]
    pub bids: Option<Vec<models::PriceBucket>>,
    /// The list of prices and liquidity available on the Instrument's ask side. It is possible for this list to be empty if there is no ask liquidity currently available for the Instrument in the Account.
    #[serde(rename = "asks", skip_serializing_if = "Option::is_none")]
    pub asks: Option<Vec<models::PriceBucket>>,
    /// The closeout bid Price. This Price is used when a bid is required to closeout a Position (margin closeout or manual) yet there is no bid liquidity. The closeout bid is never used to open a new position.
    #[serde(rename = "closeoutBid", skip_serializing_if = "Option::is_none")]
    pub closeout_bid: Option<f64>,
    /// The closeout ask Price. This Price is used when a ask is required to closeout a Position (margin closeout or manual) yet there is no ask liquidity. The closeout ask is never used to open a new position.
    #[serde(rename = "closeoutAsk", skip_serializing_if = "Option::is_none")]
    pub closeout_ask: Option<f64>,
    #[serde(rename = "quoteHomeConversionFactors", skip_serializing_if = "Option::is_none")]
    pub quote_home_conversion_factors: Option<Box<models::QuoteHomeConversionFactors>>,
    #[serde(rename = "unitsAvailable", skip_serializing_if = "Option::is_none")]
    pub units_available: Option<Box<models::UnitsAvailable>>,
}

impl ClientPrice {
    /// The specification of an Account-specific Price.
    pub fn new() -> ClientPrice {
        ClientPrice {
            r#type: None,
            instrument: None,
            time: None,
            status: None,
            tradeable: None,
            bids: None,
            asks: None,
            closeout_bid: None,
            closeout_ask: None,
            quote_home_conversion_factors: None,
            units_available: None,
        }
    }
}