Struct CreateMessageParams

Source
pub struct CreateMessageParams {
Show 24 fields pub account_sid: String, pub to: String, pub status_callback: Option<String>, pub application_sid: Option<String>, pub max_price: Option<f64>, pub provide_feedback: Option<bool>, pub attempt: Option<i32>, pub validity_period: Option<i32>, pub force_delivery: Option<bool>, pub content_retention: Option<String>, pub address_retention: Option<String>, pub smart_encoded: Option<bool>, pub persistent_action: Option<Vec<String>>, pub shorten_urls: Option<bool>, pub schedule_type: Option<String>, pub send_at: Option<String>, pub send_as_mms: Option<bool>, pub content_variables: Option<String>, pub risk_check: Option<String>, pub from: Option<String>, pub messaging_service_sid: Option<String>, pub body: Option<String>, pub media_url: Option<Vec<String>>, pub content_sid: Option<String>,
}
Expand description

struct for passing parameters to the method create_message

Fields§

§account_sid: String

The SID of the Account creating the Message resource.

§to: String

The recipient’s phone number in E.164 format (for SMS/MMS) or channel address, e.g. whatsapp:+15552229999.

§status_callback: Option<String>

The URL of the endpoint to which Twilio sends Message status callback requests. URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the messaging_service_sid, Twilio uses this URL instead of the Status Callback URL of the Messaging Service.

§application_sid: Option<String>

The SID of the associated TwiML Application. Message status callback requests are sent to the TwiML App’s message_status_callback URL. Note that the status_callback parameter of a request takes priority over the application_sid parameter; if both are included application_sid is ignored.

§max_price: Option<f64>

[OBSOLETE] This parameter will no longer have any effect as of 2024-06-03.

§provide_feedback: Option<bool>

Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the Message Feedback subresource). Default value is false.

§attempt: Option<i32>

Total number of attempts made (including this request) to send the message regardless of the provider used

§validity_period: Option<i32>

The maximum length in seconds that the Message can remain in Twilio’s outgoing message queue. If a queued Message exceeds the validity_period, the Message is not sent. Accepted values are integers from 1 to 36000. Default value is 36000. A validity_period greater than 5 is recommended. Learn more about the validity period

§force_delivery: Option<bool>

Reserved

§content_retention: Option<String>§address_retention: Option<String>§smart_encoded: Option<bool>

Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: true or false.

§persistent_action: Option<Vec<String>>

Rich actions for non-SMS/MMS channels. Used for sending location in WhatsApp messages.

§shorten_urls: Option<bool>

For Messaging Services with Link Shortening configured only: A Boolean indicating whether or not Twilio should shorten links in the body of the Message. Default value is false. If true, the messaging_service_sid parameter must also be provided.

§schedule_type: Option<String>§send_at: Option<String>

The time that Twilio will send the message. Must be in ISO 8601 format.

§send_as_mms: Option<bool>

If set to true, Twilio delivers the message as a single MMS message, regardless of the presence of media.

§content_variables: Option<String>

For Content Editor/API only: Key-value pairs of Template variables and their substitution values. content_sid parameter must also be provided. If values are not defined in the content_variables parameter, the Template’s default placeholder values are used.

§risk_check: Option<String>§from: Option<String>

The sender’s Twilio phone number (in E.164 format), alphanumeric sender ID, Wireless SIM, short code, or channel address (e.g., whatsapp:+15554449999). The value of the from parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using messaging_service_sid, this parameter can be empty (Twilio assigns a from value from the Messaging Service’s Sender Pool) or you can provide a specific sender from your Sender Pool.

§messaging_service_sid: Option<String>

The SID of the Messaging Service you want to associate with the Message. When this parameter is provided and the from parameter is omitted, Twilio selects the optimal sender from the Messaging Service’s Sender Pool. You may also provide a from parameter if you want to use a specific Sender from the Sender Pool.

§body: Option<String>

The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the body contains more than 160 GSM-7 characters (or 70 UCS-2 characters), the message is segmented and charged accordingly. For long body text, consider using the send_as_mms parameter.

§media_url: Option<Vec<String>>

The URL of media to include in the Message content. jpeg, jpg, gif, and png file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (jpeg, jpg, png, gif) and 500 KB for other types of accepted media. To send more than one image in the message, provide multiple media_url parameters in the POST request. You can include up to ten media_url parameters per message. International and carrier limits apply.

§content_sid: Option<String>

For Content Editor/API only: The SID of the Content Template to be used with the Message, e.g., HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio’s response when creating the Template or by fetching your Templates.

Trait Implementations§

Source§

impl Clone for CreateMessageParams

Source§

fn clone(&self) -> CreateMessageParams

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CreateMessageParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,