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

/// UnitsAvailable : Representation of how many units of an Instrument are available to be traded by an Order depending on its postionFill option.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UnitsAvailable {
    #[serde(rename = "default", skip_serializing_if = "Option::is_none")]
    pub default: Option<Box<models::UnitsAvailableDetails>>,
    #[serde(rename = "reduceFirst", skip_serializing_if = "Option::is_none")]
    pub reduce_first: Option<Box<models::UnitsAvailableDetails>>,
    #[serde(rename = "reduceOnly", skip_serializing_if = "Option::is_none")]
    pub reduce_only: Option<Box<models::UnitsAvailableDetails>>,
    #[serde(rename = "openOnly", skip_serializing_if = "Option::is_none")]
    pub open_only: Option<Box<models::UnitsAvailableDetails>>,
}

impl UnitsAvailable {
    /// Representation of how many units of an Instrument are available to be traded by an Order depending on its postionFill option.
    pub fn new() -> UnitsAvailable {
        UnitsAvailable {
            default: None,
            reduce_first: None,
            reduce_only: None,
            open_only: None,
        }
    }
}