twilio/twiml/redirect.rs
1use super::{format_xml_string, Action, Method};
2
3pub struct Redirect {
4 pub url: String,
5 pub method: Method,
6}
7
8impl Action for Redirect {
9 fn as_twiml(&self) -> String {
10 let method_str = match self.method {
11 Method::Get => "GET",
12 Method::Post => "POST",
13 };
14 format_xml_string("Redirect", &vec![("method", method_str)], &self.url)
15 }
16}