Struct JQuantsLightPlanClient

Source
pub struct JQuantsLightPlanClient { /* private fields */ }
Expand description

Light plan client for J-Quants API.

§Example

use jquants_api_client::{
    DailyStockPricesApi, EarningsCalendarApi, FinancialStatementsApi, JQuantsBuilder, JQuantsLightPlanClient,
    JQuantsPlanClient, ListedIssueInfoApi, TradingByInvestorTypeApi, TopixPricesApi, TradingCalendarApi,
    Paginatable
};

async {
    // Authenticate with a refresh token.
    let client = JQuantsLightPlanClient::new_from_refresh_token("your_refresh_token".to_string());

    // Get listed issue information.
    let response = client.get_listed_issue_info().send().await.unwrap();

    // Get stock prices.
    let response = client.get_daily_stock_prices().send().await.unwrap();

    // Paginate stock prices.
    let response = client.get_daily_stock_prices().fetch_all().await.unwrap();
    let response = client.get_daily_stock_prices().fetch_all_and_merge().await.unwrap();
    let stream = client.get_daily_stock_prices().fetch_pages_stream();

    // Get trading by investor type.
    let response = client.get_trading_by_investor_type().send().await.unwrap();

    // Paginate trading by investor type.
    let response = client.get_trading_by_investor_type().fetch_all().await.unwrap();
    let response = client.get_trading_by_investor_type().fetch_all_and_merge().await.unwrap();
    let stream = client.get_trading_by_investor_type().fetch_pages_stream();

    // Get trading calendar.
    let response = client.get_trading_calendar().send().await.unwrap();

    // Get TOPIX prices.
    let response = client.get_topix_prices().send().await.unwrap();

    // Paginate TOPIX prices.
    let response = client.get_topix_prices().fetch_all().await.unwrap();
    let response = client.get_topix_prices().fetch_all_and_merge().await.unwrap();
    let stream = client.get_topix_prices().fetch_pages_stream();

    // Get financial statements.
    let response = client.get_financial_statements().send().await.unwrap();

    // Paginate stock prices.
    let response = client.get_financial_statements().fetch_all().await.unwrap();
    let response = client.get_financial_statements().fetch_all_and_merge().await.unwrap();
    let stream = client.get_financial_statements().fetch_pages_stream();

    // Get earnings calendar.
    let response = client.get_earnings_calendar().send().await.unwrap();

    // Paginate earnings calendar.
    let response = client.get_earnings_calendar().fetch_all().await.unwrap();
    let response = client.get_earnings_calendar().fetch_all_and_merge().await.unwrap();
    let stream = client.get_earnings_calendar().fetch_pages_stream();
};

Trait Implementations§

Source§

impl Clone for JQuantsLightPlanClient

Source§

fn clone(&self) -> JQuantsLightPlanClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl DailyStockPricesApi for JQuantsLightPlanClient

Source§

type Response = DailyStockPricesStandardPlanResponse

Response type for listed info API.
Source§

fn get_daily_stock_prices(&self) -> DailyStockPricesBuilder<Self::Response>

Get api builder for daily stock prices. Read more
Source§

impl EarningsCalendarApi for JQuantsLightPlanClient

Source§

fn get_earnings_calendar(&self) -> EarningsCalendarBuilder

Get API builder for Earnings Calendar Data. Read more
Source§

impl FinancialStatementsApi for JQuantsLightPlanClient

Source§

fn get_financial_statements(&self) -> FinancialStatementsBuilder

Get API builder for Financial Statements Data. Read more
Source§

impl JQuantsPlanClient for JQuantsLightPlanClient

Source§

fn new(api_client: JQuantsApiClient) -> Self

Create a new client from an API client.
Source§

fn get_api_client(&self) -> &JQuantsApiClient

Get the API client.
Source§

fn new_from_refresh_token(refresh_token: String) -> Self

Create a new client from a refresh token.
Source§

fn new_from_account( mailaddress: &str, password: &str, ) -> impl Future<Output = Result<Self, JQuantsError>> + Send

Create a new client from an account.
Source§

fn get_current_refresh_token(&self) -> impl Future<Output = String> + Send

Get a current refresh token.
Source§

fn get_refresh_token_from_api( &self, mail_address: &str, password: &str, ) -> impl Future<Output = Result<String, JQuantsError>> + Send

Get a new refresh token from an account. But don’t update the ID token in the client. Read more
Source§

fn get_id_token_from_api( &self, refresh_token: &str, ) -> impl Future<Output = Result<String, JQuantsError>> + Send

Get a new ID token from a refresh token. But don’t update the ID token in the client. Read more
Source§

fn reset_refresh_token( &self, mail_address: &str, password: &str, ) -> impl Future<Output = Result<(), JQuantsError>> + Send

Renew the refresh token in the client.
Source§

fn reset_id_token( &self, ) -> impl Future<Output = Result<(), JQuantsError>> + Send

Renew the ID token in the client.
Source§

fn reauthenticate( &self, mail_address: &str, password: &str, ) -> impl Future<Output = Result<(), JQuantsError>> + Send

Reauthenticate with a new refresh token and a new id token.
Source§

impl ListedIssueInfoApi for JQuantsLightPlanClient

Source§

type Response = ListedIssueInfoLightPlanResponse

Response type for listed info API.
Source§

fn get_listed_issue_info(&self) -> ListedIssueInfoApiBuilder<Self::Response>

Get api builder for listed issue information. Read more
Source§

impl TopixPricesApi for JQuantsLightPlanClient

Source§

fn get_topix_prices(&self) -> TopixPricesBuilder

Get API builder for TOPIX Prices (OHLC). Read more
Source§

impl TradingByInvestorTypeApi for JQuantsLightPlanClient

Source§

fn get_trading_by_investor_type(&self) -> TradingByInvestorTypeBuilder

Get API builder for Trading by Type of Investors. Read more
Source§

impl TradingCalendarApi for JQuantsLightPlanClient

Source§

fn get_trading_calendar(&self) -> TradingCalendarBuilder

Get API builder for Trading Calendar. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,