pub struct SendTextMessage { /* private fields */ }Expand description
Fluent builder constructing a request to SendTextMessage.
Creates a new text message and sends it to a recipient's phone number.
SMS throughput limits are measured in Message Parts per Second (MPS). Your MPS limit depends on the destination country of your messages, as well as the type of phone number (origination number) that you use to send the message. For more information, see Message Parts per Second (MPS) limits in the Amazon Pinpoint User Guide.
Implementations
sourceimpl SendTextMessage
impl SendTextMessage
sourcepub async fn send(
self
) -> Result<SendTextMessageOutput, SdkError<SendTextMessageError>>
pub async fn send(
self
) -> Result<SendTextMessageOutput, SdkError<SendTextMessageError>>
Sends the request and returns the response.
If an error occurs, an SdkError will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn destination_phone_number(self, input: impl Into<String>) -> Self
pub fn destination_phone_number(self, input: impl Into<String>) -> Self
The destination phone number in E.164 format.
sourcepub fn set_destination_phone_number(self, input: Option<String>) -> Self
pub fn set_destination_phone_number(self, input: Option<String>) -> Self
The destination phone number in E.164 format.
sourcepub fn origination_identity(self, input: impl Into<String>) -> Self
pub fn origination_identity(self, input: impl Into<String>) -> Self
The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn.
sourcepub fn set_origination_identity(self, input: Option<String>) -> Self
pub fn set_origination_identity(self, input: Option<String>) -> Self
The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn.
sourcepub fn message_body(self, input: impl Into<String>) -> Self
pub fn message_body(self, input: impl Into<String>) -> Self
The body of the text message.
sourcepub fn set_message_body(self, input: Option<String>) -> Self
pub fn set_message_body(self, input: Option<String>) -> Self
The body of the text message.
sourcepub fn message_type(self, input: MessageType) -> Self
pub fn message_type(self, input: MessageType) -> Self
The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.
sourcepub fn set_message_type(self, input: Option<MessageType>) -> Self
pub fn set_message_type(self, input: Option<MessageType>) -> Self
The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.
sourcepub fn keyword(self, input: impl Into<String>) -> Self
pub fn keyword(self, input: impl Into<String>) -> Self
When you register a short code in the US, you must specify a program name. If you don’t have a US short code, omit this attribute.
sourcepub fn set_keyword(self, input: Option<String>) -> Self
pub fn set_keyword(self, input: Option<String>) -> Self
When you register a short code in the US, you must specify a program name. If you don’t have a US short code, omit this attribute.
sourcepub fn configuration_set_name(self, input: impl Into<String>) -> Self
pub fn configuration_set_name(self, input: impl Into<String>) -> Self
The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.
sourcepub fn set_configuration_set_name(self, input: Option<String>) -> Self
pub fn set_configuration_set_name(self, input: Option<String>) -> Self
The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.
sourcepub fn max_price(self, input: impl Into<String>) -> Self
pub fn max_price(self, input: impl Into<String>) -> Self
The maximum amount that you want to spend, in US dollars, per each text message part. A text message can contain multiple parts.
sourcepub fn set_max_price(self, input: Option<String>) -> Self
pub fn set_max_price(self, input: Option<String>) -> Self
The maximum amount that you want to spend, in US dollars, per each text message part. A text message can contain multiple parts.
sourcepub fn time_to_live(self, input: i32) -> Self
pub fn time_to_live(self, input: i32) -> Self
How long the text message is valid for. By default this is 72 hours.
sourcepub fn set_time_to_live(self, input: Option<i32>) -> Self
pub fn set_time_to_live(self, input: Option<i32>) -> Self
How long the text message is valid for. By default this is 72 hours.
sourcepub fn context(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn context(self, k: impl Into<String>, v: impl Into<String>) -> Self
Adds a key-value pair to Context.
To override the contents of this collection use set_context.
You can specify custom data in this field. If you do, that data is logged to the event destination.
sourcepub fn set_context(self, input: Option<HashMap<String, String>>) -> Self
pub fn set_context(self, input: Option<HashMap<String, String>>) -> Self
You can specify custom data in this field. If you do, that data is logged to the event destination.
sourcepub fn destination_country_parameters(
self,
k: DestinationCountryParameterKey,
v: impl Into<String>
) -> Self
pub fn destination_country_parameters(
self,
k: DestinationCountryParameterKey,
v: impl Into<String>
) -> Self
Adds a key-value pair to DestinationCountryParameters.
To override the contents of this collection use set_destination_country_parameters.
This field is used for any country-specific registration requirements. Currently, this setting is only used when you send messages to recipients in India using a sender ID. For more information see Special requirements for sending SMS messages to recipients in India.
sourcepub fn set_destination_country_parameters(
self,
input: Option<HashMap<DestinationCountryParameterKey, String>>
) -> Self
pub fn set_destination_country_parameters(
self,
input: Option<HashMap<DestinationCountryParameterKey, String>>
) -> Self
This field is used for any country-specific registration requirements. Currently, this setting is only used when you send messages to recipients in India using a sender ID. For more information see Special requirements for sending SMS messages to recipients in India.
sourcepub fn dry_run(self, input: bool) -> Self
pub fn dry_run(self, input: bool) -> Self
When set to true, the message is checked and validated, but isn't sent to the end recipient.
sourcepub fn set_dry_run(self, input: Option<bool>) -> Self
pub fn set_dry_run(self, input: Option<bool>) -> Self
When set to true, the message is checked and validated, but isn't sent to the end recipient.
Trait Implementations
sourceimpl Clone for SendTextMessage
impl Clone for SendTextMessage
sourcefn clone(&self) -> SendTextMessage
fn clone(&self) -> SendTextMessage
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl !RefUnwindSafe for SendTextMessage
impl Send for SendTextMessage
impl Sync for SendTextMessage
impl Unpin for SendTextMessage
impl !UnwindSafe for SendTextMessage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more