aws_sdk_sns/operation/set_subscription_attributes/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::set_subscription_attributes::_set_subscription_attributes_output::SetSubscriptionAttributesOutputBuilder;
3
4pub use crate::operation::set_subscription_attributes::_set_subscription_attributes_input::SetSubscriptionAttributesInputBuilder;
5
6impl crate::operation::set_subscription_attributes::builders::SetSubscriptionAttributesInputBuilder {
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::set_subscription_attributes::SetSubscriptionAttributesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::set_subscription_attributes::SetSubscriptionAttributesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.set_subscription_attributes();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SetSubscriptionAttributes`.
24///
25/// <p>Allows a subscription owner to set an attribute of the subscription to a new value.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct SetSubscriptionAttributesFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::set_subscription_attributes::builders::SetSubscriptionAttributesInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::set_subscription_attributes::SetSubscriptionAttributesOutput,
35        crate::operation::set_subscription_attributes::SetSubscriptionAttributesError,
36    > for SetSubscriptionAttributesFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::set_subscription_attributes::SetSubscriptionAttributesOutput,
44            crate::operation::set_subscription_attributes::SetSubscriptionAttributesError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl SetSubscriptionAttributesFluentBuilder {
51    /// Creates a new `SetSubscriptionAttributesFluentBuilder`.
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 SetSubscriptionAttributes as a reference.
60    pub fn as_input(&self) -> &crate::operation::set_subscription_attributes::builders::SetSubscriptionAttributesInputBuilder {
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::set_subscription_attributes::SetSubscriptionAttributesOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::set_subscription_attributes::SetSubscriptionAttributesError,
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::set_subscription_attributes::SetSubscriptionAttributes::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::set_subscription_attributes::SetSubscriptionAttributes::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<
96        crate::operation::set_subscription_attributes::SetSubscriptionAttributesOutput,
97        crate::operation::set_subscription_attributes::SetSubscriptionAttributesError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The ARN of the subscription to modify.</p>
112    pub fn subscription_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.subscription_arn(input.into());
114        self
115    }
116    /// <p>The ARN of the subscription to modify.</p>
117    pub fn set_subscription_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_subscription_arn(input);
119        self
120    }
121    /// <p>The ARN of the subscription to modify.</p>
122    pub fn get_subscription_arn(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_subscription_arn()
124    }
125    /// <p>A map of attributes with their corresponding values.</p>
126    /// <p>The following lists the names, descriptions, and values of the special request parameters that this action uses:</p>
127    /// <ul>
128    /// <li>
129    /// <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li>
130    /// <li>
131    /// <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>
132    /// <li>
133    /// <p><code>FilterPolicyScope</code> – This attribute lets you choose the filtering scope by using one of the following string value types:</p>
134    /// <ul>
135    /// <li>
136    /// <p><code>MessageAttributes</code> (default) – The filter is applied on the message attributes.</p></li>
137    /// <li>
138    /// <p><code>MessageBody</code> – The filter is applied on the message body.</p></li>
139    /// </ul></li>
140    /// <li>
141    /// <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>
142    /// <li>
143    /// <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>
144    /// </ul>
145    /// <p>The following attribute applies only to Amazon Data Firehose delivery stream subscriptions:</p>
146    /// <ul>
147    /// <li>
148    /// <p><code>SubscriptionRoleArn</code> – The ARN of the IAM role that has the following:</p>
149    /// <ul>
150    /// <li>
151    /// <p>Permission to write to the Firehose delivery stream</p></li>
152    /// <li>
153    /// <p>Amazon SNS listed as a trusted entity</p></li>
154    /// </ul>
155    /// <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>
156    /// </ul>
157    pub fn attribute_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.attribute_name(input.into());
159        self
160    }
161    /// <p>A map of attributes with their corresponding values.</p>
162    /// <p>The following lists the names, descriptions, and values of the special request parameters that this action uses:</p>
163    /// <ul>
164    /// <li>
165    /// <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li>
166    /// <li>
167    /// <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>
168    /// <li>
169    /// <p><code>FilterPolicyScope</code> – This attribute lets you choose the filtering scope by using one of the following string value types:</p>
170    /// <ul>
171    /// <li>
172    /// <p><code>MessageAttributes</code> (default) – The filter is applied on the message attributes.</p></li>
173    /// <li>
174    /// <p><code>MessageBody</code> – The filter is applied on the message body.</p></li>
175    /// </ul></li>
176    /// <li>
177    /// <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>
178    /// <li>
179    /// <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>
180    /// </ul>
181    /// <p>The following attribute applies only to Amazon Data Firehose delivery stream subscriptions:</p>
182    /// <ul>
183    /// <li>
184    /// <p><code>SubscriptionRoleArn</code> – The ARN of the IAM role that has the following:</p>
185    /// <ul>
186    /// <li>
187    /// <p>Permission to write to the Firehose delivery stream</p></li>
188    /// <li>
189    /// <p>Amazon SNS listed as a trusted entity</p></li>
190    /// </ul>
191    /// <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>
192    /// </ul>
193    pub fn set_attribute_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194        self.inner = self.inner.set_attribute_name(input);
195        self
196    }
197    /// <p>A map of attributes with their corresponding values.</p>
198    /// <p>The following lists the names, descriptions, and values of the special request parameters that this action uses:</p>
199    /// <ul>
200    /// <li>
201    /// <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li>
202    /// <li>
203    /// <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>
204    /// <li>
205    /// <p><code>FilterPolicyScope</code> – This attribute lets you choose the filtering scope by using one of the following string value types:</p>
206    /// <ul>
207    /// <li>
208    /// <p><code>MessageAttributes</code> (default) – The filter is applied on the message attributes.</p></li>
209    /// <li>
210    /// <p><code>MessageBody</code> – The filter is applied on the message body.</p></li>
211    /// </ul></li>
212    /// <li>
213    /// <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>
214    /// <li>
215    /// <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>
216    /// </ul>
217    /// <p>The following attribute applies only to Amazon Data Firehose delivery stream subscriptions:</p>
218    /// <ul>
219    /// <li>
220    /// <p><code>SubscriptionRoleArn</code> – The ARN of the IAM role that has the following:</p>
221    /// <ul>
222    /// <li>
223    /// <p>Permission to write to the Firehose delivery stream</p></li>
224    /// <li>
225    /// <p>Amazon SNS listed as a trusted entity</p></li>
226    /// </ul>
227    /// <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>
228    /// </ul>
229    pub fn get_attribute_name(&self) -> &::std::option::Option<::std::string::String> {
230        self.inner.get_attribute_name()
231    }
232    /// <p>The new value for the attribute in JSON format.</p>
233    pub fn attribute_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
234        self.inner = self.inner.attribute_value(input.into());
235        self
236    }
237    /// <p>The new value for the attribute in JSON format.</p>
238    pub fn set_attribute_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
239        self.inner = self.inner.set_attribute_value(input);
240        self
241    }
242    /// <p>The new value for the attribute in JSON format.</p>
243    pub fn get_attribute_value(&self) -> &::std::option::Option<::std::string::String> {
244        self.inner.get_attribute_value()
245    }
246}