deriv_api_schema/granularity.rs
1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/ticks_history/send.json
4
5// Use direct crate names for imports within generated files
6use serde::{Deserialize, Serialize};
7
8
9
10
11// Import shared types from the *same* crate
12
13/// [Optional] Only applicable for style: `candles`. Candle time-dimension width setting. (default: `60`).
14#[derive(Debug, Clone, Serialize, Deserialize)] // Enums should also derive Serialize/Deserialize
15#[serde(rename_all = "snake_case")]
16pub enum Granularity {
17 Value60 = 60,
18 Value120 = 120,
19 Value180 = 180,
20 Value300 = 300,
21 Value600 = 600,
22 Value900 = 900,
23 Value1800 = 1800,
24 Value3600 = 3600,
25 Value7200 = 7200,
26 Value14400 = 14400,
27 Value28800 = 28800,
28 Value86400 = 86400,
29}
30
31// Optional: Derive Default for enums, defaulting to the first variant? Or require explicit handling?
32// For now, DO NOT derive Default for enums automatically. Structs needing them must handle it.
33
34/* // Example: Deriving Default for Enum (use with caution)
35impl Default for Granularity {
36 fn default() -> Self {
37 // Default to the first variant found
38 Self::Value60
39 }
40}
41*/
42