pub struct Companies<'a> { /* private fields */ }Expand description
Company endpoints: client.companies(). They need the entityAccess entitlement
(without it: Error::Api with api_kind forbidden).
Implementations§
Source§impl Companies<'_>
impl Companies<'_>
Sourcepub async fn search(&self, params: &CompanySearchParams) -> Result<CompanyList>
pub async fn search(&self, params: &CompanySearchParams) -> Result<CompanyList>
Resolves companies by ticker, name, alias, ISIN or vendor notation (at most 10 results, no pages). Costs 1 credit per request, errors included.
Sourcepub async fn get_many(&self, ids: &[i64]) -> Result<CompanyList>
pub async fn get_many(&self, ids: &[i64]) -> Result<CompanyList>
Resolves 1 to 10 company ids. Unknown ids are left out; the order is not guaranteed. Costs 1 credit per request, however many ids it carries, errors included.
Sourcepub async fn get(&self, company_id: i64) -> Result<CompanyRecord>
pub async fn get(&self, company_id: i64) -> Result<CompanyRecord>
One company. A miss is Error::Api with api_kind not_found.
The SDK keeps no cache of company records and sends no If-None-Match here. The
record carries its ETag and Cache-Control in cache_info(): to save credits, keep
the record yourself and do not call again within max-age, or revalidate with
get_if_none_match. Costs 1 credit per request, like an article request; errors cost
1 credit too.
Sourcepub async fn get_if_none_match(
&self,
company_id: i64,
etag: &str,
) -> Result<Option<CompanyRecord>>
pub async fn get_if_none_match( &self, company_id: i64, etag: &str, ) -> Result<Option<CompanyRecord>>
One company, revalidated with an ETag you kept from an earlier record
(cache_info().etag), sent unchanged as If-None-Match. Ok(None) means
“not modified” (304), which is never an error: keep using your own copy. Costs 1 credit
per request; a 304 and errors cost 1 credit too, so revalidating saves the download,
not the credit.