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

/// CandlestickGranularity : The granularity of the candlesticks.
/// The granularity of the candlesticks.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CandlestickGranularity {
    #[serde(rename = "S5")]
    S5,
    #[serde(rename = "S10")]
    S10,
    #[serde(rename = "S15")]
    S15,
    #[serde(rename = "S30")]
    S30,
    #[serde(rename = "M1")]
    M1,
    #[serde(rename = "M2")]
    M2,
    #[serde(rename = "M4")]
    M4,
    #[serde(rename = "M5")]
    M5,
    #[serde(rename = "M10")]
    M10,
    #[serde(rename = "M15")]
    M15,
    #[serde(rename = "M30")]
    M30,
    #[serde(rename = "H1")]
    H1,
    #[serde(rename = "H2")]
    H2,
    #[serde(rename = "H3")]
    H3,
    #[serde(rename = "H4")]
    H4,
    #[serde(rename = "H6")]
    H6,
    #[serde(rename = "H8")]
    H8,
    #[serde(rename = "H12")]
    H12,
    #[serde(rename = "D")]
    D,
    #[serde(rename = "W")]
    W,
    #[serde(rename = "M")]
    M,

}

impl std::fmt::Display for CandlestickGranularity {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::S5 => write!(f, "S5"),
            Self::S10 => write!(f, "S10"),
            Self::S15 => write!(f, "S15"),
            Self::S30 => write!(f, "S30"),
            Self::M1 => write!(f, "M1"),
            Self::M2 => write!(f, "M2"),
            Self::M4 => write!(f, "M4"),
            Self::M5 => write!(f, "M5"),
            Self::M10 => write!(f, "M10"),
            Self::M15 => write!(f, "M15"),
            Self::M30 => write!(f, "M30"),
            Self::H1 => write!(f, "H1"),
            Self::H2 => write!(f, "H2"),
            Self::H3 => write!(f, "H3"),
            Self::H4 => write!(f, "H4"),
            Self::H6 => write!(f, "H6"),
            Self::H8 => write!(f, "H8"),
            Self::H12 => write!(f, "H12"),
            Self::D => write!(f, "D"),
            Self::W => write!(f, "W"),
            Self::M => write!(f, "M"),
        }
    }
}

impl Default for CandlestickGranularity {
    fn default() -> CandlestickGranularity {
        Self::S5
    }
}