hevy 0.1.0

An async Rust client library for the Hevy public API (https://api.hevyapp.com/docs/)
Documentation
use crate::client::HevyClient;
use crate::error::Result;
use crate::models::ExerciseHistoryEntry;
use crate::models::ExerciseHistoryEnvelope;

impl HevyClient {
    /// Gets exercise history for a specific exercise template.
    ///
    /// `start_date` and `end_date` are optional ISO 8601 timestamps used to
    /// filter the returned entries.
    pub async fn exercise_history(
        &self,
        exercise_template_id: &str,
        start_date: Option<&str>,
        end_date: Option<&str>,
    ) -> Result<Vec<ExerciseHistoryEntry>> {
        let envelope: ExerciseHistoryEnvelope = self
            .get(
                &format!("/v1/exercise_history/{exercise_template_id}"),
                &[
                    ("start_date", start_date.map(|s| s.to_string())),
                    ("end_date", end_date.map(|s| s.to_string())),
                ],
            )
            .await?;
        Ok(envelope.exercise_history)
    }
}