1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct IndexSymbol {
9 pub symbol: String,
11 pub name: Option<String>,
13 pub currency: Option<String>,
15 pub stock_exchange: Option<String>,
17 pub exchange_short_name: Option<String>,
19}
20
21#[derive(Debug, Clone, Serialize, Deserialize)]
23#[serde(rename_all = "camelCase")]
24pub struct IndexQuote {
25 pub symbol: String,
27 pub name: Option<String>,
29 pub price: Option<f64>,
31 pub change: Option<f64>,
33 pub changes_percentage: Option<f64>,
35 pub day_low: Option<f64>,
37 pub day_high: Option<f64>,
39 pub year_low: Option<f64>,
41 pub year_high: Option<f64>,
43 pub open: Option<f64>,
45 pub previous_close: Option<f64>,
47 pub timestamp: Option<i64>,
49}
50
51#[derive(Debug, Clone, Serialize, Deserialize)]
53#[serde(rename_all = "camelCase")]
54pub struct IndexHistorical {
55 pub date: String,
57 pub open: f64,
59 pub high: f64,
61 pub low: f64,
63 pub close: f64,
65 pub adj_close: Option<f64>,
67 pub volume: Option<f64>,
69}
70
71#[derive(Debug, Clone, Serialize, Deserialize)]
73#[serde(rename_all = "camelCase")]
74pub struct IndexConstituent {
75 pub symbol: String,
77 pub name: Option<String>,
79 pub sector: Option<String>,
81 pub sub_sector: Option<String>,
83 pub headquarters_location: Option<String>,
85 pub date_first_added: Option<String>,
87 pub cik: Option<String>,
89 pub founded: Option<String>,
91}