aws_sdk_sns/operation/publish/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::publish::_publish_output::PublishOutputBuilder;
3
4pub use crate::operation::publish::_publish_input::PublishInputBuilder;
5
6impl crate::operation::publish::builders::PublishInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::publish::PublishOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::publish::PublishError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.publish();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `Publish`.
24///
25/// <p>Sends a message to an Amazon SNS topic, a text message (SMS message) directly to a phone number, or a message to a mobile platform endpoint (when you specify the <code>TargetArn</code>).</p>
26/// <p>If you send a message to a topic, Amazon SNS delivers the message to each endpoint that is subscribed to the topic. The format of the message depends on the notification protocol for each subscribed endpoint.</p>
27/// <p>When a <code>messageId</code> is returned, the message is saved and Amazon SNS immediately delivers it to subscribers.</p>
28/// <p>To use the <code>Publish</code> action for publishing a message to a mobile endpoint, such as an app on a Kindle device or mobile phone, you must specify the EndpointArn for the TargetArn parameter. The EndpointArn is returned when making a call with the <code>CreatePlatformEndpoint</code> action.</p>
29/// <p>For more information about formatting messages, see <a href="https://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-custommessage.html">Send Custom Platform-Specific Payloads in Messages to Mobile Devices</a>.</p><important>
30/// <p>You can publish messages only to topics and endpoints in the same Amazon Web Services Region.</p>
31/// </important>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct PublishFluentBuilder {
34 handle: ::std::sync::Arc<crate::client::Handle>,
35 inner: crate::operation::publish::builders::PublishInputBuilder,
36 config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl crate::client::customize::internal::CustomizableSend<crate::operation::publish::PublishOutput, crate::operation::publish::PublishError>
39 for PublishFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<crate::operation::publish::PublishOutput, crate::operation::publish::PublishError>,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl PublishFluentBuilder {
51 /// Creates a new `PublishFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the Publish as a reference.
60 pub fn as_input(&self) -> &crate::operation::publish::builders::PublishInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::publish::PublishOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::publish::PublishError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::publish::Publish::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::publish::Publish::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<crate::operation::publish::PublishOutput, crate::operation::publish::PublishError, Self>
96 {
97 crate::client::customize::CustomizableOperation::new(self)
98 }
99 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
100 self.set_config_override(::std::option::Option::Some(config_override.into()));
101 self
102 }
103
104 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
105 self.config_override = config_override;
106 self
107 }
108 /// <p>The topic you want to publish to.</p>
109 /// <p>If you don't specify a value for the <code>TopicArn</code> parameter, you must specify a value for the <code>PhoneNumber</code> or <code>TargetArn</code> parameters.</p>
110 pub fn topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111 self.inner = self.inner.topic_arn(input.into());
112 self
113 }
114 /// <p>The topic you want to publish to.</p>
115 /// <p>If you don't specify a value for the <code>TopicArn</code> parameter, you must specify a value for the <code>PhoneNumber</code> or <code>TargetArn</code> parameters.</p>
116 pub fn set_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117 self.inner = self.inner.set_topic_arn(input);
118 self
119 }
120 /// <p>The topic you want to publish to.</p>
121 /// <p>If you don't specify a value for the <code>TopicArn</code> parameter, you must specify a value for the <code>PhoneNumber</code> or <code>TargetArn</code> parameters.</p>
122 pub fn get_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_topic_arn()
124 }
125 /// <p>If you don't specify a value for the <code>TargetArn</code> parameter, you must specify a value for the <code>PhoneNumber</code> or <code>TopicArn</code> parameters.</p>
126 pub fn target_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.inner = self.inner.target_arn(input.into());
128 self
129 }
130 /// <p>If you don't specify a value for the <code>TargetArn</code> parameter, you must specify a value for the <code>PhoneNumber</code> or <code>TopicArn</code> parameters.</p>
131 pub fn set_target_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.inner = self.inner.set_target_arn(input);
133 self
134 }
135 /// <p>If you don't specify a value for the <code>TargetArn</code> parameter, you must specify a value for the <code>PhoneNumber</code> or <code>TopicArn</code> parameters.</p>
136 pub fn get_target_arn(&self) -> &::std::option::Option<::std::string::String> {
137 self.inner.get_target_arn()
138 }
139 /// <p>The phone number to which you want to deliver an SMS message. Use E.164 format.</p>
140 /// <p>If you don't specify a value for the <code>PhoneNumber</code> parameter, you must specify a value for the <code>TargetArn</code> or <code>TopicArn</code> parameters.</p>
141 pub fn phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142 self.inner = self.inner.phone_number(input.into());
143 self
144 }
145 /// <p>The phone number to which you want to deliver an SMS message. Use E.164 format.</p>
146 /// <p>If you don't specify a value for the <code>PhoneNumber</code> parameter, you must specify a value for the <code>TargetArn</code> or <code>TopicArn</code> parameters.</p>
147 pub fn set_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148 self.inner = self.inner.set_phone_number(input);
149 self
150 }
151 /// <p>The phone number to which you want to deliver an SMS message. Use E.164 format.</p>
152 /// <p>If you don't specify a value for the <code>PhoneNumber</code> parameter, you must specify a value for the <code>TargetArn</code> or <code>TopicArn</code> parameters.</p>
153 pub fn get_phone_number(&self) -> &::std::option::Option<::std::string::String> {
154 self.inner.get_phone_number()
155 }
156 /// <p>The message you want to send.</p>
157 /// <p>If you are publishing to a topic and you want to send the same message to all transport protocols, include the text of the message as a String value. If you want to send different messages for each transport protocol, set the value of the <code>MessageStructure</code> parameter to <code>json</code> and use a JSON object for the <code>Message</code> parameter.</p>
158 /// <p></p>
159 /// <p>Constraints:</p>
160 /// <ul>
161 /// <li>
162 /// <p>With the exception of SMS, messages must be UTF-8 encoded strings and at most 256 KB in size (262,144 bytes, not 262,144 characters).</p></li>
163 /// <li>
164 /// <p>For SMS, each message can contain up to 140 characters. This character limit depends on the encoding schema. For example, an SMS message can contain 160 GSM characters, 140 ASCII characters, or 70 UCS-2 characters.</p>
165 /// <p>If you publish a message that exceeds this size limit, Amazon SNS sends the message as multiple messages, each fitting within the size limit. Messages aren't truncated mid-word but are cut off at whole-word boundaries.</p>
166 /// <p>The total size limit for a single SMS <code>Publish</code> action is 1,600 characters.</p></li>
167 /// </ul>
168 /// <p>JSON-specific constraints:</p>
169 /// <ul>
170 /// <li>
171 /// <p>Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values.</p></li>
172 /// <li>
173 /// <p>The values will be parsed (unescaped) before they are used in outgoing messages.</p></li>
174 /// <li>
175 /// <p>Outbound notifications are JSON encoded (meaning that the characters will be reescaped for sending).</p></li>
176 /// <li>
177 /// <p>Values have a minimum length of 0 (the empty string, "", is allowed).</p></li>
178 /// <li>
179 /// <p>Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes).</p></li>
180 /// <li>
181 /// <p>Non-string values will cause the key to be ignored.</p></li>
182 /// <li>
183 /// <p>Keys that do not correspond to supported transport protocols are ignored.</p></li>
184 /// <li>
185 /// <p>Duplicate keys are not allowed.</p></li>
186 /// <li>
187 /// <p>Failure to parse or validate any key or value in the message will cause the <code>Publish</code> call to return an error (no partial delivery).</p></li>
188 /// </ul>
189 pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190 self.inner = self.inner.message(input.into());
191 self
192 }
193 /// <p>The message you want to send.</p>
194 /// <p>If you are publishing to a topic and you want to send the same message to all transport protocols, include the text of the message as a String value. If you want to send different messages for each transport protocol, set the value of the <code>MessageStructure</code> parameter to <code>json</code> and use a JSON object for the <code>Message</code> parameter.</p>
195 /// <p></p>
196 /// <p>Constraints:</p>
197 /// <ul>
198 /// <li>
199 /// <p>With the exception of SMS, messages must be UTF-8 encoded strings and at most 256 KB in size (262,144 bytes, not 262,144 characters).</p></li>
200 /// <li>
201 /// <p>For SMS, each message can contain up to 140 characters. This character limit depends on the encoding schema. For example, an SMS message can contain 160 GSM characters, 140 ASCII characters, or 70 UCS-2 characters.</p>
202 /// <p>If you publish a message that exceeds this size limit, Amazon SNS sends the message as multiple messages, each fitting within the size limit. Messages aren't truncated mid-word but are cut off at whole-word boundaries.</p>
203 /// <p>The total size limit for a single SMS <code>Publish</code> action is 1,600 characters.</p></li>
204 /// </ul>
205 /// <p>JSON-specific constraints:</p>
206 /// <ul>
207 /// <li>
208 /// <p>Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values.</p></li>
209 /// <li>
210 /// <p>The values will be parsed (unescaped) before they are used in outgoing messages.</p></li>
211 /// <li>
212 /// <p>Outbound notifications are JSON encoded (meaning that the characters will be reescaped for sending).</p></li>
213 /// <li>
214 /// <p>Values have a minimum length of 0 (the empty string, "", is allowed).</p></li>
215 /// <li>
216 /// <p>Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes).</p></li>
217 /// <li>
218 /// <p>Non-string values will cause the key to be ignored.</p></li>
219 /// <li>
220 /// <p>Keys that do not correspond to supported transport protocols are ignored.</p></li>
221 /// <li>
222 /// <p>Duplicate keys are not allowed.</p></li>
223 /// <li>
224 /// <p>Failure to parse or validate any key or value in the message will cause the <code>Publish</code> call to return an error (no partial delivery).</p></li>
225 /// </ul>
226 pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
227 self.inner = self.inner.set_message(input);
228 self
229 }
230 /// <p>The message you want to send.</p>
231 /// <p>If you are publishing to a topic and you want to send the same message to all transport protocols, include the text of the message as a String value. If you want to send different messages for each transport protocol, set the value of the <code>MessageStructure</code> parameter to <code>json</code> and use a JSON object for the <code>Message</code> parameter.</p>
232 /// <p></p>
233 /// <p>Constraints:</p>
234 /// <ul>
235 /// <li>
236 /// <p>With the exception of SMS, messages must be UTF-8 encoded strings and at most 256 KB in size (262,144 bytes, not 262,144 characters).</p></li>
237 /// <li>
238 /// <p>For SMS, each message can contain up to 140 characters. This character limit depends on the encoding schema. For example, an SMS message can contain 160 GSM characters, 140 ASCII characters, or 70 UCS-2 characters.</p>
239 /// <p>If you publish a message that exceeds this size limit, Amazon SNS sends the message as multiple messages, each fitting within the size limit. Messages aren't truncated mid-word but are cut off at whole-word boundaries.</p>
240 /// <p>The total size limit for a single SMS <code>Publish</code> action is 1,600 characters.</p></li>
241 /// </ul>
242 /// <p>JSON-specific constraints:</p>
243 /// <ul>
244 /// <li>
245 /// <p>Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values.</p></li>
246 /// <li>
247 /// <p>The values will be parsed (unescaped) before they are used in outgoing messages.</p></li>
248 /// <li>
249 /// <p>Outbound notifications are JSON encoded (meaning that the characters will be reescaped for sending).</p></li>
250 /// <li>
251 /// <p>Values have a minimum length of 0 (the empty string, "", is allowed).</p></li>
252 /// <li>
253 /// <p>Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes).</p></li>
254 /// <li>
255 /// <p>Non-string values will cause the key to be ignored.</p></li>
256 /// <li>
257 /// <p>Keys that do not correspond to supported transport protocols are ignored.</p></li>
258 /// <li>
259 /// <p>Duplicate keys are not allowed.</p></li>
260 /// <li>
261 /// <p>Failure to parse or validate any key or value in the message will cause the <code>Publish</code> call to return an error (no partial delivery).</p></li>
262 /// </ul>
263 pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
264 self.inner.get_message()
265 }
266 /// <p>Optional parameter to be used as the "Subject" line when the message is delivered to email endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints.</p>
267 /// <p>Constraints: Subjects must be UTF-8 text with no line breaks or control characters, and less than 100 characters long.</p>
268 pub fn subject(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
269 self.inner = self.inner.subject(input.into());
270 self
271 }
272 /// <p>Optional parameter to be used as the "Subject" line when the message is delivered to email endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints.</p>
273 /// <p>Constraints: Subjects must be UTF-8 text with no line breaks or control characters, and less than 100 characters long.</p>
274 pub fn set_subject(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
275 self.inner = self.inner.set_subject(input);
276 self
277 }
278 /// <p>Optional parameter to be used as the "Subject" line when the message is delivered to email endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints.</p>
279 /// <p>Constraints: Subjects must be UTF-8 text with no line breaks or control characters, and less than 100 characters long.</p>
280 pub fn get_subject(&self) -> &::std::option::Option<::std::string::String> {
281 self.inner.get_subject()
282 }
283 /// <p>Set <code>MessageStructure</code> to <code>json</code> if you want to send a different message for each protocol. For example, using one publish action, you can send a short message to your SMS subscribers and a longer message to your email subscribers. If you set <code>MessageStructure</code> to <code>json</code>, the value of the <code>Message</code> parameter must:</p>
284 /// <ul>
285 /// <li>
286 /// <p>be a syntactically valid JSON object; and</p></li>
287 /// <li>
288 /// <p>contain at least a top-level JSON key of "default" with a value that is a string.</p></li>
289 /// </ul>
290 /// <p>You can define other top-level keys that define the message you want to send to a specific transport protocol (e.g., "http").</p>
291 /// <p>Valid value: <code>json</code></p>
292 pub fn message_structure(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
293 self.inner = self.inner.message_structure(input.into());
294 self
295 }
296 /// <p>Set <code>MessageStructure</code> to <code>json</code> if you want to send a different message for each protocol. For example, using one publish action, you can send a short message to your SMS subscribers and a longer message to your email subscribers. If you set <code>MessageStructure</code> to <code>json</code>, the value of the <code>Message</code> parameter must:</p>
297 /// <ul>
298 /// <li>
299 /// <p>be a syntactically valid JSON object; and</p></li>
300 /// <li>
301 /// <p>contain at least a top-level JSON key of "default" with a value that is a string.</p></li>
302 /// </ul>
303 /// <p>You can define other top-level keys that define the message you want to send to a specific transport protocol (e.g., "http").</p>
304 /// <p>Valid value: <code>json</code></p>
305 pub fn set_message_structure(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
306 self.inner = self.inner.set_message_structure(input);
307 self
308 }
309 /// <p>Set <code>MessageStructure</code> to <code>json</code> if you want to send a different message for each protocol. For example, using one publish action, you can send a short message to your SMS subscribers and a longer message to your email subscribers. If you set <code>MessageStructure</code> to <code>json</code>, the value of the <code>Message</code> parameter must:</p>
310 /// <ul>
311 /// <li>
312 /// <p>be a syntactically valid JSON object; and</p></li>
313 /// <li>
314 /// <p>contain at least a top-level JSON key of "default" with a value that is a string.</p></li>
315 /// </ul>
316 /// <p>You can define other top-level keys that define the message you want to send to a specific transport protocol (e.g., "http").</p>
317 /// <p>Valid value: <code>json</code></p>
318 pub fn get_message_structure(&self) -> &::std::option::Option<::std::string::String> {
319 self.inner.get_message_structure()
320 }
321 ///
322 /// Adds a key-value pair to `MessageAttributes`.
323 ///
324 /// To override the contents of this collection use [`set_message_attributes`](Self::set_message_attributes).
325 ///
326 /// <p>Message attributes for Publish action.</p>
327 pub fn message_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::MessageAttributeValue) -> Self {
328 self.inner = self.inner.message_attributes(k.into(), v);
329 self
330 }
331 /// <p>Message attributes for Publish action.</p>
332 pub fn set_message_attributes(
333 mut self,
334 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MessageAttributeValue>>,
335 ) -> Self {
336 self.inner = self.inner.set_message_attributes(input);
337 self
338 }
339 /// <p>Message attributes for Publish action.</p>
340 pub fn get_message_attributes(
341 &self,
342 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MessageAttributeValue>> {
343 self.inner.get_message_attributes()
344 }
345 /// <ul>
346 /// <li>
347 /// <p>This parameter applies only to FIFO (first-in-first-out) topics. The <code>MessageDeduplicationId</code> can contain up to 128 alphanumeric characters <code>(a-z, A-Z, 0-9)</code> and punctuation <code>(!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~)</code>.</p></li>
348 /// <li>
349 /// <p>Every message must have a unique <code>MessageDeduplicationId</code>, which is a token used for deduplication of sent messages within the 5 minute minimum deduplication interval.</p></li>
350 /// <li>
351 /// <p>The scope of deduplication depends on the <code>FifoThroughputScope</code> attribute, when set to <code>Topic</code> the message deduplication scope is across the entire topic, when set to <code>MessageGroup</code> the message deduplication scope is within each individual message group.</p></li>
352 /// <li>
353 /// <p>If a message with a particular <code>MessageDeduplicationId</code> is sent successfully, subsequent messages within the deduplication scope and interval, with the same <code>MessageDeduplicationId</code>, are accepted successfully but aren't delivered.</p></li>
354 /// <li>
355 /// <p>Every message must have a unique <code>MessageDeduplicationId</code>:</p>
356 /// <ul>
357 /// <li>
358 /// <p>You may provide a <code>MessageDeduplicationId</code> explicitly.</p></li>
359 /// <li>
360 /// <p>If you aren't able to provide a <code>MessageDeduplicationId</code> and you enable <code>ContentBasedDeduplication</code> for your topic, Amazon SNS uses a SHA-256 hash to generate the <code>MessageDeduplicationId</code> using the body of the message (but not the attributes of the message).</p></li>
361 /// <li>
362 /// <p>If you don't provide a <code>MessageDeduplicationId</code> and the topic doesn't have <code>ContentBasedDeduplication</code> set, the action fails with an error.</p></li>
363 /// <li>
364 /// <p>If the topic has a <code>ContentBasedDeduplication</code> set, your <code>MessageDeduplicationId</code> overrides the generated one.</p></li>
365 /// </ul></li>
366 /// <li>
367 /// <p>When <code>ContentBasedDeduplication</code> is in effect, messages with identical content sent within the deduplication scope and interval are treated as duplicates and only one copy of the message is delivered.</p></li>
368 /// <li>
369 /// <p>If you send one message with <code>ContentBasedDeduplication</code> enabled, and then another message with a <code>MessageDeduplicationId</code> that is the same as the one generated for the first <code>MessageDeduplicationId</code>, the two messages are treated as duplicates, within the deduplication scope and interval, and only one copy of the message is delivered.</p></li>
370 /// </ul>
371 pub fn message_deduplication_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
372 self.inner = self.inner.message_deduplication_id(input.into());
373 self
374 }
375 /// <ul>
376 /// <li>
377 /// <p>This parameter applies only to FIFO (first-in-first-out) topics. The <code>MessageDeduplicationId</code> can contain up to 128 alphanumeric characters <code>(a-z, A-Z, 0-9)</code> and punctuation <code>(!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~)</code>.</p></li>
378 /// <li>
379 /// <p>Every message must have a unique <code>MessageDeduplicationId</code>, which is a token used for deduplication of sent messages within the 5 minute minimum deduplication interval.</p></li>
380 /// <li>
381 /// <p>The scope of deduplication depends on the <code>FifoThroughputScope</code> attribute, when set to <code>Topic</code> the message deduplication scope is across the entire topic, when set to <code>MessageGroup</code> the message deduplication scope is within each individual message group.</p></li>
382 /// <li>
383 /// <p>If a message with a particular <code>MessageDeduplicationId</code> is sent successfully, subsequent messages within the deduplication scope and interval, with the same <code>MessageDeduplicationId</code>, are accepted successfully but aren't delivered.</p></li>
384 /// <li>
385 /// <p>Every message must have a unique <code>MessageDeduplicationId</code>:</p>
386 /// <ul>
387 /// <li>
388 /// <p>You may provide a <code>MessageDeduplicationId</code> explicitly.</p></li>
389 /// <li>
390 /// <p>If you aren't able to provide a <code>MessageDeduplicationId</code> and you enable <code>ContentBasedDeduplication</code> for your topic, Amazon SNS uses a SHA-256 hash to generate the <code>MessageDeduplicationId</code> using the body of the message (but not the attributes of the message).</p></li>
391 /// <li>
392 /// <p>If you don't provide a <code>MessageDeduplicationId</code> and the topic doesn't have <code>ContentBasedDeduplication</code> set, the action fails with an error.</p></li>
393 /// <li>
394 /// <p>If the topic has a <code>ContentBasedDeduplication</code> set, your <code>MessageDeduplicationId</code> overrides the generated one.</p></li>
395 /// </ul></li>
396 /// <li>
397 /// <p>When <code>ContentBasedDeduplication</code> is in effect, messages with identical content sent within the deduplication scope and interval are treated as duplicates and only one copy of the message is delivered.</p></li>
398 /// <li>
399 /// <p>If you send one message with <code>ContentBasedDeduplication</code> enabled, and then another message with a <code>MessageDeduplicationId</code> that is the same as the one generated for the first <code>MessageDeduplicationId</code>, the two messages are treated as duplicates, within the deduplication scope and interval, and only one copy of the message is delivered.</p></li>
400 /// </ul>
401 pub fn set_message_deduplication_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
402 self.inner = self.inner.set_message_deduplication_id(input);
403 self
404 }
405 /// <ul>
406 /// <li>
407 /// <p>This parameter applies only to FIFO (first-in-first-out) topics. The <code>MessageDeduplicationId</code> can contain up to 128 alphanumeric characters <code>(a-z, A-Z, 0-9)</code> and punctuation <code>(!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~)</code>.</p></li>
408 /// <li>
409 /// <p>Every message must have a unique <code>MessageDeduplicationId</code>, which is a token used for deduplication of sent messages within the 5 minute minimum deduplication interval.</p></li>
410 /// <li>
411 /// <p>The scope of deduplication depends on the <code>FifoThroughputScope</code> attribute, when set to <code>Topic</code> the message deduplication scope is across the entire topic, when set to <code>MessageGroup</code> the message deduplication scope is within each individual message group.</p></li>
412 /// <li>
413 /// <p>If a message with a particular <code>MessageDeduplicationId</code> is sent successfully, subsequent messages within the deduplication scope and interval, with the same <code>MessageDeduplicationId</code>, are accepted successfully but aren't delivered.</p></li>
414 /// <li>
415 /// <p>Every message must have a unique <code>MessageDeduplicationId</code>:</p>
416 /// <ul>
417 /// <li>
418 /// <p>You may provide a <code>MessageDeduplicationId</code> explicitly.</p></li>
419 /// <li>
420 /// <p>If you aren't able to provide a <code>MessageDeduplicationId</code> and you enable <code>ContentBasedDeduplication</code> for your topic, Amazon SNS uses a SHA-256 hash to generate the <code>MessageDeduplicationId</code> using the body of the message (but not the attributes of the message).</p></li>
421 /// <li>
422 /// <p>If you don't provide a <code>MessageDeduplicationId</code> and the topic doesn't have <code>ContentBasedDeduplication</code> set, the action fails with an error.</p></li>
423 /// <li>
424 /// <p>If the topic has a <code>ContentBasedDeduplication</code> set, your <code>MessageDeduplicationId</code> overrides the generated one.</p></li>
425 /// </ul></li>
426 /// <li>
427 /// <p>When <code>ContentBasedDeduplication</code> is in effect, messages with identical content sent within the deduplication scope and interval are treated as duplicates and only one copy of the message is delivered.</p></li>
428 /// <li>
429 /// <p>If you send one message with <code>ContentBasedDeduplication</code> enabled, and then another message with a <code>MessageDeduplicationId</code> that is the same as the one generated for the first <code>MessageDeduplicationId</code>, the two messages are treated as duplicates, within the deduplication scope and interval, and only one copy of the message is delivered.</p></li>
430 /// </ul>
431 pub fn get_message_deduplication_id(&self) -> &::std::option::Option<::std::string::String> {
432 self.inner.get_message_deduplication_id()
433 }
434 /// <p>The <code>MessageGroupId</code> can contain up to 128 alphanumeric characters <code>(a-z, A-Z, 0-9)</code> and punctuation <code>(!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~)</code>.</p>
435 /// <p>For FIFO topics: The <code>MessageGroupId</code> is a tag that specifies that a message belongs to a specific message group. Messages that belong to the same message group are processed in a FIFO manner (however, messages in different message groups might be processed out of order). Every message must include a <code>MessageGroupId</code>.</p>
436 /// <p>For standard topics: The <code>MessageGroupId</code> is optional and is forwarded only to Amazon SQS standard subscriptions to activate <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-fair-queues.html">fair queues</a>. The <code>MessageGroupId</code> is not used for, or sent to, any other endpoint types. When provided, the same validation rules apply as for FIFO topics.</p>
437 pub fn message_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
438 self.inner = self.inner.message_group_id(input.into());
439 self
440 }
441 /// <p>The <code>MessageGroupId</code> can contain up to 128 alphanumeric characters <code>(a-z, A-Z, 0-9)</code> and punctuation <code>(!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~)</code>.</p>
442 /// <p>For FIFO topics: The <code>MessageGroupId</code> is a tag that specifies that a message belongs to a specific message group. Messages that belong to the same message group are processed in a FIFO manner (however, messages in different message groups might be processed out of order). Every message must include a <code>MessageGroupId</code>.</p>
443 /// <p>For standard topics: The <code>MessageGroupId</code> is optional and is forwarded only to Amazon SQS standard subscriptions to activate <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-fair-queues.html">fair queues</a>. The <code>MessageGroupId</code> is not used for, or sent to, any other endpoint types. When provided, the same validation rules apply as for FIFO topics.</p>
444 pub fn set_message_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
445 self.inner = self.inner.set_message_group_id(input);
446 self
447 }
448 /// <p>The <code>MessageGroupId</code> can contain up to 128 alphanumeric characters <code>(a-z, A-Z, 0-9)</code> and punctuation <code>(!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~)</code>.</p>
449 /// <p>For FIFO topics: The <code>MessageGroupId</code> is a tag that specifies that a message belongs to a specific message group. Messages that belong to the same message group are processed in a FIFO manner (however, messages in different message groups might be processed out of order). Every message must include a <code>MessageGroupId</code>.</p>
450 /// <p>For standard topics: The <code>MessageGroupId</code> is optional and is forwarded only to Amazon SQS standard subscriptions to activate <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-fair-queues.html">fair queues</a>. The <code>MessageGroupId</code> is not used for, or sent to, any other endpoint types. When provided, the same validation rules apply as for FIFO topics.</p>
451 pub fn get_message_group_id(&self) -> &::std::option::Option<::std::string::String> {
452 self.inner.get_message_group_id()
453 }
454}