From dc072f4c33c6731d661273f9ac3da1edd26f41bd Mon Sep 17 00:00:00 2001 From: felixm Date: Tue, 28 Jan 2025 21:39:50 -0500 Subject: [PATCH] Add Deserialize to Create and Update datapoints --- src/types.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/types.rs b/src/types.rs index 3aefada..33b5476 100644 --- a/src/types.rs +++ b/src/types.rs @@ -119,7 +119,7 @@ pub struct Datapoint { /// Parameters for creating or updating a datapoint #[must_use] -#[derive(Debug, Clone, Serialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreateDatapoint { /// The value to record pub value: f64, @@ -172,10 +172,9 @@ impl CreateDatapoint { } /// Parameters for updating an existing datapoint -#[derive(Debug, Clone, Serialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct UpdateDatapoint { /// ID of the datapoint to update - #[serde(skip_serializing)] pub id: String, /// Optional new timestamp for the datapoint #[serde(