Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated files #26

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!-- Code generated for API Clients. DO NOT EDIT. -->

## 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.

Expand Down
29 changes: 29 additions & 0 deletions src/clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<types::Endpoint, Error> {
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(
Expand Down Expand Up @@ -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<types::Endpoint, Error> {
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::<Option<()>>,
)
.await
}
}
}

Expand Down
41 changes: 38 additions & 3 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Ref>,
pub principal: Option<Ref>,
/// The traffic policy attached to this endpoint
pub traffic_policy: String,
/// the bindings associated with this endpoint
Expand All @@ -1868,6 +1868,8 @@ pub struct Endpoint {
pub tunnel_session: Option<Ref>,
/// URI of the clep API resource
pub uri: String,
/// user supplied name for the endpoint
pub name: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand All @@ -1880,6 +1882,39 @@ pub struct EndpointList {
pub next_page_uri: Option<String>,
}

#[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<String>,
/// user-supplied metadata of the associated tunnel or edge object
pub metadata: Option<String>,
/// the bindings associated with this endpoint
pub bindings: Option<Vec<String>>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct EndpointUpdate {
/// unique endpoint resource identifier
pub id: String,
/// the url of the endpoint
pub url: Option<String>,
/// The traffic policy attached to this endpoint
pub traffic_policy: Option<String>,
/// user-supplied description of the associated tunnel
pub description: Option<String>,
/// user-supplied metadata of the associated tunnel or edge object
pub metadata: Option<String>,
/// the bindings associated with this endpoint
pub bindings: Option<Vec<String>>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct EventDestinationCreate {
/// Arbitrary user-defined machine-readable data of this Event Destination.
Expand Down Expand Up @@ -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,
}

Expand Down
Loading