Skip to content

Commit 9350130

Browse files
authored
Merge pull request #28 from ngrok/pr/generated-28f6e441d3
Update generated files
2 parents a10b926 + c716221 commit 9350130

File tree

4 files changed

+73
-5
lines changed

4 files changed

+73
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<!-- Code generated for API Clients. DO NOT EDIT. -->
22

3-
## 0.5.0
4-
3+
## 0.6.0
54
* Added support for Cloud Endpoints (currently in private beta).
65

6+
## 0.5.0
7+
* Added `principal` for `endpoint` resources
8+
79
## 0.4.0
810
* 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.
911

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ngrok-api"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
edition = "2021"
55
license = "MIT"
66
description = "ngrok API client library for Rust"

src/clients.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,13 @@ pub mod endpoints {
12981298
Self { c }
12991299
}
13001300

1301+
/// Create an endpoint, currently available only for cloud endpoints
1302+
pub async fn create(&self, req: &types::EndpointCreate) -> Result<types::Endpoint, Error> {
1303+
self.c
1304+
.make_request("/endpoints", reqwest::Method::POST, Some(req))
1305+
.await
1306+
}
1307+
13011308
/// Get a single page without pagination. Prefer using list
13021309
/// which will do pagination for you.
13031310
pub(crate) async fn list_page(
@@ -1327,6 +1334,28 @@ pub mod endpoints {
13271334
)
13281335
.await
13291336
}
1337+
1338+
/// Update an Endpoint by ID, currently available only for cloud endpoints
1339+
pub async fn update(&self, req: &types::EndpointUpdate) -> Result<types::Endpoint, Error> {
1340+
self.c
1341+
.make_request(
1342+
&format!("/endpoints/{id}", id = req.id),
1343+
reqwest::Method::PATCH,
1344+
Some(req),
1345+
)
1346+
.await
1347+
}
1348+
1349+
/// Delete an Endpoint by ID, currently available only for cloud endpoints
1350+
pub async fn delete(&self, id: &str) -> Result<(), Error> {
1351+
self.c
1352+
.make_request(
1353+
&format!("/endpoints/{id}", id = id),
1354+
reqwest::Method::DELETE,
1355+
None::<Option<()>>,
1356+
)
1357+
.await
1358+
}
13301359
}
13311360
}
13321361

src/types.rs

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,6 +1859,8 @@ pub struct Endpoint {
18591859
/// the url of the endpoint
18601860
pub url: String,
18611861
/// The ID of the owner (bot or user) that owns this endpoint
1862+
pub principal: Option<Ref>,
1863+
/// TODO: deprecate me!
18621864
pub principal_id: Option<Ref>,
18631865
/// The traffic policy attached to this endpoint
18641866
pub traffic_policy: String,
@@ -1868,6 +1870,8 @@ pub struct Endpoint {
18681870
pub tunnel_session: Option<Ref>,
18691871
/// URI of the clep API resource
18701872
pub uri: String,
1873+
/// user supplied name for the endpoint
1874+
pub name: String,
18711875
}
18721876

18731877
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
@@ -1880,6 +1884,39 @@ pub struct EndpointList {
18801884
pub next_page_uri: Option<String>,
18811885
}
18821886

1887+
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1888+
pub struct EndpointCreate {
1889+
/// the url of the endpoint
1890+
pub url: String,
1891+
/// whether the endpoint is `ephemeral` (served directly by an agent-initiated
1892+
/// tunnel) or `edge` (served by an edge) or `cloud (represents a cloud endpoint)`
1893+
pub r#type: String,
1894+
/// The traffic policy attached to this endpoint
1895+
pub traffic_policy: String,
1896+
/// user-supplied description of the associated tunnel
1897+
pub description: Option<String>,
1898+
/// user-supplied metadata of the associated tunnel or edge object
1899+
pub metadata: Option<String>,
1900+
/// the bindings associated with this endpoint
1901+
pub bindings: Option<Vec<String>>,
1902+
}
1903+
1904+
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1905+
pub struct EndpointUpdate {
1906+
/// unique endpoint resource identifier
1907+
pub id: String,
1908+
/// the url of the endpoint
1909+
pub url: Option<String>,
1910+
/// The traffic policy attached to this endpoint
1911+
pub traffic_policy: Option<String>,
1912+
/// user-supplied description of the associated tunnel
1913+
pub description: Option<String>,
1914+
/// user-supplied metadata of the associated tunnel or edge object
1915+
pub metadata: Option<String>,
1916+
/// the bindings associated with this endpoint
1917+
pub bindings: Option<Vec<String>>,
1918+
}
1919+
18831920
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
18841921
pub struct EventDestinationCreate {
18851922
/// Arbitrary user-defined machine-readable data of this Event Destination.
@@ -2483,8 +2520,8 @@ pub struct ReservedDomainCertPolicy {
24832520
/// certificate authority to request certificates from. The only supported value is
24842521
/// letsencrypt.
24852522
pub authority: String,
2486-
/// type of private key to use when requesting certificates. Defaults to rsa, can be
2487-
/// either rsa or ecdsa.
2523+
/// type of private key to use when requesting certificates. Defaults to ecdsa, can
2524+
/// be either rsa or ecdsa.
24882525
pub private_key_type: String,
24892526
}
24902527

0 commit comments

Comments
 (0)