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

/// MarketOrderMarginCloseoutReason : The reason the Market Order was created to perform a margin closeout
/// The reason the Market Order was created to perform a margin closeout
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MarketOrderMarginCloseoutReason {
    #[serde(rename = "MARGIN_CHECK_VIOLATION")]
    MarginCheckViolation,
    #[serde(rename = "REGULATORY_MARGIN_CALL_VIOLATION")]
    RegulatoryMarginCallViolation,
    #[serde(rename = "REGULATORY_MARGIN_CHECK_VIOLATION")]
    RegulatoryMarginCheckViolation,

}

impl std::fmt::Display for MarketOrderMarginCloseoutReason {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::MarginCheckViolation => write!(f, "MARGIN_CHECK_VIOLATION"),
            Self::RegulatoryMarginCallViolation => write!(f, "REGULATORY_MARGIN_CALL_VIOLATION"),
            Self::RegulatoryMarginCheckViolation => write!(f, "REGULATORY_MARGIN_CHECK_VIOLATION"),
        }
    }
}

impl Default for MarketOrderMarginCloseoutReason {
    fn default() -> MarketOrderMarginCloseoutReason {
        Self::MarginCheckViolation
    }
}