[−][src]Struct azure_functions::bindings::TwilioSmsMessage
Represents the Twilio SMS message output binding.
The following binding attributes are supported:
Name | Description |
---|---|
name | The name of the parameter being bound. |
account_sid | The name of an app setting that holds your Twilio Account SID. If not set, the default app setting name is "AzureWebJobsTwilioAccountSid". |
auth_token | The name of an app setting that holds your Twilio authentication token. If not set, the default app setting name is "AzureWebJobsTwilioAuthToken". |
from | The default phone number that the SMS text is sent from. |
body | The default SMS message body to use. |
Examples
An example HTTP-triggered function that outputs a Twilio SMS message:
use azure_functions::{ bindings::{HttpRequest, HttpResponse, TwilioSmsMessage}, func, }; use std::borrow::ToOwned; #[func] #[binding(name = "output1", from = "+15555555555")] pub fn send_sms(req: HttpRequest) -> (HttpResponse, TwilioSmsMessage) { let params = req.query_params(); ( "Text message sent.".into(), TwilioSmsMessage { to: params.get("to").unwrap().to_owned(), body: params.get("body").map(ToOwned::to_owned), ..Default::default() }, ) }
Fields
to: String
The phone number to send the SMS message to.
from: Option<String>
The optional phone number to send the SMS message from. If None, the from
binding attribute is used.
body: Option<String>
The optional SMS message body. If None, the body
binding attribute is used.
Trait Implementations
impl Clone for TwilioSmsMessage
[src]
fn clone(&self) -> TwilioSmsMessage
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for TwilioSmsMessage
[src]
fn default() -> TwilioSmsMessage
[src]
impl Debug for TwilioSmsMessage
[src]
impl Serialize for TwilioSmsMessage
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for TwilioSmsMessage
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for TwilioSmsMessage
impl Sync for TwilioSmsMessage
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,