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

/// MarketOrderPositionFill : Specification of how Positions in the Account are modified when the Order is filled.
/// Specification of how Positions in the Account are modified when the Order is filled.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MarketOrderPositionFill {
    #[serde(rename = "OPEN_ONLY")]
    OpenOnly,
    #[serde(rename = "REDUCE_FIRST")]
    ReduceFirst,
    #[serde(rename = "REDUCE_ONLY")]
    ReduceOnly,
    #[serde(rename = "DEFAULT")]
    Default,

}

impl std::fmt::Display for MarketOrderPositionFill {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::OpenOnly => write!(f, "OPEN_ONLY"),
            Self::ReduceFirst => write!(f, "REDUCE_FIRST"),
            Self::ReduceOnly => write!(f, "REDUCE_ONLY"),
            Self::Default => write!(f, "DEFAULT"),
        }
    }
}

impl Default for MarketOrderPositionFill {
    fn default() -> MarketOrderPositionFill {
        Self::OpenOnly
    }
}