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

/// PositionBookBucket : The position book data for a partition of the instrument's prices.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PositionBookBucket {
    /// The lowest price (inclusive) covered by the bucket. The bucket covers the price range from the price to price + the position book's bucketWidth.
    #[serde(rename = "price", skip_serializing_if = "Option::is_none")]
    pub price: Option<f64>,
    /// The percentage of the total number of positions represented by the long positions found in this bucket.
    #[serde(rename = "longCountPercent", skip_serializing_if = "Option::is_none")]
    pub long_count_percent: Option<f64>,
    /// The percentage of the total number of positions represented by the short positions found in this bucket.
    #[serde(rename = "shortCountPercent", skip_serializing_if = "Option::is_none")]
    pub short_count_percent: Option<f64>,
}

impl PositionBookBucket {
    /// The position book data for a partition of the instrument's prices.
    pub fn new() -> PositionBookBucket {
        PositionBookBucket {
            price: None,
            long_count_percent: None,
            short_count_percent: None,
        }
    }
}