From 2fdd8f65dab4b8c42f1c112a8b2d13c9b98f0417 Mon Sep 17 00:00:00 2001 From: ngrok release bot Date: Thu, 24 Oct 2024 15:28:19 +0000 Subject: [PATCH] Update generated files --- CHANGELOG.md | 2 +- src/clients.rs | 29 +++++++++++++++++++++++++++++ src/types.rs | 41 ++++++++++++++++++++++++++++++++++++++--- 3 files changed, 68 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 326be99..0ede2dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ ## 0.5.0 - * Added support for Cloud Endpoints (currently in private beta). + ## 0.4.0 * Renamed the Policy Module to the Traffic Policy Module on HTTP Edge Routes, TCP Edges, and TLS Edges, which allows you to configure rules that can be used to influence and control traffic to and from your upstream service. The Traffic Policy itself is now specified as either a JSON or YAML string. diff --git a/src/clients.rs b/src/clients.rs index 4493513..25ff083 100644 --- a/src/clients.rs +++ b/src/clients.rs @@ -1298,6 +1298,13 @@ pub mod endpoints { Self { c } } + /// Create an endpoint, currently available only for cloud endpoints + pub async fn create(&self, req: &types::EndpointCreate) -> Result { + self.c + .make_request("/endpoints", reqwest::Method::POST, Some(req)) + .await + } + /// Get a single page without pagination. Prefer using list /// which will do pagination for you. pub(crate) async fn list_page( @@ -1327,6 +1334,28 @@ pub mod endpoints { ) .await } + + /// Update an Endpoint by ID, currently available only for cloud endpoints + pub async fn update(&self, req: &types::EndpointUpdate) -> Result { + self.c + .make_request( + &format!("/endpoints/{id}", id = req.id), + reqwest::Method::PATCH, + Some(req), + ) + .await + } + + /// Delete an Endpoint by ID, currently available only for cloud endpoints + pub async fn delete(&self, id: &str) -> Result<(), Error> { + self.c + .make_request( + &format!("/endpoints/{id}", id = id), + reqwest::Method::DELETE, + None::>, + ) + .await + } } } diff --git a/src/types.rs b/src/types.rs index 687d44d..593c436 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1859,7 +1859,7 @@ pub struct Endpoint { /// the url of the endpoint pub url: String, /// The ID of the owner (bot or user) that owns this endpoint - pub principal_id: Option, + pub principal: Option, /// The traffic policy attached to this endpoint pub traffic_policy: String, /// the bindings associated with this endpoint @@ -1868,6 +1868,8 @@ pub struct Endpoint { pub tunnel_session: Option, /// URI of the clep API resource pub uri: String, + /// user supplied name for the endpoint + pub name: String, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1880,6 +1882,39 @@ pub struct EndpointList { pub next_page_uri: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct EndpointCreate { + /// the url of the endpoint + pub url: String, + /// whether the endpoint is `ephemeral` (served directly by an agent-initiated + /// tunnel) or `edge` (served by an edge) or `cloud (represents a cloud endpoint)` + pub r#type: String, + /// The traffic policy attached to this endpoint + pub traffic_policy: String, + /// user-supplied description of the associated tunnel + pub description: Option, + /// user-supplied metadata of the associated tunnel or edge object + pub metadata: Option, + /// the bindings associated with this endpoint + pub bindings: Option>, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct EndpointUpdate { + /// unique endpoint resource identifier + pub id: String, + /// the url of the endpoint + pub url: Option, + /// The traffic policy attached to this endpoint + pub traffic_policy: Option, + /// user-supplied description of the associated tunnel + pub description: Option, + /// user-supplied metadata of the associated tunnel or edge object + pub metadata: Option, + /// the bindings associated with this endpoint + pub bindings: Option>, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct EventDestinationCreate { /// Arbitrary user-defined machine-readable data of this Event Destination. @@ -2483,8 +2518,8 @@ pub struct ReservedDomainCertPolicy { /// certificate authority to request certificates from. The only supported value is /// letsencrypt. pub authority: String, - /// type of private key to use when requesting certificates. Defaults to rsa, can be - /// either rsa or ecdsa. + /// type of private key to use when requesting certificates. Defaults to ecdsa, can + /// be either rsa or ecdsa. pub private_key_type: String, }