diff --git a/src/quotes.rs b/src/quotes.rs index 8d82a32..5442026 100644 --- a/src/quotes.rs +++ b/src/quotes.rs @@ -399,37 +399,37 @@ impl YQuoteSummary { #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct YSummaryData { - pub asset_profile: AssetProfile, - pub summary_detail: SummaryDetail, - pub default_key_statistics: DefaultKeyStatistics, - pub quote_type: QuoteType, - pub financial_data: FinancialData, + pub asset_profile: Option, + pub summary_detail: Option, + pub default_key_statistics: Option, + pub quote_type: Option, + pub financial_data: Option, } #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct AssetProfile { - pub address1: String, - pub city: String, - pub state: String, - pub zip: String, - pub country: String, - pub phone: String, - pub website: String, - pub industry: String, - pub sector: String, - pub long_business_summary: String, - pub full_time_employees: u32, + pub address1: Option, + pub city: Option, + pub state: Option, + pub zip: Option, + pub country: Option, + pub phone: Option, + pub website: Option, + pub industry: Option, + pub sector: Option, + pub long_business_summary: Option, + pub full_time_employees: Option, pub company_officers: Vec, - pub audit_risk: u16, - pub board_risk: u16, - pub compensation_risk: u16, - pub share_holder_rights_risk: u16, - pub overall_risk: u16, - pub governance_epoch_date: u32, - pub compensation_as_of_epoch_date: u32, - pub ir_website: String, - pub max_age: u32, + pub audit_risk: Option, + pub board_risk: Option, + pub compensation_risk: Option, + pub share_holder_rights_risk: Option, + pub overall_risk: Option, + pub governance_epoch_date: Option, + pub compensation_as_of_epoch_date: Option, + pub ir_website: Option, + pub max_age: Option, } #[derive(Deserialize, Debug)] @@ -454,99 +454,100 @@ pub struct ValueWrapper { #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct SummaryDetail { - pub max_age: i64, - pub price_hint: i64, - pub previous_close: f64, - pub open: f64, - pub day_low: f64, - pub day_high: f64, + pub max_age: Option, + pub price_hint: Option, + pub previous_close: Option, + pub open: Option, + pub day_low: Option, + pub day_high: Option, pub regular_market_previous_close: f64, - pub regular_market_open: f64, - pub regular_market_day_low: f64, - pub regular_market_day_high: f64, - pub dividend_rate: f64, - pub dividend_yield: f64, - pub ex_dividend_date: i64, - pub payout_ratio: f64, - pub five_year_avg_dividend_yield: f64, - pub beta: f64, + pub regular_market_open: Option, + pub regular_market_day_low: Option, + pub regular_market_day_high: Option, + pub dividend_rate: Option, + pub dividend_yield: Option, + pub ex_dividend_date: Option, + pub payout_ratio: Option, + pub five_year_avg_dividend_yield: Option, + pub beta: Option, #[serde(rename = "trailingPE")] - pub trailing_pe: f64, + pub trailing_pe: Option, #[serde(rename = "forwardPE")] - pub forward_pe: f64, - pub volume: u64, - pub regular_market_volume: u64, - pub average_volume: u64, + pub forward_pe: Option, + pub volume: Option, + pub regular_market_volume: Option, + pub average_volume: Option, #[serde(rename = "averageVolume10days")] - pub average_volume_10days: u64, + pub average_volume_10days: Option, #[serde(rename = "averageDailyVolume10Day")] - pub average_daily_volume_10day: u64, - pub bid: f64, - pub ask: f64, - pub bid_size: i64, - pub ask_size: i64, - pub market_cap: u64, - pub fifty_two_week_low: f64, - pub fifty_two_week_high: f64, + pub average_daily_volume_10day: Option, + pub bid: Option, + pub ask: Option, + pub bid_size: Option, + pub ask_size: Option, + pub market_cap: Option, + pub fifty_two_week_low: Option, + pub fifty_two_week_high: Option, #[serde(rename = "priceToSalesTrailing12Months")] - pub price_to_sales_trailing12months: f64, - pub fifty_day_average: f64, - pub two_hundred_day_average: f64, - pub trailing_annual_dividend_rate: f64, - pub trailing_annual_dividend_yield: f64, - pub currency: String, + pub price_to_sales_trailing12months: Option, + pub fifty_day_average: Option, + pub two_hundred_day_average: Option, + pub trailing_annual_dividend_rate: Option, + pub trailing_annual_dividend_yield: Option, + pub currency: Option, pub from_currency: Option, pub to_currency: Option, pub last_market: Option, pub coin_market_cap_link: Option, pub algorithm: Option, - pub tradeable: bool, + pub tradeable: Option, } #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct DefaultKeyStatistics { - pub max_age: u64, - pub price_hint: u64, - pub enterprise_value: u64, + pub max_age: Option, + pub price_hint: Option, + pub enterprise_value: Option, #[serde(rename = "forwardPE")] - pub forward_pe: f64, - pub profit_margins: f64, - pub float_shares: u64, - pub shares_outstanding: u64, - pub shares_short: u64, - pub shares_short_prior_month: u64, - pub shares_short_previous_month_date: u64, - pub date_short_interest: u64, - pub shares_percent_shares_out: f64, - pub held_percent_insiders: f64, - pub held_percent_institutions: f64, - pub short_ratio: f64, - pub short_percent_of_float: f64, - pub beta: f64, - pub implied_shares_outstanding: u64, + pub forward_pe: Option, + pub profit_margins: Option, + pub float_shares: Option, + pub shares_outstanding: Option, + pub shares_short: Option, + pub shares_short_prior_month: Option, + pub shares_short_previous_month_date: Option, + pub date_short_interest: Option, + pub shares_percent_shares_out: Option, + pub held_percent_insiders: Option, + pub held_percent_institutions: Option, + pub short_ratio: Option, + pub short_percent_of_float: Option, + pub beta: Option, + pub implied_shares_outstanding: Option, pub category: Option, - pub book_value: f64, - pub price_to_book: f64, + pub book_value: Option, + pub price_to_book: Option, pub fund_family: Option, + pub fundInceptionDate: Option, pub legal_type: Option, - pub last_fiscal_year_end: u64, - pub next_fiscal_year_end: u64, - pub most_recent_quarter: u64, - pub earnings_quarterly_growth: f64, - pub net_income_to_common: u64, - pub trailing_eps: f64, - pub forward_eps: f64, - pub last_split_factor: String, - pub last_split_date: u64, - pub enterprise_to_revenue: f64, - pub enterprise_to_ebitda: f64, + pub last_fiscal_year_end: Option, + pub next_fiscal_year_end: Option, + pub most_recent_quarter: Option, + pub earnings_quarterly_growth: Option, + pub net_income_to_common: Option, + pub trailing_eps: Option, + pub forward_eps: Option, + pub last_split_factor: Option, + pub last_split_date: Option, + pub enterprise_to_revenue: Option, + pub enterprise_to_ebitda: Option, #[serde(rename = "52WeekChange")] - pub fifty_two_week_change: f64, + pub fifty_two_week_change: Option, #[serde(rename = "SandP52WeekChange")] - pub sand_p_fifty_two_week_change: f64, - pub last_dividend_value: f64, - pub last_dividend_date: u64, + pub sand_p_fifty_two_week_change: Option, + pub last_dividend_value: Option, + pub last_dividend_date: Option, pub latest_share_class: Option, pub lead_investor: Option, } @@ -554,47 +555,47 @@ pub struct DefaultKeyStatistics { #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct QuoteType { - pub exchange: String, - pub symbol: String, - pub long_name: String, + pub exchange: Option, + pub symbol: Option, + pub long_name: Option, #[serde(rename = "timeZoneFullName")] - pub timezone_full_name: String, - pub uuid: String, + pub timezone_full_name: Option, + pub uuid: Option, } #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct FinancialData { - pub max_age: u64, - pub current_price: f64, - pub target_high_price: f64, - pub target_low_price: f64, - pub target_mean_price: f64, - pub target_median_price: f64, - pub recommendation_mean: f64, - pub recommendation_key: String, - pub number_of_analyst_opinions: u64, - pub total_cash: u64, - pub total_cash_per_share: f64, - pub ebitda: u64, - pub total_debt: u64, - pub quick_ratio: f64, - pub current_ratio: f64, - pub total_revenue: u64, - pub debt_to_equity: f64, - pub revenue_per_share: f64, - pub return_on_assets: f64, - pub return_on_equity: f64, - pub gross_profits: u64, - pub free_cashflow: u64, - pub operating_cashflow: u64, - pub earnings_growth: f64, - pub revenue_growth: f64, - pub gross_margins: f64, - pub ebitda_margins: f64, - pub operating_margins: f64, - pub profit_margins: f64, - pub financial_currency: String, + pub max_age: Option, + pub current_price: Option, + pub target_high_price: Option, + pub target_low_price: Option, + pub target_mean_price: Option, + pub target_median_price: Option, + pub recommendation_mean: Option, + pub recommendation_key: Option, + pub number_of_analyst_opinions: Option, + pub total_cash: Option, + pub total_cash_per_share: Option, + pub ebitda: Option, + pub total_debt: Option, + pub quick_ratio: Option, + pub current_ratio: Option, + pub total_revenue: Option, + pub debt_to_equity: Option, + pub revenue_per_share: Option, + pub return_on_assets: Option, + pub return_on_equity: Option, + pub gross_profits: Option, + pub free_cashflow: Option, + pub operating_cashflow: Option, + pub earnings_growth: Option, + pub revenue_growth: Option, + pub gross_margins: Option, + pub ebitda_margins: Option, + pub operating_margins: Option, + pub profit_margins: Option, + pub financial_currency: Option, } #[cfg(test)]