From 4c1e6367cc92c1d3134200eb97e64d04bd318e92 Mon Sep 17 00:00:00 2001 From: Rishabh Bector Date: Tue, 29 Jun 2021 11:24:12 -0500 Subject: [PATCH] TUN-4644: Add tunnel metadata field to cloudflare-rs (#155) Co-authored-by: Rishabh Bector --- cloudflare/src/endpoints/argo_tunnel/create_tunnel.rs | 3 +++ cloudflare/src/endpoints/argo_tunnel/data_structures.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/cloudflare/src/endpoints/argo_tunnel/create_tunnel.rs b/cloudflare/src/endpoints/argo_tunnel/create_tunnel.rs index 6260f9dc..aa5e4aca 100644 --- a/cloudflare/src/endpoints/argo_tunnel/create_tunnel.rs +++ b/cloudflare/src/endpoints/argo_tunnel/create_tunnel.rs @@ -26,6 +26,7 @@ impl<'a> Endpoint> for CreateTunnel<'a> { } /// Params for creating a Named Argo Tunnel +#[serde_with::skip_serializing_none] #[derive(Serialize, Clone, Debug)] pub struct Params<'a> { /// The name for the Tunnel to be created. It must be unique within the account. @@ -34,4 +35,6 @@ pub struct Params<'a> { /// encoded into JSON as a base64 String. This secret is necessary to run the tunnel. #[serde(serialize_with = "serialize_base64_str")] pub tunnel_secret: &'a Vec, + /// Arbitrary metadata for the tunnel. + pub metadata: Option, } diff --git a/cloudflare/src/endpoints/argo_tunnel/data_structures.rs b/cloudflare/src/endpoints/argo_tunnel/data_structures.rs index 63593fad..70187739 100644 --- a/cloudflare/src/endpoints/argo_tunnel/data_structures.rs +++ b/cloudflare/src/endpoints/argo_tunnel/data_structures.rs @@ -13,6 +13,7 @@ pub struct Tunnel { pub deleted_at: Option>, pub name: String, pub connections: Vec, + pub metadata: serde_json::Value, } /// An active connection for a Named Argo Tunnel.