hevy 0.1.0

An async Rust client library for the Hevy public API (https://api.hevyapp.com/docs/)
Documentation
use serde::{Deserialize, Serialize};

/// A single historical set entry for a specific exercise template, as returned
/// by [`crate::HevyClient::exercise_history`].
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ExerciseHistoryEntry {
    /// The workout ID this entry belongs to.
    #[serde(default)]
    pub workout_id: String,
    /// The workout title.
    #[serde(default)]
    pub workout_title: String,
    /// ISO 8601 timestamp of when the workout was recorded to have started.
    #[serde(default)]
    pub workout_start_time: String,
    /// ISO 8601 timestamp of when the workout was recorded to have ended.
    #[serde(default)]
    pub workout_end_time: String,
    /// The exercise template ID.
    #[serde(default)]
    pub exercise_template_id: String,
    /// The weight in kilograms.
    #[serde(default)]
    pub weight_kg: Option<f64>,
    /// The number of repetitions.
    #[serde(default)]
    pub reps: Option<f64>,
    /// The distance in meters.
    #[serde(default)]
    pub distance_meters: Option<f64>,
    /// The duration in seconds.
    #[serde(default)]
    pub duration_seconds: Option<f64>,
    /// The Rating of Perceived Exertion.
    #[serde(default)]
    pub rpe: Option<f64>,
    /// A custom metric for the set.
    #[serde(default)]
    pub custom_metric: Option<f64>,
    /// The type of set (`warmup`, `normal`, `failure`, `dropset`).
    #[serde(default)]
    pub set_type: String,
}

/// Envelope for the response returned by `GET /v1/exercise_history/{exerciseTemplateId}`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub(crate) struct ExerciseHistoryEnvelope {
    #[serde(default)]
    pub exercise_history: Vec<ExerciseHistoryEntry>,
}