fmp_rs/models/
analyst.rs

1//! Analyst data models.
2
3use serde::{Deserialize, Serialize};
4
5/// Analyst estimates
6#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
7#[serde(rename_all = "camelCase")]
8pub struct AnalystEstimates {
9    pub symbol: String,
10    pub date: String,
11    pub estimated_revenue_low: i64,
12    pub estimated_revenue_high: i64,
13    pub estimated_revenue_avg: i64,
14    pub estimated_ebitda_low: i64,
15    pub estimated_ebitda_high: i64,
16    pub estimated_ebitda_avg: i64,
17    pub estimated_ebit_low: i64,
18    pub estimated_ebit_high: i64,
19    pub estimated_ebit_avg: i64,
20    pub estimated_net_income_low: i64,
21    pub estimated_net_income_high: i64,
22    pub estimated_net_income_avg: i64,
23    pub estimated_sga_expense_low: i64,
24    pub estimated_sga_expense_high: i64,
25    pub estimated_sga_expense_avg: i64,
26    pub estimated_eps_avg: f64,
27    pub estimated_eps_high: f64,
28    pub estimated_eps_low: f64,
29    pub number_analyst_estimated_revenue: i32,
30    pub number_analysts_estimated_eps: i32,
31}
32
33/// Price target
34#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
35#[serde(rename_all = "camelCase")]
36pub struct PriceTarget {
37    pub symbol: String,
38    pub published_date: String,
39    pub news_url: String,
40    pub news_title: String,
41    pub analyst_name: String,
42    pub price_target: f64,
43    pub adj_price_target: f64,
44    pub price_when_posted: f64,
45    pub news_publisher: String,
46    pub news_base_url: String,
47    pub analyst_company: String,
48}
49
50/// Analyst recommendation/grade
51#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
52#[serde(rename_all = "camelCase")]
53pub struct AnalystGrade {
54    pub symbol: String,
55    pub published_date: String,
56    pub grading_company: String,
57    pub new_grade: String,
58    pub previous_grade: Option<String>,
59    pub grade_action: String,
60}
61
62/// Consensus summary
63#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
64#[serde(rename_all = "camelCase")]
65pub struct ConsensusSummary {
66    pub symbol: String,
67    pub strong_buy: i32,
68    pub buy: i32,
69    pub hold: i32,
70    pub sell: i32,
71    pub strong_sell: i32,
72    pub consensus: String,
73}