deriv_api_schema/
ohlc.rs

1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/ticks_history/receive.json
4
5// Use direct crate names for imports within generated files
6use serde::{Deserialize, Serialize}; 
7
8
9use chrono::{DateTime, Utc};
10
11// Import shared types from the *same* crate
12
13// It's a struct
14/// Historic tick data for a given symbol. Note: this will always return the latest possible set of ticks with accordance to the parameters specified.
15#[derive(Debug, Clone, Serialize, Deserialize)]
16#[serde(rename_all = "snake_case")]
17pub struct Ohlc {
18    /// It is the close price value for the given time\n
19    // Correct serde attribute construction - Use helper
20    #[serde(skip_serializing_if = "Option::is_none")] 
21    pub close: Option<String>,
22    /// It is an epoch value\n
23    // Correct serde attribute construction - Use helper
24    #[serde(skip_serializing_if = "Option::is_none")] 
25    pub epoch: Option<DateTime<Utc>>,
26    /// Granularity\n
27    // Correct serde attribute construction - Use helper
28    #[serde(skip_serializing_if = "Option::is_none")] 
29    pub granularity: Option<i64>,
30    /// It is the high price value for the given time\n
31    // Correct serde attribute construction - Use helper
32    #[serde(skip_serializing_if = "Option::is_none")] 
33    pub high: Option<String>,
34    /// Subscription unique identifier. Can be passed to the `forget` API call to unsubscribe.\n
35    // Correct serde attribute construction - Use helper
36    #[serde(skip_serializing_if = "Option::is_none")] 
37    pub id: Option<String>,
38    /// It is the low price value for the given time\n
39    // Correct serde attribute construction - Use helper
40    #[serde(skip_serializing_if = "Option::is_none")] 
41    pub low: Option<String>,
42    /// It is the open price value for the given time\n
43    // Correct serde attribute construction - Use helper
44    #[serde(skip_serializing_if = "Option::is_none")] 
45    pub open: Option<String>,
46    /// It is an epoch of open time\n
47    // Correct serde attribute construction - Use helper
48    #[serde(skip_serializing_if = "Option::is_none")] 
49    pub open_time: Option<DateTime<Utc>>,
50    /// PIP size\n
51    // Correct serde attribute construction - Use helper
52    #[serde(skip_serializing_if = "Option::is_none")] 
53    pub pip_size: Option<i64>,
54    /// Symbol name\n
55    // Correct serde attribute construction - Use helper
56    #[serde(skip_serializing_if = "Option::is_none")] 
57    pub symbol: Option<String>,
58}
59