cloudflare/endpoints/argo_tunnel/
route_dns.rs1use surf::http::Method;
2use uuid::Uuid;
3
4use super::RouteResult;
5use crate::framework::endpoint::Endpoint;
6
7#[derive(Debug)]
13pub struct RouteTunnel<'a> {
14 pub zone_tag: &'a str,
15 pub tunnel_id: Uuid,
16 pub params: Params<'a>,
17}
18
19impl<'a> Endpoint<RouteResult, (), Params<'a>> for RouteTunnel<'a> {
20 fn method(&self) -> Method {
21 Method::Put
22 }
23 fn path(&self) -> String {
24 format!("zones/{}/tunnels/{}/routes", self.zone_tag, self.tunnel_id)
25 }
26 fn body(&self) -> Option<Params<'a>> {
27 Some(self.params.clone())
28 }
29}
30
31#[derive(Serialize, Clone, Debug)]
33#[serde(tag = "type", rename_all = "lowercase")]
34pub enum Params<'a> {
35 Dns { user_hostname: &'a str },
36 Lb { lb_name: &'a str, lb_pool: &'a str },
37}