Skip to main content

oanda_v20_openapi/models/
client_price.rs

1/*
2 * OANDA v20 API
3 *
4 * The full OANDA v20 API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
5 *
6 * The version of the OpenAPI document: 0.2.1
7 * Contact: jmicoud02@gmail.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ClientPrice : The specification of an Account-specific Price.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ClientPrice {
17    /// The string \"PRICE\". Used to identify the a Price object when found in a stream.
18    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
19    pub r#type: Option<String>,
20    #[serde(rename = "instrument", skip_serializing_if = "Option::is_none")]
21    pub instrument: Option<models::InstrumentName>,
22    /// 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).
23    #[serde(rename = "time", skip_serializing_if = "Option::is_none")]
24    pub time: Option<String>,
25    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
26    pub status: Option<models::PriceStatus>,
27    /// Flag indicating if the Price is tradeable or not
28    #[serde(rename = "tradeable", skip_serializing_if = "Option::is_none")]
29    pub tradeable: Option<bool>,
30    /// 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.
31    #[serde(rename = "bids", skip_serializing_if = "Option::is_none")]
32    pub bids: Option<Vec<models::PriceBucket>>,
33    /// 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.
34    #[serde(rename = "asks", skip_serializing_if = "Option::is_none")]
35    pub asks: Option<Vec<models::PriceBucket>>,
36    /// 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.
37    #[serde(rename = "closeoutBid", skip_serializing_if = "Option::is_none")]
38    pub closeout_bid: Option<f64>,
39    /// 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.
40    #[serde(rename = "closeoutAsk", skip_serializing_if = "Option::is_none")]
41    pub closeout_ask: Option<f64>,
42    #[serde(rename = "quoteHomeConversionFactors", skip_serializing_if = "Option::is_none")]
43    pub quote_home_conversion_factors: Option<Box<models::QuoteHomeConversionFactors>>,
44    #[serde(rename = "unitsAvailable", skip_serializing_if = "Option::is_none")]
45    pub units_available: Option<Box<models::UnitsAvailable>>,
46}
47
48impl ClientPrice {
49    /// The specification of an Account-specific Price.
50    pub fn new() -> ClientPrice {
51        ClientPrice {
52            r#type: None,
53            instrument: None,
54            time: None,
55            status: None,
56            tradeable: None,
57            bids: None,
58            asks: None,
59            closeout_bid: None,
60            closeout_ask: None,
61            quote_home_conversion_factors: None,
62            units_available: None,
63        }
64    }
65}
66