pub(crate) mod price;
pub(crate) mod quote_type;
pub(crate) mod response;
pub mod data;
pub mod formatted_value;
pub use data::Quote;
pub use formatted_value::FormattedValue;
pub(crate) use crate::models::fundamentals::{
BalanceSheetHistory, BalanceSheetHistoryQuarterly, CashflowStatementHistory,
CashflowStatementHistoryQuarterly, DefaultKeyStatistics, FinancialData, IncomeStatementHistory,
IncomeStatementHistoryQuarterly, SummaryDetail,
};
pub(crate) use crate::models::corporate::{
AssetProfile, CalendarEvents, CompanyOfficer, Earnings, EarningsHistory, EarningsTrend,
EquityPerformance, FundOwnership, FundPerformance, FundProfile, InsiderHolders,
InsiderTransactions, InstitutionOwnership, MajorHoldersBreakdown, NetSharePurchaseActivity,
RecommendationTrend, SecFilings, SummaryProfile, TopHoldings, UpgradeDowngradeHistory,
};
pub(crate) use crate::models::market::{IndexTrend, IndustryTrend, SectorTrend};
pub(crate) use price::Price;
pub(crate) use quote_type::QuoteTypeData;
pub(crate) use response::QuoteSummaryResponse;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub(crate) enum Module {
AssetProfile,
CalendarEvents,
CompanyOfficers,
EarningHistory,
Earnings,
EarningsTrend,
EquityPerformance,
FinancialData,
FundBondHoldings,
FundBondRatings,
FundEquityHoldings,
FundHoldingInfo,
FundOwnership,
FundPerformance,
FundProfile,
FundSectorWeightings,
FundTopHoldings,
GradingHistory,
IndexTrend,
IndustryTrend,
InsiderHolders,
InsiderTransactions,
InstitutionOwnership,
KeyStats,
MajorHolders,
QuoteType,
RecommendationTrend,
SecFilings,
SharePurchaseActivity,
SummaryDetail,
SummaryProfile,
BalanceSheetHistory,
BalanceSheetHistoryQuarterly,
CashflowStatementHistory,
CashflowStatementHistoryQuarterly,
IncomeStatementHistory,
IncomeStatementHistoryQuarterly,
EsgScores,
Price,
SectorTrend,
TopHoldings,
}
impl Module {
pub fn as_str(&self) -> &'static str {
match self {
Module::AssetProfile => "assetProfile",
Module::CalendarEvents => "calendarEvents",
Module::CompanyOfficers => "companyOfficers",
Module::EarningHistory => "earningsHistory",
Module::Earnings => "earnings",
Module::EarningsTrend => "earningsTrend",
Module::EquityPerformance => "equityPerformance",
Module::FinancialData => "financialData",
Module::FundBondHoldings => "fundBondHoldings",
Module::FundBondRatings => "fundBondRatings",
Module::FundEquityHoldings => "fundEquityHoldings",
Module::FundHoldingInfo => "fundHoldingInfo",
Module::FundOwnership => "fundOwnership",
Module::FundPerformance => "fundPerformance",
Module::FundProfile => "fundProfile",
Module::FundSectorWeightings => "fundSectorWeightings",
Module::FundTopHoldings => "fundTopHoldings",
Module::GradingHistory => "upgradeDowngradeHistory",
Module::IndexTrend => "indexTrend",
Module::IndustryTrend => "industryTrend",
Module::InsiderHolders => "insiderHolders",
Module::InsiderTransactions => "insiderTransactions",
Module::InstitutionOwnership => "institutionOwnership",
Module::KeyStats => "defaultKeyStatistics",
Module::MajorHolders => "majorHoldersBreakdown",
Module::QuoteType => "quoteType",
Module::RecommendationTrend => "recommendationTrend",
Module::SecFilings => "secFilings",
Module::SharePurchaseActivity => "netSharePurchaseActivity",
Module::SummaryDetail => "summaryDetail",
Module::SummaryProfile => "summaryProfile",
Module::BalanceSheetHistory => "balanceSheetHistory",
Module::BalanceSheetHistoryQuarterly => "balanceSheetHistoryQuarterly",
Module::CashflowStatementHistory => "cashflowStatementHistory",
Module::CashflowStatementHistoryQuarterly => "cashflowStatementHistoryQuarterly",
Module::IncomeStatementHistory => "incomeStatementHistory",
Module::IncomeStatementHistoryQuarterly => "incomeStatementHistoryQuarterly",
Module::EsgScores => "esgScores",
Module::Price => "price",
Module::SectorTrend => "sectorTrend",
Module::TopHoldings => "topHoldings",
}
}
pub fn all() -> Vec<Module> {
vec![
Module::AssetProfile,
Module::CalendarEvents,
Module::CompanyOfficers,
Module::EarningHistory,
Module::Earnings,
Module::EarningsTrend,
Module::EquityPerformance,
Module::FinancialData,
Module::FundBondHoldings,
Module::FundBondRatings,
Module::FundEquityHoldings,
Module::FundHoldingInfo,
Module::FundOwnership,
Module::FundPerformance,
Module::FundProfile,
Module::FundSectorWeightings,
Module::FundTopHoldings,
Module::GradingHistory,
Module::IndexTrend,
Module::IndustryTrend,
Module::InsiderHolders,
Module::InsiderTransactions,
Module::InstitutionOwnership,
Module::KeyStats,
Module::MajorHolders,
Module::QuoteType,
Module::RecommendationTrend,
Module::SecFilings,
Module::SharePurchaseActivity,
Module::SummaryDetail,
Module::SummaryProfile,
Module::BalanceSheetHistory,
Module::BalanceSheetHistoryQuarterly,
Module::CashflowStatementHistory,
Module::CashflowStatementHistoryQuarterly,
Module::IncomeStatementHistory,
Module::IncomeStatementHistoryQuarterly,
Module::EsgScores,
Module::Price,
Module::SectorTrend,
Module::TopHoldings,
]
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_module_as_str() {
assert_eq!(Module::SummaryDetail.as_str(), "summaryDetail");
assert_eq!(Module::KeyStats.as_str(), "defaultKeyStatistics");
}
#[test]
fn test_module_all() {
let all_modules = Module::all();
assert!(all_modules.len() > 30);
}
}