#[cfg(feature = "company")]
use super::company::{
CompanyConcept, CompanyFacts, CompanyTicker, CompanyTickerExchange, Frame, MutualFundTicker,
};
use super::error::Result;
#[cfg(feature = "filings")]
use super::filings::{DetailedFiling, DirectoryResponse, Submission};
#[cfg(feature = "index")]
use super::index::{EdgarDay, EdgarPeriod, IndexResponse};
#[cfg(any(feature = "filings", feature = "index", feature = "feeds"))]
use super::options::{FeedOptions, FilingOptions};
#[cfg(feature = "search")]
use super::search::{Hit, SearchOptions, SearchResponse};
#[cfg(feature = "feeds")]
use crate::parsing::atom::AtomDocument;
#[cfg(feature = "index")]
use crate::parsing::index::IndexEntry;
#[cfg(feature = "feeds")]
use crate::parsing::rss::RssDocument;
use async_trait::async_trait;
#[cfg(feature = "company")]
#[async_trait]
pub trait CompanyOperations {
async fn company_tickers(&self) -> Result<Vec<CompanyTicker>>;
async fn company_cik(&self, ticker: &str) -> Result<u64>;
async fn mutual_fund_cik(&self, ticker: &str) -> Result<u64>;
async fn company_tickers_with_exchange(&self) -> Result<Vec<CompanyTickerExchange>>;
async fn mutual_fund_tickers(&self) -> Result<Vec<MutualFundTicker>>;
async fn company_facts(&self, cik: u64) -> Result<CompanyFacts>;
async fn company_concept(&self, cik: u64, taxonomy: &str, tag: &str) -> Result<CompanyConcept>;
async fn frames(&self, taxonomy: &str, tag: &str, unit: &str, period: &str) -> Result<Frame>;
}
#[cfg(feature = "filings")]
#[async_trait]
pub trait FilingOperations {
async fn submissions(&self, cik: &str) -> Result<Submission>;
async fn get_recent_filings(&self, cik: &str) -> Result<Vec<DetailedFiling>>;
async fn filings(&self, cik: &str, opts: Option<FilingOptions>) -> Result<Vec<DetailedFiling>>;
async fn filing_directory(
&self,
cik: &str,
accession_number: &str,
) -> Result<DirectoryResponse>;
async fn entity_directory(&self, cik: &str) -> Result<DirectoryResponse>;
fn get_filing_url_from_id(&self, cik: &str, filing_id: &str) -> Result<String>;
async fn get_filing_content_by_id(&self, cik: &str, filing_id: &str) -> Result<String>;
async fn get_latest_filing_content(&self, cik: &str, form_types: &[&str]) -> Result<String>;
async fn get_text_filing_links(
&self,
cik: &str,
opts: Option<FilingOptions>,
) -> Result<Vec<(DetailedFiling, String, String)>>;
async fn get_sgml_header_links(
&self,
cik: &str,
opts: Option<FilingOptions>,
) -> Result<Vec<(DetailedFiling, String, String)>>;
}
#[cfg(feature = "feeds")]
#[async_trait]
pub trait FeedOperations {
async fn current_feed(&self, opts: Option<FeedOptions>) -> Result<AtomDocument>;
fn current_feed_from_string(&self, content: &str) -> Result<AtomDocument>;
async fn company_feed(&self, cik: &str, opts: Option<FeedOptions>) -> Result<AtomDocument>;
fn company_feed_from_string(&self, content: &str) -> Result<AtomDocument>;
async fn get_rss_feed(&self, url: &str) -> Result<RssDocument>;
fn rss_feed_from_string(&self, content: &str) -> Result<RssDocument>;
async fn press_release_feed(&self) -> Result<RssDocument>;
async fn speeches_and_statements_feed(&self) -> Result<RssDocument>;
async fn speeches_feed(&self) -> Result<RssDocument>;
async fn statements_feed(&self) -> Result<RssDocument>;
async fn testimony_feed(&self) -> Result<RssDocument>;
async fn administrative_proceedings_feed(&self) -> Result<RssDocument>;
async fn division_of_corporation_finance_feed(&self) -> Result<RssDocument>;
async fn division_of_investment_management_feed(&self) -> Result<RssDocument>;
async fn investor_alerts_feed(&self) -> Result<RssDocument>;
async fn filings_feed(&self) -> Result<RssDocument>;
async fn mutual_funds_feed(&self) -> Result<RssDocument>;
async fn xbrl_feed(&self) -> Result<RssDocument>;
async fn inline_xbrl_feed(&self) -> Result<RssDocument>;
async fn historical_xbrl_feed(&self, year: i32, month: i32) -> Result<RssDocument>;
}
#[cfg(feature = "index")]
#[async_trait]
pub trait IndexOperations {
async fn full_index(&self, period: Option<EdgarPeriod>) -> Result<IndexResponse>;
async fn daily_index(&self, period: Option<EdgarPeriod>) -> Result<IndexResponse>;
async fn get_daily_filings(
&self,
day: EdgarDay,
options: Option<FilingOptions>,
) -> Result<Vec<IndexEntry>>;
async fn get_period_filings(
&self,
period: EdgarPeriod,
options: Option<FilingOptions>,
) -> Result<Vec<IndexEntry>>;
}
#[cfg(feature = "search")]
#[async_trait]
pub trait SearchOperations {
async fn search(&self, options: SearchOptions) -> Result<SearchResponse>;
async fn search_all(&self, options: SearchOptions) -> Result<Vec<Hit>>;
}