LinkyApiClient

Trait LinkyApiClient 

Source
pub trait LinkyApiClient: Send + Sync {
    // Required methods
    fn exchange_authorization_code<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        authorization_code: &'life1 str,
        redirect_uri: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<OAuth2TokenResponse, LinkyApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn refresh_access_token<'life0, 'life1, 'async_trait>(
        &'life0 self,
        refresh_token: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<OAuth2TokenResponse, LinkyApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_daily_consumption<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        prm: &'life1 str,
        access_token: &'life2 str,
        start_date: DateTime<Utc>,
        end_date: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ConsumptionDataPoint>, LinkyApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_monthly_consumption<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        prm: &'life1 str,
        access_token: &'life2 str,
        start_date: DateTime<Utc>,
        end_date: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ConsumptionDataPoint>, LinkyApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_consumption_load_curve<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        prm: &'life1 str,
        access_token: &'life2 str,
        start_date: DateTime<Utc>,
        end_date: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ConsumptionDataPoint>, LinkyApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_max_power<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        prm: &'life1 str,
        access_token: &'life2 str,
        start_date: DateTime<Utc>,
        end_date: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PowerDataPoint>, LinkyApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Linky API client port for fetching electricity consumption data

Required Methods§

Source

fn exchange_authorization_code<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, authorization_code: &'life1 str, redirect_uri: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<OAuth2TokenResponse, LinkyApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Exchange OAuth2 authorization code for access token + refresh token

Source

fn refresh_access_token<'life0, 'life1, 'async_trait>( &'life0 self, refresh_token: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<OAuth2TokenResponse, LinkyApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Refresh OAuth2 access token using refresh token

Source

fn get_daily_consumption<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, prm: &'life1 str, access_token: &'life2 str, start_date: DateTime<Utc>, end_date: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<ConsumptionDataPoint>, LinkyApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get daily electricity consumption (30-minute granularity) Returns consumption data for each day in the range

Source

fn get_monthly_consumption<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, prm: &'life1 str, access_token: &'life2 str, start_date: DateTime<Utc>, end_date: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<ConsumptionDataPoint>, LinkyApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get monthly electricity consumption (aggregated by month)

Source

fn get_consumption_load_curve<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, prm: &'life1 str, access_token: &'life2 str, start_date: DateTime<Utc>, end_date: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<ConsumptionDataPoint>, LinkyApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get consumption load curve (granularity: 30 minutes) High-frequency data for detailed analysis

Source

fn get_max_power<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, prm: &'life1 str, access_token: &'life2 str, start_date: DateTime<Utc>, end_date: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<PowerDataPoint>, LinkyApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get maximum power draw (kW) over a period

Implementors§