Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jfullerton44 committed Oct 12, 2023
1 parent fe30bce commit eb89a0e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions rs/src/management/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ impl TunnelManagementClient {
url.query_pairs_mut().append_pair("global", "true");

let request = self.make_tunnel_request(Method::GET, url, options).await?;
let response: TunnelListByRegionResponse = self.execute_json("list_all_tunnels", request).await?;
let response: TunnelListByRegionResponse =
self.execute_json("list_all_tunnels", request).await?;
Ok(response.value.into_iter().flat_map(|v| v.value).collect())
}

Expand Down Expand Up @@ -100,12 +101,12 @@ impl TunnelManagementClient {
mut tunnel: Tunnel,
options: &TunnelRequestOptions,
) -> HttpResult<Tunnel> {
let mut url = self.build_uri(tunnel.cluster_id.as_deref(), TUNNELS_API_PATH);
let tunnel_id = match tunnel.tunnel_id.as_ref() {
None | Some("") => TunnelManagementClient::generate_tunnel_id(),
Some(tunnel_id) => tunnel_id.to_owned(),
tunnel.tunnel_id = match tunnel.tunnel_id {
None => Some(TunnelManagementClient::generate_tunnel_id().to_owned()),
Some(tunnel_id) => Some(tunnel_id.to_owned()),
};
let new_path = url.path().to_owned() + "/" + tunnel_id;
let mut url = self.build_uri(tunnel.cluster_id.as_deref(), TUNNELS_API_PATH);
let new_path = url.path().to_owned() + "/" + tunnel.tunnel_id.to_owned().unwrap().as_str();
url.set_path(&new_path);
let mut request = self.make_tunnel_request(Method::PUT, url, options).await?;
json_body(&mut request, tunnel);
Expand Down Expand Up @@ -220,7 +221,9 @@ impl TunnelManagementClient {
) -> HttpResult<Vec<TunnelPort>> {
let url = self.build_tunnel_uri(locator, Some(PORTS_API_SUB_PATH));
let request = self.make_tunnel_request(Method::GET, url, options).await?;
self.execute_json("list_tunnel_ports", request).await.map(|r| r.value)
self.execute_json("list_tunnel_ports", request)
.await
.map(|r: TunnelPortListResponse| r.value)
}

/// Gets info about a specific tunnel port.
Expand Down

0 comments on commit eb89a0e

Please sign in to comment.