Skip to content

Commit

Permalink
add endpoint query param
Browse files Browse the repository at this point in the history
  • Loading branch information
jfullerton44 committed Jan 29, 2024
1 parent 1122326 commit 76b489c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rs/src/management/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ impl TunnelManagementClient {
ENDPOINTS_API_SUB_PATH, endpoint.base.id
)),
);
options.connection_mode = endpoint.base.connection_mode;
let mut request = self.make_tunnel_request(Method::PUT, url, options).await?;
json_body(&mut request, endpoint);
self.execute_json("update_tunnel_relay_endpoints", request)
Expand Down Expand Up @@ -651,6 +652,10 @@ fn add_query(url: &mut Url, tunnel_opts: &TunnelRequestOptions, api_version: &st
url.query_pairs_mut().append_pair("allLabels", "true");
}
}
if tunnel_opts.connection_mode.is_empty() {
url.query_pairs_mut()
.append_pair("connectionMode", &tunnel_opts.connection_mode);
}
url.query_pairs_mut()
.append_pair("api-version", api_version);
if tunnel_opts.limit > 0 {
Expand Down
5 changes: 5 additions & 0 deletions rs/src/management/tunnel_request_options.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use reqwest::header::{HeaderName, HeaderValue};

use crate::contracts::TunnelConnectionMode;

use super::Authorization;

#[derive(Default, Clone)]
Expand Down Expand Up @@ -50,6 +52,9 @@ pub struct TunnelRequestOptions {

/// Limits the number of tunnels returned when searching or listing tunnels.
pub limit: u32,

/// Gets or sets the connection mode of the endpoint.
pub connection_mode: TunnelConnectionMode,
}

pub const NO_REQUEST_OPTIONS: &TunnelRequestOptions = &TunnelRequestOptions {
Expand Down

0 comments on commit 76b489c

Please sign in to comment.