use super::Tunnel;
use crate::framework::endpoint::{EndpointSpec, Method};
use crate::framework::response::ApiSuccess;
#[derive(Debug)]
pub struct DeleteTunnel<'a> {
pub account_identifier: &'a str,
pub tunnel_id: &'a str,
pub cascade: bool,
}
impl EndpointSpec for DeleteTunnel<'_> {
type JsonResponse = Tunnel;
type ResponseType = ApiSuccess<Self::JsonResponse>;
fn method(&self) -> Method {
Method::DELETE
}
fn path(&self) -> String {
format!(
"accounts/{}/tunnels/{}?cascade={}",
self.account_identifier, self.tunnel_id, self.cascade
)
}
}