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

/// TradeOrderTransactionReason : The reason that the Stop Loss Order was initiated
/// The reason that the Stop Loss Order was initiated
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TradeOrderTransactionReason {
    #[serde(rename = "CLIENT_ORDER")]
    ClientOrder,
    #[serde(rename = "REPLACEMENT")]
    Replacement,
    #[serde(rename = "ON_FILL")]
    OnFill,

}

impl std::fmt::Display for TradeOrderTransactionReason {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::ClientOrder => write!(f, "CLIENT_ORDER"),
            Self::Replacement => write!(f, "REPLACEMENT"),
            Self::OnFill => write!(f, "ON_FILL"),
        }
    }
}

impl Default for TradeOrderTransactionReason {
    fn default() -> TradeOrderTransactionReason {
        Self::ClientOrder
    }
}