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

/// TradeOrderTimeInForce : The time in force for the created Stop Loss Order. This may only be GTC, GTD or GFD.
/// The time in force for the created Stop Loss Order. This may only be GTC, GTD or GFD.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TradeOrderTimeInForce {
    #[serde(rename = "GTC")]
    Gtc,
    #[serde(rename = "GTD")]
    Gtd,
    #[serde(rename = "GFD")]
    Gfd,

}

impl std::fmt::Display for TradeOrderTimeInForce {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::Gtc => write!(f, "GTC"),
            Self::Gtd => write!(f, "GTD"),
            Self::Gfd => write!(f, "GFD"),
        }
    }
}

impl Default for TradeOrderTimeInForce {
    fn default() -> TradeOrderTimeInForce {
        Self::Gtc
    }
}