fmp_rs/models/
bulk.rs

1//! Models for bulk data endpoints
2
3use serde::{Deserialize, Serialize};
4
5/// Bulk stock prices data
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct BulkStockPrice {
9    /// Stock symbol
10    pub symbol: Option<String>,
11    /// Company name
12    pub name: Option<String>,
13    /// Current price
14    pub price: Option<f64>,
15    /// Price change
16    pub change: Option<f64>,
17    /// Percentage change
18    pub changes_percentage: Option<f64>,
19    /// Day low
20    pub day_low: Option<f64>,
21    /// Day high
22    pub day_high: Option<f64>,
23    /// Year low
24    pub year_low: Option<f64>,
25    /// Year high
26    pub year_high: Option<f64>,
27    /// Market capitalization
28    pub market_cap: Option<f64>,
29    /// Price to earnings ratio
30    pub pe: Option<f64>,
31    /// Volume
32    pub volume: Option<i64>,
33    /// Average volume
34    pub avg_volume: Option<i64>,
35    /// Exchange
36    pub exchange: Option<String>,
37    /// Open price
38    pub open: Option<f64>,
39    /// Previous close
40    pub previous_close: Option<f64>,
41    /// Earnings per share
42    pub eps: Option<f64>,
43    /// Shares outstanding
44    pub shares_outstanding: Option<i64>,
45    /// Timestamp
46    pub timestamp: Option<i64>,
47}
48
49/// Bulk financial statements
50#[derive(Debug, Clone, Serialize, Deserialize)]
51#[serde(rename_all = "camelCase")]
52pub struct BulkFinancialStatement {
53    /// Stock symbol
54    pub symbol: Option<String>,
55    /// Date of the financial statement
56    pub date: Option<String>,
57    /// Calendar year
58    pub calendar_year: Option<String>,
59    /// Period (annual, quarterly)
60    pub period: Option<String>,
61    /// Revenue
62    pub revenue: Option<f64>,
63    /// Cost of revenue
64    pub cost_of_revenue: Option<f64>,
65    /// Gross profit
66    pub gross_profit: Option<f64>,
67    /// Operating income
68    pub operating_income: Option<f64>,
69    /// Net income
70    pub net_income: Option<f64>,
71    /// Total assets
72    pub total_assets: Option<f64>,
73    /// Total liabilities
74    pub total_liabilities: Option<f64>,
75    /// Total stockholders equity
76    pub total_stockholders_equity: Option<f64>,
77    /// Operating cash flow
78    pub operating_cash_flow: Option<f64>,
79    /// Free cash flow
80    pub free_cash_flow: Option<f64>,
81    /// Total debt
82    pub total_debt: Option<f64>,
83    /// Cash and cash equivalents
84    pub cash_and_cash_equivalents: Option<f64>,
85}
86
87/// Bulk ETF holdings data
88#[derive(Debug, Clone, Serialize, Deserialize)]
89#[serde(rename_all = "camelCase")]
90pub struct BulkEtfHolding {
91    /// ETF symbol
92    pub etf_symbol: Option<String>,
93    /// Holding symbol
94    pub asset_symbol: Option<String>,
95    /// Asset name
96    pub name: Option<String>,
97    /// Number of shares held
98    pub shares_number: Option<f64>,
99    /// Market value of holding
100    pub market_value: Option<f64>,
101    /// Weight in the ETF
102    pub weight_percentage: Option<f64>,
103    /// Updated date
104    pub updated: Option<String>,
105}
106
107/// Bulk insider trading data
108#[derive(Debug, Clone, Serialize, Deserialize)]
109#[serde(rename_all = "camelCase")]
110pub struct BulkInsiderTrade {
111    /// Filing date
112    pub filing_date: Option<String>,
113    /// Transaction date
114    pub transaction_date: Option<String>,
115    /// Reporting CIK
116    pub reporting_cik: Option<String>,
117    /// Transaction type
118    pub transaction_type: Option<String>,
119    /// Securities owned
120    pub securities_owned: Option<f64>,
121    /// Company CIK
122    pub company_cik: Option<String>,
123    /// Company name
124    pub company_name: Option<String>,
125    /// Securities transacted
126    pub securities_transacted: Option<f64>,
127    /// Price
128    pub price: Option<f64>,
129    /// Security name
130    pub security_name: Option<String>,
131    /// CIK
132    pub cik: Option<String>,
133    /// Symbol
134    pub symbol: Option<String>,
135    /// Transaction value
136    pub transaction_value: Option<f64>,
137}
138
139/// Bulk institutional holdings
140#[derive(Debug, Clone, Serialize, Deserialize)]
141#[serde(rename_all = "camelCase")]
142pub struct BulkInstitutionalHolding {
143    /// Filing date
144    pub date_reported: Option<String>,
145    /// CIK of the institution
146    pub cik: Option<String>,
147    /// Institution name
148    pub name_of_issuer: Option<String>,
149    /// Ticker symbol
150    pub ticker_symbol: Option<String>,
151    /// CUSIP
152    pub cusip: Option<String>,
153    /// Value of holding
154    pub value: Option<f64>,
155    /// Number of shares
156    pub shares: Option<f64>,
157    /// Put/call indicator
158    pub put_call: Option<String>,
159    /// Investment discretion
160    pub investment_discretion: Option<String>,
161    /// Sole voting authority
162    pub sole_voting_authority: Option<f64>,
163    /// Shared voting authority
164    pub shared_voting_authority: Option<f64>,
165    /// No voting authority
166    pub no_voting_authority: Option<f64>,
167}
168
169/// Bulk earnings estimates
170#[derive(Debug, Clone, Serialize, Deserialize)]
171#[serde(rename_all = "camelCase")]
172pub struct BulkEarningsEstimate {
173    /// Symbol
174    pub symbol: Option<String>,
175    /// Date
176    pub date: Option<String>,
177    /// Estimated revenue low
178    pub estimated_revenue_low: Option<f64>,
179    /// Estimated revenue high
180    pub estimated_revenue_high: Option<f64>,
181    /// Estimated revenue avg
182    pub estimated_revenue_avg: Option<f64>,
183    /// Estimated EPS avg
184    pub estimated_eps_avg: Option<f64>,
185    /// Estimated EPS high
186    pub estimated_eps_high: Option<f64>,
187    /// Estimated EPS low
188    pub estimated_eps_low: Option<f64>,
189    /// Number of analysts
190    pub number_analyst_estimated_revenue: Option<i32>,
191    /// Number of EPS analysts
192    pub number_analyst_estimated_eps: Option<i32>,
193}
194
195/// Bulk download information/metadata
196#[derive(Debug, Clone, Serialize, Deserialize)]
197#[serde(rename_all = "camelCase")]
198pub struct BulkDataInfo {
199    /// Dataset name
200    pub dataset: Option<String>,
201    /// Last updated timestamp
202    pub last_updated: Option<String>,
203    /// File size in bytes
204    pub file_size: Option<i64>,
205    /// Number of records
206    pub record_count: Option<i64>,
207    /// Download URL
208    pub download_url: Option<String>,
209    /// Format (CSV, JSON, etc.)
210    pub format: Option<String>,
211    /// Compression type
212    pub compression: Option<String>,
213    /// Schema version
214    pub schema_version: Option<String>,
215}
216
217/// Bulk historical prices metadata
218#[derive(Debug, Clone, Serialize, Deserialize)]
219#[serde(rename_all = "camelCase")]
220pub struct BulkHistoricalPricesMeta {
221    /// Date range start
222    pub date_from: Option<String>,
223    /// Date range end
224    pub date_to: Option<String>,
225    /// Symbols included count
226    pub symbols_count: Option<i32>,
227    /// Total data points
228    pub total_records: Option<i64>,
229    /// File format
230    pub file_format: Option<String>,
231    /// Estimated download size
232    pub estimated_size_mb: Option<f64>,
233}