provident 0.3.1

Unofficial client for the Provident (MeterConnex) utility metering portal: meters, usage history, and reports
Documentation
// SPDX-License-Identifier: GPL-3.0-only

use crate::http::Request;
use crate::models::api::internal::graphs::quick_graphs::{
    self, QuickGraphsRequest, QuickGraphsResponse,
};

use super::Usage;
use crate::Result;

impl Usage {
    /// Consumption time series (`quickgraphs`): one series per utility, hourly for ranges of up
    /// to 7 days and daily beyond. Empty when no requested meter matched. Hour buckets are not
    /// uniformly local time across utilities; see
    /// [`crate::models::api::internal::graphs::quick_graphs`].
    #[maybe_async::maybe_async]
    pub async fn series(&self, query: &QuickGraphsRequest) -> Result<QuickGraphsResponse> {
        let request = Request::get(quick_graphs::PATH).query(query)?.build();
        Ok(self.http.send::<QuickGraphsResponse>(request).await?)
    }
}