aws_sdk_sns/operation/subscribe/_subscribe_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Input for Subscribe action.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SubscribeInput {
7 /// <p>The ARN of the topic you want to subscribe to.</p>
8 pub topic_arn: ::std::option::Option<::std::string::String>,
9 /// <p>The protocol that you want to use. Supported protocols include:</p>
10 /// <ul>
11 /// <li>
12 /// <p><code>http</code> – delivery of JSON-encoded message via HTTP POST</p></li>
13 /// <li>
14 /// <p><code>https</code> – delivery of JSON-encoded message via HTTPS POST</p></li>
15 /// <li>
16 /// <p><code>email</code> – delivery of message via SMTP</p></li>
17 /// <li>
18 /// <p><code>email-json</code> – delivery of JSON-encoded message via SMTP</p></li>
19 /// <li>
20 /// <p><code>sms</code> – delivery of message via SMS</p></li>
21 /// <li>
22 /// <p><code>sqs</code> – delivery of JSON-encoded message to an Amazon SQS queue</p></li>
23 /// <li>
24 /// <p><code>application</code> – delivery of JSON-encoded message to an EndpointArn for a mobile app and device</p></li>
25 /// <li>
26 /// <p><code>lambda</code> – delivery of JSON-encoded message to an Lambda function</p></li>
27 /// <li>
28 /// <p><code>firehose</code> – delivery of JSON-encoded message to an Amazon Data Firehose delivery stream.</p></li>
29 /// </ul>
30 pub protocol: ::std::option::Option<::std::string::String>,
31 /// <p>The endpoint that you want to receive notifications. Endpoints vary by protocol:</p>
32 /// <ul>
33 /// <li>
34 /// <p>For the <code>http</code> protocol, the (public) endpoint is a URL beginning with <code>http://</code>.</p></li>
35 /// <li>
36 /// <p>For the <code>https</code> protocol, the (public) endpoint is a URL beginning with <code>https://</code>.</p></li>
37 /// <li>
38 /// <p>For the <code>email</code> protocol, the endpoint is an email address.</p></li>
39 /// <li>
40 /// <p>For the <code>email-json</code> protocol, the endpoint is an email address.</p></li>
41 /// <li>
42 /// <p>For the <code>sms</code> protocol, the endpoint is a phone number of an SMS-enabled device.</p></li>
43 /// <li>
44 /// <p>For the <code>sqs</code> protocol, the endpoint is the ARN of an Amazon SQS queue.</p></li>
45 /// <li>
46 /// <p>For the <code>application</code> protocol, the endpoint is the EndpointArn of a mobile app and device.</p></li>
47 /// <li>
48 /// <p>For the <code>lambda</code> protocol, the endpoint is the ARN of an Lambda function.</p></li>
49 /// <li>
50 /// <p>For the <code>firehose</code> protocol, the endpoint is the ARN of an Amazon Data Firehose delivery stream.</p></li>
51 /// </ul>
52 pub endpoint: ::std::option::Option<::std::string::String>,
53 /// <p>A map of attributes with their corresponding values.</p>
54 /// <p>The following lists the names, descriptions, and values of the special request parameters that the <code>Subscribe</code> action uses:</p>
55 /// <ul>
56 /// <li>
57 /// <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li>
58 /// <li>
59 /// <p><code>FilterPolicy</code> – The simple JSON object that lets your subscriber receive only a subset of messages, rather than receiving every message published to the topic.</p></li>
60 /// <li>
61 /// <p><code>FilterPolicyScope</code> – This attribute lets you choose the filtering scope by using one of the following string value types:</p>
62 /// <ul>
63 /// <li>
64 /// <p><code>MessageAttributes</code> (default) – The filter is applied on the message attributes.</p></li>
65 /// <li>
66 /// <p><code>MessageBody</code> – The filter is applied on the message body.</p></li>
67 /// </ul></li>
68 /// <li>
69 /// <p><code>RawMessageDelivery</code> – When set to <code>true</code>, enables raw message delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need for the endpoints to process JSON formatting, which is otherwise created for Amazon SNS metadata.</p></li>
70 /// <li>
71 /// <p><code>RedrivePolicy</code> – When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. Messages that can't be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when the service that powers the subscribed endpoint becomes unavailable) are held in the dead-letter queue for further analysis or reprocessing.</p></li>
72 /// </ul>
73 /// <p>The following attribute applies only to Amazon Data Firehose delivery stream subscriptions:</p>
74 /// <ul>
75 /// <li>
76 /// <p><code>SubscriptionRoleArn</code> – The ARN of the IAM role that has the following:</p>
77 /// <ul>
78 /// <li>
79 /// <p>Permission to write to the Firehose delivery stream</p></li>
80 /// <li>
81 /// <p>Amazon SNS listed as a trusted entity</p></li>
82 /// </ul>
83 /// <p>Specifying a valid ARN for this attribute is required for Firehose delivery stream subscriptions. For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html">Fanout to Firehose delivery streams</a> in the <i>Amazon SNS Developer Guide</i>.</p></li>
84 /// </ul>
85 /// <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html">FIFO topics</a>:</p>
86 /// <ul>
87 /// <li>
88 /// <p><code>ReplayPolicy</code> – Adds or updates an inline policy document for a subscription to replay messages stored in the specified Amazon SNS topic.</p></li>
89 /// <li>
90 /// <p><code>ReplayStatus</code> – Retrieves the status of the subscription message replay, which can be one of the following:</p>
91 /// <ul>
92 /// <li>
93 /// <p><code>Completed</code> – The replay has successfully redelivered all messages, and is now delivering newly published messages. If an ending point was specified in the <code>ReplayPolicy</code> then the subscription will no longer receive newly published messages.</p></li>
94 /// <li>
95 /// <p><code>In progress</code> – The replay is currently replaying the selected messages.</p></li>
96 /// <li>
97 /// <p><code>Failed</code> – The replay was unable to complete.</p></li>
98 /// <li>
99 /// <p><code>Pending</code> – The default state while the replay initiates.</p></li>
100 /// </ul></li>
101 /// </ul>
102 pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
103 /// <p>Sets whether the response from the <code>Subscribe</code> request includes the subscription ARN, even if the subscription is not yet confirmed.</p>
104 /// <p>If you set this parameter to <code>true</code>, the response includes the ARN in all cases, even if the subscription is not yet confirmed. In addition to the ARN for confirmed subscriptions, the response also includes the <code>pending subscription</code> ARN value for subscriptions that aren't yet confirmed. A subscription becomes confirmed when the subscriber calls the <code>ConfirmSubscription</code> action with a confirmation token.</p>
105 /// <p></p>
106 /// <p>The default value is <code>false</code>.</p>
107 pub return_subscription_arn: ::std::option::Option<bool>,
108}
109impl SubscribeInput {
110 /// <p>The ARN of the topic you want to subscribe to.</p>
111 pub fn topic_arn(&self) -> ::std::option::Option<&str> {
112 self.topic_arn.as_deref()
113 }
114 /// <p>The protocol that you want to use. Supported protocols include:</p>
115 /// <ul>
116 /// <li>
117 /// <p><code>http</code> – delivery of JSON-encoded message via HTTP POST</p></li>
118 /// <li>
119 /// <p><code>https</code> – delivery of JSON-encoded message via HTTPS POST</p></li>
120 /// <li>
121 /// <p><code>email</code> – delivery of message via SMTP</p></li>
122 /// <li>
123 /// <p><code>email-json</code> – delivery of JSON-encoded message via SMTP</p></li>
124 /// <li>
125 /// <p><code>sms</code> – delivery of message via SMS</p></li>
126 /// <li>
127 /// <p><code>sqs</code> – delivery of JSON-encoded message to an Amazon SQS queue</p></li>
128 /// <li>
129 /// <p><code>application</code> – delivery of JSON-encoded message to an EndpointArn for a mobile app and device</p></li>
130 /// <li>
131 /// <p><code>lambda</code> – delivery of JSON-encoded message to an Lambda function</p></li>
132 /// <li>
133 /// <p><code>firehose</code> – delivery of JSON-encoded message to an Amazon Data Firehose delivery stream.</p></li>
134 /// </ul>
135 pub fn protocol(&self) -> ::std::option::Option<&str> {
136 self.protocol.as_deref()
137 }
138 /// <p>The endpoint that you want to receive notifications. Endpoints vary by protocol:</p>
139 /// <ul>
140 /// <li>
141 /// <p>For the <code>http</code> protocol, the (public) endpoint is a URL beginning with <code>http://</code>.</p></li>
142 /// <li>
143 /// <p>For the <code>https</code> protocol, the (public) endpoint is a URL beginning with <code>https://</code>.</p></li>
144 /// <li>
145 /// <p>For the <code>email</code> protocol, the endpoint is an email address.</p></li>
146 /// <li>
147 /// <p>For the <code>email-json</code> protocol, the endpoint is an email address.</p></li>
148 /// <li>
149 /// <p>For the <code>sms</code> protocol, the endpoint is a phone number of an SMS-enabled device.</p></li>
150 /// <li>
151 /// <p>For the <code>sqs</code> protocol, the endpoint is the ARN of an Amazon SQS queue.</p></li>
152 /// <li>
153 /// <p>For the <code>application</code> protocol, the endpoint is the EndpointArn of a mobile app and device.</p></li>
154 /// <li>
155 /// <p>For the <code>lambda</code> protocol, the endpoint is the ARN of an Lambda function.</p></li>
156 /// <li>
157 /// <p>For the <code>firehose</code> protocol, the endpoint is the ARN of an Amazon Data Firehose delivery stream.</p></li>
158 /// </ul>
159 pub fn endpoint(&self) -> ::std::option::Option<&str> {
160 self.endpoint.as_deref()
161 }
162 /// <p>A map of attributes with their corresponding values.</p>
163 /// <p>The following lists the names, descriptions, and values of the special request parameters that the <code>Subscribe</code> action uses:</p>
164 /// <ul>
165 /// <li>
166 /// <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li>
167 /// <li>
168 /// <p><code>FilterPolicy</code> – The simple JSON object that lets your subscriber receive only a subset of messages, rather than receiving every message published to the topic.</p></li>
169 /// <li>
170 /// <p><code>FilterPolicyScope</code> – This attribute lets you choose the filtering scope by using one of the following string value types:</p>
171 /// <ul>
172 /// <li>
173 /// <p><code>MessageAttributes</code> (default) – The filter is applied on the message attributes.</p></li>
174 /// <li>
175 /// <p><code>MessageBody</code> – The filter is applied on the message body.</p></li>
176 /// </ul></li>
177 /// <li>
178 /// <p><code>RawMessageDelivery</code> – When set to <code>true</code>, enables raw message delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need for the endpoints to process JSON formatting, which is otherwise created for Amazon SNS metadata.</p></li>
179 /// <li>
180 /// <p><code>RedrivePolicy</code> – When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. Messages that can't be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when the service that powers the subscribed endpoint becomes unavailable) are held in the dead-letter queue for further analysis or reprocessing.</p></li>
181 /// </ul>
182 /// <p>The following attribute applies only to Amazon Data Firehose delivery stream subscriptions:</p>
183 /// <ul>
184 /// <li>
185 /// <p><code>SubscriptionRoleArn</code> – The ARN of the IAM role that has the following:</p>
186 /// <ul>
187 /// <li>
188 /// <p>Permission to write to the Firehose delivery stream</p></li>
189 /// <li>
190 /// <p>Amazon SNS listed as a trusted entity</p></li>
191 /// </ul>
192 /// <p>Specifying a valid ARN for this attribute is required for Firehose delivery stream subscriptions. For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html">Fanout to Firehose delivery streams</a> in the <i>Amazon SNS Developer Guide</i>.</p></li>
193 /// </ul>
194 /// <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html">FIFO topics</a>:</p>
195 /// <ul>
196 /// <li>
197 /// <p><code>ReplayPolicy</code> – Adds or updates an inline policy document for a subscription to replay messages stored in the specified Amazon SNS topic.</p></li>
198 /// <li>
199 /// <p><code>ReplayStatus</code> – Retrieves the status of the subscription message replay, which can be one of the following:</p>
200 /// <ul>
201 /// <li>
202 /// <p><code>Completed</code> – The replay has successfully redelivered all messages, and is now delivering newly published messages. If an ending point was specified in the <code>ReplayPolicy</code> then the subscription will no longer receive newly published messages.</p></li>
203 /// <li>
204 /// <p><code>In progress</code> – The replay is currently replaying the selected messages.</p></li>
205 /// <li>
206 /// <p><code>Failed</code> – The replay was unable to complete.</p></li>
207 /// <li>
208 /// <p><code>Pending</code> – The default state while the replay initiates.</p></li>
209 /// </ul></li>
210 /// </ul>
211 pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
212 self.attributes.as_ref()
213 }
214 /// <p>Sets whether the response from the <code>Subscribe</code> request includes the subscription ARN, even if the subscription is not yet confirmed.</p>
215 /// <p>If you set this parameter to <code>true</code>, the response includes the ARN in all cases, even if the subscription is not yet confirmed. In addition to the ARN for confirmed subscriptions, the response also includes the <code>pending subscription</code> ARN value for subscriptions that aren't yet confirmed. A subscription becomes confirmed when the subscriber calls the <code>ConfirmSubscription</code> action with a confirmation token.</p>
216 /// <p></p>
217 /// <p>The default value is <code>false</code>.</p>
218 pub fn return_subscription_arn(&self) -> ::std::option::Option<bool> {
219 self.return_subscription_arn
220 }
221}
222impl SubscribeInput {
223 /// Creates a new builder-style object to manufacture [`SubscribeInput`](crate::operation::subscribe::SubscribeInput).
224 pub fn builder() -> crate::operation::subscribe::builders::SubscribeInputBuilder {
225 crate::operation::subscribe::builders::SubscribeInputBuilder::default()
226 }
227}
228
229/// A builder for [`SubscribeInput`](crate::operation::subscribe::SubscribeInput).
230#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
231#[non_exhaustive]
232pub struct SubscribeInputBuilder {
233 pub(crate) topic_arn: ::std::option::Option<::std::string::String>,
234 pub(crate) protocol: ::std::option::Option<::std::string::String>,
235 pub(crate) endpoint: ::std::option::Option<::std::string::String>,
236 pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
237 pub(crate) return_subscription_arn: ::std::option::Option<bool>,
238}
239impl SubscribeInputBuilder {
240 /// <p>The ARN of the topic you want to subscribe to.</p>
241 /// This field is required.
242 pub fn topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
243 self.topic_arn = ::std::option::Option::Some(input.into());
244 self
245 }
246 /// <p>The ARN of the topic you want to subscribe to.</p>
247 pub fn set_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
248 self.topic_arn = input;
249 self
250 }
251 /// <p>The ARN of the topic you want to subscribe to.</p>
252 pub fn get_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
253 &self.topic_arn
254 }
255 /// <p>The protocol that you want to use. Supported protocols include:</p>
256 /// <ul>
257 /// <li>
258 /// <p><code>http</code> – delivery of JSON-encoded message via HTTP POST</p></li>
259 /// <li>
260 /// <p><code>https</code> – delivery of JSON-encoded message via HTTPS POST</p></li>
261 /// <li>
262 /// <p><code>email</code> – delivery of message via SMTP</p></li>
263 /// <li>
264 /// <p><code>email-json</code> – delivery of JSON-encoded message via SMTP</p></li>
265 /// <li>
266 /// <p><code>sms</code> – delivery of message via SMS</p></li>
267 /// <li>
268 /// <p><code>sqs</code> – delivery of JSON-encoded message to an Amazon SQS queue</p></li>
269 /// <li>
270 /// <p><code>application</code> – delivery of JSON-encoded message to an EndpointArn for a mobile app and device</p></li>
271 /// <li>
272 /// <p><code>lambda</code> – delivery of JSON-encoded message to an Lambda function</p></li>
273 /// <li>
274 /// <p><code>firehose</code> – delivery of JSON-encoded message to an Amazon Data Firehose delivery stream.</p></li>
275 /// </ul>
276 /// This field is required.
277 pub fn protocol(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
278 self.protocol = ::std::option::Option::Some(input.into());
279 self
280 }
281 /// <p>The protocol that you want to use. Supported protocols include:</p>
282 /// <ul>
283 /// <li>
284 /// <p><code>http</code> – delivery of JSON-encoded message via HTTP POST</p></li>
285 /// <li>
286 /// <p><code>https</code> – delivery of JSON-encoded message via HTTPS POST</p></li>
287 /// <li>
288 /// <p><code>email</code> – delivery of message via SMTP</p></li>
289 /// <li>
290 /// <p><code>email-json</code> – delivery of JSON-encoded message via SMTP</p></li>
291 /// <li>
292 /// <p><code>sms</code> – delivery of message via SMS</p></li>
293 /// <li>
294 /// <p><code>sqs</code> – delivery of JSON-encoded message to an Amazon SQS queue</p></li>
295 /// <li>
296 /// <p><code>application</code> – delivery of JSON-encoded message to an EndpointArn for a mobile app and device</p></li>
297 /// <li>
298 /// <p><code>lambda</code> – delivery of JSON-encoded message to an Lambda function</p></li>
299 /// <li>
300 /// <p><code>firehose</code> – delivery of JSON-encoded message to an Amazon Data Firehose delivery stream.</p></li>
301 /// </ul>
302 pub fn set_protocol(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
303 self.protocol = input;
304 self
305 }
306 /// <p>The protocol that you want to use. Supported protocols include:</p>
307 /// <ul>
308 /// <li>
309 /// <p><code>http</code> – delivery of JSON-encoded message via HTTP POST</p></li>
310 /// <li>
311 /// <p><code>https</code> – delivery of JSON-encoded message via HTTPS POST</p></li>
312 /// <li>
313 /// <p><code>email</code> – delivery of message via SMTP</p></li>
314 /// <li>
315 /// <p><code>email-json</code> – delivery of JSON-encoded message via SMTP</p></li>
316 /// <li>
317 /// <p><code>sms</code> – delivery of message via SMS</p></li>
318 /// <li>
319 /// <p><code>sqs</code> – delivery of JSON-encoded message to an Amazon SQS queue</p></li>
320 /// <li>
321 /// <p><code>application</code> – delivery of JSON-encoded message to an EndpointArn for a mobile app and device</p></li>
322 /// <li>
323 /// <p><code>lambda</code> – delivery of JSON-encoded message to an Lambda function</p></li>
324 /// <li>
325 /// <p><code>firehose</code> – delivery of JSON-encoded message to an Amazon Data Firehose delivery stream.</p></li>
326 /// </ul>
327 pub fn get_protocol(&self) -> &::std::option::Option<::std::string::String> {
328 &self.protocol
329 }
330 /// <p>The endpoint that you want to receive notifications. Endpoints vary by protocol:</p>
331 /// <ul>
332 /// <li>
333 /// <p>For the <code>http</code> protocol, the (public) endpoint is a URL beginning with <code>http://</code>.</p></li>
334 /// <li>
335 /// <p>For the <code>https</code> protocol, the (public) endpoint is a URL beginning with <code>https://</code>.</p></li>
336 /// <li>
337 /// <p>For the <code>email</code> protocol, the endpoint is an email address.</p></li>
338 /// <li>
339 /// <p>For the <code>email-json</code> protocol, the endpoint is an email address.</p></li>
340 /// <li>
341 /// <p>For the <code>sms</code> protocol, the endpoint is a phone number of an SMS-enabled device.</p></li>
342 /// <li>
343 /// <p>For the <code>sqs</code> protocol, the endpoint is the ARN of an Amazon SQS queue.</p></li>
344 /// <li>
345 /// <p>For the <code>application</code> protocol, the endpoint is the EndpointArn of a mobile app and device.</p></li>
346 /// <li>
347 /// <p>For the <code>lambda</code> protocol, the endpoint is the ARN of an Lambda function.</p></li>
348 /// <li>
349 /// <p>For the <code>firehose</code> protocol, the endpoint is the ARN of an Amazon Data Firehose delivery stream.</p></li>
350 /// </ul>
351 pub fn endpoint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
352 self.endpoint = ::std::option::Option::Some(input.into());
353 self
354 }
355 /// <p>The endpoint that you want to receive notifications. Endpoints vary by protocol:</p>
356 /// <ul>
357 /// <li>
358 /// <p>For the <code>http</code> protocol, the (public) endpoint is a URL beginning with <code>http://</code>.</p></li>
359 /// <li>
360 /// <p>For the <code>https</code> protocol, the (public) endpoint is a URL beginning with <code>https://</code>.</p></li>
361 /// <li>
362 /// <p>For the <code>email</code> protocol, the endpoint is an email address.</p></li>
363 /// <li>
364 /// <p>For the <code>email-json</code> protocol, the endpoint is an email address.</p></li>
365 /// <li>
366 /// <p>For the <code>sms</code> protocol, the endpoint is a phone number of an SMS-enabled device.</p></li>
367 /// <li>
368 /// <p>For the <code>sqs</code> protocol, the endpoint is the ARN of an Amazon SQS queue.</p></li>
369 /// <li>
370 /// <p>For the <code>application</code> protocol, the endpoint is the EndpointArn of a mobile app and device.</p></li>
371 /// <li>
372 /// <p>For the <code>lambda</code> protocol, the endpoint is the ARN of an Lambda function.</p></li>
373 /// <li>
374 /// <p>For the <code>firehose</code> protocol, the endpoint is the ARN of an Amazon Data Firehose delivery stream.</p></li>
375 /// </ul>
376 pub fn set_endpoint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
377 self.endpoint = input;
378 self
379 }
380 /// <p>The endpoint that you want to receive notifications. Endpoints vary by protocol:</p>
381 /// <ul>
382 /// <li>
383 /// <p>For the <code>http</code> protocol, the (public) endpoint is a URL beginning with <code>http://</code>.</p></li>
384 /// <li>
385 /// <p>For the <code>https</code> protocol, the (public) endpoint is a URL beginning with <code>https://</code>.</p></li>
386 /// <li>
387 /// <p>For the <code>email</code> protocol, the endpoint is an email address.</p></li>
388 /// <li>
389 /// <p>For the <code>email-json</code> protocol, the endpoint is an email address.</p></li>
390 /// <li>
391 /// <p>For the <code>sms</code> protocol, the endpoint is a phone number of an SMS-enabled device.</p></li>
392 /// <li>
393 /// <p>For the <code>sqs</code> protocol, the endpoint is the ARN of an Amazon SQS queue.</p></li>
394 /// <li>
395 /// <p>For the <code>application</code> protocol, the endpoint is the EndpointArn of a mobile app and device.</p></li>
396 /// <li>
397 /// <p>For the <code>lambda</code> protocol, the endpoint is the ARN of an Lambda function.</p></li>
398 /// <li>
399 /// <p>For the <code>firehose</code> protocol, the endpoint is the ARN of an Amazon Data Firehose delivery stream.</p></li>
400 /// </ul>
401 pub fn get_endpoint(&self) -> &::std::option::Option<::std::string::String> {
402 &self.endpoint
403 }
404 /// Adds a key-value pair to `attributes`.
405 ///
406 /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
407 ///
408 /// <p>A map of attributes with their corresponding values.</p>
409 /// <p>The following lists the names, descriptions, and values of the special request parameters that the <code>Subscribe</code> action uses:</p>
410 /// <ul>
411 /// <li>
412 /// <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li>
413 /// <li>
414 /// <p><code>FilterPolicy</code> – The simple JSON object that lets your subscriber receive only a subset of messages, rather than receiving every message published to the topic.</p></li>
415 /// <li>
416 /// <p><code>FilterPolicyScope</code> – This attribute lets you choose the filtering scope by using one of the following string value types:</p>
417 /// <ul>
418 /// <li>
419 /// <p><code>MessageAttributes</code> (default) – The filter is applied on the message attributes.</p></li>
420 /// <li>
421 /// <p><code>MessageBody</code> – The filter is applied on the message body.</p></li>
422 /// </ul></li>
423 /// <li>
424 /// <p><code>RawMessageDelivery</code> – When set to <code>true</code>, enables raw message delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need for the endpoints to process JSON formatting, which is otherwise created for Amazon SNS metadata.</p></li>
425 /// <li>
426 /// <p><code>RedrivePolicy</code> – When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. Messages that can't be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when the service that powers the subscribed endpoint becomes unavailable) are held in the dead-letter queue for further analysis or reprocessing.</p></li>
427 /// </ul>
428 /// <p>The following attribute applies only to Amazon Data Firehose delivery stream subscriptions:</p>
429 /// <ul>
430 /// <li>
431 /// <p><code>SubscriptionRoleArn</code> – The ARN of the IAM role that has the following:</p>
432 /// <ul>
433 /// <li>
434 /// <p>Permission to write to the Firehose delivery stream</p></li>
435 /// <li>
436 /// <p>Amazon SNS listed as a trusted entity</p></li>
437 /// </ul>
438 /// <p>Specifying a valid ARN for this attribute is required for Firehose delivery stream subscriptions. For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html">Fanout to Firehose delivery streams</a> in the <i>Amazon SNS Developer Guide</i>.</p></li>
439 /// </ul>
440 /// <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html">FIFO topics</a>:</p>
441 /// <ul>
442 /// <li>
443 /// <p><code>ReplayPolicy</code> – Adds or updates an inline policy document for a subscription to replay messages stored in the specified Amazon SNS topic.</p></li>
444 /// <li>
445 /// <p><code>ReplayStatus</code> – Retrieves the status of the subscription message replay, which can be one of the following:</p>
446 /// <ul>
447 /// <li>
448 /// <p><code>Completed</code> – The replay has successfully redelivered all messages, and is now delivering newly published messages. If an ending point was specified in the <code>ReplayPolicy</code> then the subscription will no longer receive newly published messages.</p></li>
449 /// <li>
450 /// <p><code>In progress</code> – The replay is currently replaying the selected messages.</p></li>
451 /// <li>
452 /// <p><code>Failed</code> – The replay was unable to complete.</p></li>
453 /// <li>
454 /// <p><code>Pending</code> – The default state while the replay initiates.</p></li>
455 /// </ul></li>
456 /// </ul>
457 pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
458 let mut hash_map = self.attributes.unwrap_or_default();
459 hash_map.insert(k.into(), v.into());
460 self.attributes = ::std::option::Option::Some(hash_map);
461 self
462 }
463 /// <p>A map of attributes with their corresponding values.</p>
464 /// <p>The following lists the names, descriptions, and values of the special request parameters that the <code>Subscribe</code> action uses:</p>
465 /// <ul>
466 /// <li>
467 /// <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li>
468 /// <li>
469 /// <p><code>FilterPolicy</code> – The simple JSON object that lets your subscriber receive only a subset of messages, rather than receiving every message published to the topic.</p></li>
470 /// <li>
471 /// <p><code>FilterPolicyScope</code> – This attribute lets you choose the filtering scope by using one of the following string value types:</p>
472 /// <ul>
473 /// <li>
474 /// <p><code>MessageAttributes</code> (default) – The filter is applied on the message attributes.</p></li>
475 /// <li>
476 /// <p><code>MessageBody</code> – The filter is applied on the message body.</p></li>
477 /// </ul></li>
478 /// <li>
479 /// <p><code>RawMessageDelivery</code> – When set to <code>true</code>, enables raw message delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need for the endpoints to process JSON formatting, which is otherwise created for Amazon SNS metadata.</p></li>
480 /// <li>
481 /// <p><code>RedrivePolicy</code> – When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. Messages that can't be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when the service that powers the subscribed endpoint becomes unavailable) are held in the dead-letter queue for further analysis or reprocessing.</p></li>
482 /// </ul>
483 /// <p>The following attribute applies only to Amazon Data Firehose delivery stream subscriptions:</p>
484 /// <ul>
485 /// <li>
486 /// <p><code>SubscriptionRoleArn</code> – The ARN of the IAM role that has the following:</p>
487 /// <ul>
488 /// <li>
489 /// <p>Permission to write to the Firehose delivery stream</p></li>
490 /// <li>
491 /// <p>Amazon SNS listed as a trusted entity</p></li>
492 /// </ul>
493 /// <p>Specifying a valid ARN for this attribute is required for Firehose delivery stream subscriptions. For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html">Fanout to Firehose delivery streams</a> in the <i>Amazon SNS Developer Guide</i>.</p></li>
494 /// </ul>
495 /// <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html">FIFO topics</a>:</p>
496 /// <ul>
497 /// <li>
498 /// <p><code>ReplayPolicy</code> – Adds or updates an inline policy document for a subscription to replay messages stored in the specified Amazon SNS topic.</p></li>
499 /// <li>
500 /// <p><code>ReplayStatus</code> – Retrieves the status of the subscription message replay, which can be one of the following:</p>
501 /// <ul>
502 /// <li>
503 /// <p><code>Completed</code> – The replay has successfully redelivered all messages, and is now delivering newly published messages. If an ending point was specified in the <code>ReplayPolicy</code> then the subscription will no longer receive newly published messages.</p></li>
504 /// <li>
505 /// <p><code>In progress</code> – The replay is currently replaying the selected messages.</p></li>
506 /// <li>
507 /// <p><code>Failed</code> – The replay was unable to complete.</p></li>
508 /// <li>
509 /// <p><code>Pending</code> – The default state while the replay initiates.</p></li>
510 /// </ul></li>
511 /// </ul>
512 pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
513 self.attributes = input;
514 self
515 }
516 /// <p>A map of attributes with their corresponding values.</p>
517 /// <p>The following lists the names, descriptions, and values of the special request parameters that the <code>Subscribe</code> action uses:</p>
518 /// <ul>
519 /// <li>
520 /// <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li>
521 /// <li>
522 /// <p><code>FilterPolicy</code> – The simple JSON object that lets your subscriber receive only a subset of messages, rather than receiving every message published to the topic.</p></li>
523 /// <li>
524 /// <p><code>FilterPolicyScope</code> – This attribute lets you choose the filtering scope by using one of the following string value types:</p>
525 /// <ul>
526 /// <li>
527 /// <p><code>MessageAttributes</code> (default) – The filter is applied on the message attributes.</p></li>
528 /// <li>
529 /// <p><code>MessageBody</code> – The filter is applied on the message body.</p></li>
530 /// </ul></li>
531 /// <li>
532 /// <p><code>RawMessageDelivery</code> – When set to <code>true</code>, enables raw message delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need for the endpoints to process JSON formatting, which is otherwise created for Amazon SNS metadata.</p></li>
533 /// <li>
534 /// <p><code>RedrivePolicy</code> – When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. Messages that can't be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when the service that powers the subscribed endpoint becomes unavailable) are held in the dead-letter queue for further analysis or reprocessing.</p></li>
535 /// </ul>
536 /// <p>The following attribute applies only to Amazon Data Firehose delivery stream subscriptions:</p>
537 /// <ul>
538 /// <li>
539 /// <p><code>SubscriptionRoleArn</code> – The ARN of the IAM role that has the following:</p>
540 /// <ul>
541 /// <li>
542 /// <p>Permission to write to the Firehose delivery stream</p></li>
543 /// <li>
544 /// <p>Amazon SNS listed as a trusted entity</p></li>
545 /// </ul>
546 /// <p>Specifying a valid ARN for this attribute is required for Firehose delivery stream subscriptions. For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html">Fanout to Firehose delivery streams</a> in the <i>Amazon SNS Developer Guide</i>.</p></li>
547 /// </ul>
548 /// <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html">FIFO topics</a>:</p>
549 /// <ul>
550 /// <li>
551 /// <p><code>ReplayPolicy</code> – Adds or updates an inline policy document for a subscription to replay messages stored in the specified Amazon SNS topic.</p></li>
552 /// <li>
553 /// <p><code>ReplayStatus</code> – Retrieves the status of the subscription message replay, which can be one of the following:</p>
554 /// <ul>
555 /// <li>
556 /// <p><code>Completed</code> – The replay has successfully redelivered all messages, and is now delivering newly published messages. If an ending point was specified in the <code>ReplayPolicy</code> then the subscription will no longer receive newly published messages.</p></li>
557 /// <li>
558 /// <p><code>In progress</code> – The replay is currently replaying the selected messages.</p></li>
559 /// <li>
560 /// <p><code>Failed</code> – The replay was unable to complete.</p></li>
561 /// <li>
562 /// <p><code>Pending</code> – The default state while the replay initiates.</p></li>
563 /// </ul></li>
564 /// </ul>
565 pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
566 &self.attributes
567 }
568 /// <p>Sets whether the response from the <code>Subscribe</code> request includes the subscription ARN, even if the subscription is not yet confirmed.</p>
569 /// <p>If you set this parameter to <code>true</code>, the response includes the ARN in all cases, even if the subscription is not yet confirmed. In addition to the ARN for confirmed subscriptions, the response also includes the <code>pending subscription</code> ARN value for subscriptions that aren't yet confirmed. A subscription becomes confirmed when the subscriber calls the <code>ConfirmSubscription</code> action with a confirmation token.</p>
570 /// <p></p>
571 /// <p>The default value is <code>false</code>.</p>
572 pub fn return_subscription_arn(mut self, input: bool) -> Self {
573 self.return_subscription_arn = ::std::option::Option::Some(input);
574 self
575 }
576 /// <p>Sets whether the response from the <code>Subscribe</code> request includes the subscription ARN, even if the subscription is not yet confirmed.</p>
577 /// <p>If you set this parameter to <code>true</code>, the response includes the ARN in all cases, even if the subscription is not yet confirmed. In addition to the ARN for confirmed subscriptions, the response also includes the <code>pending subscription</code> ARN value for subscriptions that aren't yet confirmed. A subscription becomes confirmed when the subscriber calls the <code>ConfirmSubscription</code> action with a confirmation token.</p>
578 /// <p></p>
579 /// <p>The default value is <code>false</code>.</p>
580 pub fn set_return_subscription_arn(mut self, input: ::std::option::Option<bool>) -> Self {
581 self.return_subscription_arn = input;
582 self
583 }
584 /// <p>Sets whether the response from the <code>Subscribe</code> request includes the subscription ARN, even if the subscription is not yet confirmed.</p>
585 /// <p>If you set this parameter to <code>true</code>, the response includes the ARN in all cases, even if the subscription is not yet confirmed. In addition to the ARN for confirmed subscriptions, the response also includes the <code>pending subscription</code> ARN value for subscriptions that aren't yet confirmed. A subscription becomes confirmed when the subscriber calls the <code>ConfirmSubscription</code> action with a confirmation token.</p>
586 /// <p></p>
587 /// <p>The default value is <code>false</code>.</p>
588 pub fn get_return_subscription_arn(&self) -> &::std::option::Option<bool> {
589 &self.return_subscription_arn
590 }
591 /// Consumes the builder and constructs a [`SubscribeInput`](crate::operation::subscribe::SubscribeInput).
592 pub fn build(self) -> ::std::result::Result<crate::operation::subscribe::SubscribeInput, ::aws_smithy_types::error::operation::BuildError> {
593 ::std::result::Result::Ok(crate::operation::subscribe::SubscribeInput {
594 topic_arn: self.topic_arn,
595 protocol: self.protocol,
596 endpoint: self.endpoint,
597 attributes: self.attributes,
598 return_subscription_arn: self.return_subscription_arn,
599 })
600 }
601}