aws_sdk_sns/operation/set_platform_application_attributes/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::set_platform_application_attributes::_set_platform_application_attributes_output::SetPlatformApplicationAttributesOutputBuilder;
3
4pub use crate::operation::set_platform_application_attributes::_set_platform_application_attributes_input::SetPlatformApplicationAttributesInputBuilder;
5
6impl crate::operation::set_platform_application_attributes::builders::SetPlatformApplicationAttributesInputBuilder {
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_platform_application_attributes::SetPlatformApplicationAttributesOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::set_platform_application_attributes::SetPlatformApplicationAttributesError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.set_platform_application_attributes();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `SetPlatformApplicationAttributes`.
24///
25/// <p>Sets the attributes of the platform application object for the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging). For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html">Using Amazon SNS Mobile Push Notifications</a>. For information on configuring attributes for message delivery status, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html">Using Amazon SNS Application Attributes for Message Delivery Status</a>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct SetPlatformApplicationAttributesFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::set_platform_application_attributes::builders::SetPlatformApplicationAttributesInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::set_platform_application_attributes::SetPlatformApplicationAttributesOutput,
35 crate::operation::set_platform_application_attributes::SetPlatformApplicationAttributesError,
36 > for SetPlatformApplicationAttributesFluentBuilder
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_platform_application_attributes::SetPlatformApplicationAttributesOutput,
44 crate::operation::set_platform_application_attributes::SetPlatformApplicationAttributesError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl SetPlatformApplicationAttributesFluentBuilder {
51 /// Creates a new `SetPlatformApplicationAttributesFluentBuilder`.
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 SetPlatformApplicationAttributes as a reference.
60 pub fn as_input(&self) -> &crate::operation::set_platform_application_attributes::builders::SetPlatformApplicationAttributesInputBuilder {
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_platform_application_attributes::SetPlatformApplicationAttributesOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::set_platform_application_attributes::SetPlatformApplicationAttributesError,
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_platform_application_attributes::SetPlatformApplicationAttributes::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::set_platform_application_attributes::SetPlatformApplicationAttributes::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_platform_application_attributes::SetPlatformApplicationAttributesOutput,
97 crate::operation::set_platform_application_attributes::SetPlatformApplicationAttributesError,
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><code>PlatformApplicationArn</code> for <code>SetPlatformApplicationAttributes</code> action.</p>
112 pub fn platform_application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.platform_application_arn(input.into());
114 self
115 }
116 /// <p><code>PlatformApplicationArn</code> for <code>SetPlatformApplicationAttributes</code> action.</p>
117 pub fn set_platform_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_platform_application_arn(input);
119 self
120 }
121 /// <p><code>PlatformApplicationArn</code> for <code>SetPlatformApplicationAttributes</code> action.</p>
122 pub fn get_platform_application_arn(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_platform_application_arn()
124 }
125 ///
126 /// Adds a key-value pair to `Attributes`.
127 ///
128 /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
129 ///
130 /// <p>A map of the platform application attributes. Attributes in this map include the following:</p>
131 /// <ul>
132 /// <li>
133 /// <p><code>PlatformCredential</code> – The credential received from the notification service.</p>
134 /// <ul>
135 /// <li>
136 /// <p>For ADM, <code>PlatformCredential</code>is client secret.</p></li>
137 /// <li>
138 /// <p>For Apple Services using certificate credentials, <code>PlatformCredential</code> is private key.</p></li>
139 /// <li>
140 /// <p>For Apple Services using token credentials, <code>PlatformCredential</code> is signing key.</p></li>
141 /// <li>
142 /// <p>For GCM (Firebase Cloud Messaging) using key credentials, there is no <code>PlatformPrincipal</code>. The <code>PlatformCredential</code> is <code>API key</code>.</p></li>
143 /// <li>
144 /// <p>For GCM (Firebase Cloud Messaging) using token credentials, there is no <code>PlatformPrincipal</code>. The <code>PlatformCredential</code> is a JSON formatted private key file. When using the Amazon Web Services CLI, the file must be in string format and special characters must be ignored. To format the file correctly, Amazon SNS recommends using the following command: <code>SERVICE_JSON=`jq @json <<< cat service.json`</code>.</p></li>
145 /// </ul></li>
146 /// </ul>
147 /// <ul>
148 /// <li>
149 /// <p><code>PlatformPrincipal</code> – The principal received from the notification service.</p>
150 /// <ul>
151 /// <li>
152 /// <p>For ADM, <code>PlatformPrincipal</code>is client id.</p></li>
153 /// <li>
154 /// <p>For Apple Services using certificate credentials, <code>PlatformPrincipal</code> is SSL certificate.</p></li>
155 /// <li>
156 /// <p>For Apple Services using token credentials, <code>PlatformPrincipal</code> is signing key ID.</p></li>
157 /// <li>
158 /// <p>For GCM (Firebase Cloud Messaging), there is no <code>PlatformPrincipal</code>.</p></li>
159 /// </ul></li>
160 /// </ul>
161 /// <ul>
162 /// <li>
163 /// <p><code>EventEndpointCreated</code> – Topic ARN to which <code>EndpointCreated</code> event notifications are sent.</p></li>
164 /// <li>
165 /// <p><code>EventEndpointDeleted</code> – Topic ARN to which <code>EndpointDeleted</code> event notifications are sent.</p></li>
166 /// <li>
167 /// <p><code>EventEndpointUpdated</code> – Topic ARN to which <code>EndpointUpdate</code> event notifications are sent.</p></li>
168 /// <li>
169 /// <p><code>EventDeliveryFailure</code> – Topic ARN to which <code>DeliveryFailure</code> event notifications are sent upon Direct Publish delivery failure (permanent) to one of the application's endpoints.</p></li>
170 /// <li>
171 /// <p><code>SuccessFeedbackRoleArn</code> – IAM role ARN used to give Amazon SNS write access to use CloudWatch Logs on your behalf.</p></li>
172 /// <li>
173 /// <p><code>FailureFeedbackRoleArn</code> – IAM role ARN used to give Amazon SNS write access to use CloudWatch Logs on your behalf.</p></li>
174 /// <li>
175 /// <p><code>SuccessFeedbackSampleRate</code> – Sample rate percentage (0-100) of successfully delivered messages.</p></li>
176 /// </ul>
177 /// <p>The following attributes only apply to <code>APNs</code> token-based authentication:</p>
178 /// <ul>
179 /// <li>
180 /// <p><code>ApplePlatformTeamID</code> – The identifier that's assigned to your Apple developer account team.</p></li>
181 /// <li>
182 /// <p><code>ApplePlatformBundleID</code> – The bundle identifier that's assigned to your iOS app.</p></li>
183 /// </ul>
184 pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
185 self.inner = self.inner.attributes(k.into(), v.into());
186 self
187 }
188 /// <p>A map of the platform application attributes. Attributes in this map include the following:</p>
189 /// <ul>
190 /// <li>
191 /// <p><code>PlatformCredential</code> – The credential received from the notification service.</p>
192 /// <ul>
193 /// <li>
194 /// <p>For ADM, <code>PlatformCredential</code>is client secret.</p></li>
195 /// <li>
196 /// <p>For Apple Services using certificate credentials, <code>PlatformCredential</code> is private key.</p></li>
197 /// <li>
198 /// <p>For Apple Services using token credentials, <code>PlatformCredential</code> is signing key.</p></li>
199 /// <li>
200 /// <p>For GCM (Firebase Cloud Messaging) using key credentials, there is no <code>PlatformPrincipal</code>. The <code>PlatformCredential</code> is <code>API key</code>.</p></li>
201 /// <li>
202 /// <p>For GCM (Firebase Cloud Messaging) using token credentials, there is no <code>PlatformPrincipal</code>. The <code>PlatformCredential</code> is a JSON formatted private key file. When using the Amazon Web Services CLI, the file must be in string format and special characters must be ignored. To format the file correctly, Amazon SNS recommends using the following command: <code>SERVICE_JSON=`jq @json <<< cat service.json`</code>.</p></li>
203 /// </ul></li>
204 /// </ul>
205 /// <ul>
206 /// <li>
207 /// <p><code>PlatformPrincipal</code> – The principal received from the notification service.</p>
208 /// <ul>
209 /// <li>
210 /// <p>For ADM, <code>PlatformPrincipal</code>is client id.</p></li>
211 /// <li>
212 /// <p>For Apple Services using certificate credentials, <code>PlatformPrincipal</code> is SSL certificate.</p></li>
213 /// <li>
214 /// <p>For Apple Services using token credentials, <code>PlatformPrincipal</code> is signing key ID.</p></li>
215 /// <li>
216 /// <p>For GCM (Firebase Cloud Messaging), there is no <code>PlatformPrincipal</code>.</p></li>
217 /// </ul></li>
218 /// </ul>
219 /// <ul>
220 /// <li>
221 /// <p><code>EventEndpointCreated</code> – Topic ARN to which <code>EndpointCreated</code> event notifications are sent.</p></li>
222 /// <li>
223 /// <p><code>EventEndpointDeleted</code> – Topic ARN to which <code>EndpointDeleted</code> event notifications are sent.</p></li>
224 /// <li>
225 /// <p><code>EventEndpointUpdated</code> – Topic ARN to which <code>EndpointUpdate</code> event notifications are sent.</p></li>
226 /// <li>
227 /// <p><code>EventDeliveryFailure</code> – Topic ARN to which <code>DeliveryFailure</code> event notifications are sent upon Direct Publish delivery failure (permanent) to one of the application's endpoints.</p></li>
228 /// <li>
229 /// <p><code>SuccessFeedbackRoleArn</code> – IAM role ARN used to give Amazon SNS write access to use CloudWatch Logs on your behalf.</p></li>
230 /// <li>
231 /// <p><code>FailureFeedbackRoleArn</code> – IAM role ARN used to give Amazon SNS write access to use CloudWatch Logs on your behalf.</p></li>
232 /// <li>
233 /// <p><code>SuccessFeedbackSampleRate</code> – Sample rate percentage (0-100) of successfully delivered messages.</p></li>
234 /// </ul>
235 /// <p>The following attributes only apply to <code>APNs</code> token-based authentication:</p>
236 /// <ul>
237 /// <li>
238 /// <p><code>ApplePlatformTeamID</code> – The identifier that's assigned to your Apple developer account team.</p></li>
239 /// <li>
240 /// <p><code>ApplePlatformBundleID</code> – The bundle identifier that's assigned to your iOS app.</p></li>
241 /// </ul>
242 pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
243 self.inner = self.inner.set_attributes(input);
244 self
245 }
246 /// <p>A map of the platform application attributes. Attributes in this map include the following:</p>
247 /// <ul>
248 /// <li>
249 /// <p><code>PlatformCredential</code> – The credential received from the notification service.</p>
250 /// <ul>
251 /// <li>
252 /// <p>For ADM, <code>PlatformCredential</code>is client secret.</p></li>
253 /// <li>
254 /// <p>For Apple Services using certificate credentials, <code>PlatformCredential</code> is private key.</p></li>
255 /// <li>
256 /// <p>For Apple Services using token credentials, <code>PlatformCredential</code> is signing key.</p></li>
257 /// <li>
258 /// <p>For GCM (Firebase Cloud Messaging) using key credentials, there is no <code>PlatformPrincipal</code>. The <code>PlatformCredential</code> is <code>API key</code>.</p></li>
259 /// <li>
260 /// <p>For GCM (Firebase Cloud Messaging) using token credentials, there is no <code>PlatformPrincipal</code>. The <code>PlatformCredential</code> is a JSON formatted private key file. When using the Amazon Web Services CLI, the file must be in string format and special characters must be ignored. To format the file correctly, Amazon SNS recommends using the following command: <code>SERVICE_JSON=`jq @json <<< cat service.json`</code>.</p></li>
261 /// </ul></li>
262 /// </ul>
263 /// <ul>
264 /// <li>
265 /// <p><code>PlatformPrincipal</code> – The principal received from the notification service.</p>
266 /// <ul>
267 /// <li>
268 /// <p>For ADM, <code>PlatformPrincipal</code>is client id.</p></li>
269 /// <li>
270 /// <p>For Apple Services using certificate credentials, <code>PlatformPrincipal</code> is SSL certificate.</p></li>
271 /// <li>
272 /// <p>For Apple Services using token credentials, <code>PlatformPrincipal</code> is signing key ID.</p></li>
273 /// <li>
274 /// <p>For GCM (Firebase Cloud Messaging), there is no <code>PlatformPrincipal</code>.</p></li>
275 /// </ul></li>
276 /// </ul>
277 /// <ul>
278 /// <li>
279 /// <p><code>EventEndpointCreated</code> – Topic ARN to which <code>EndpointCreated</code> event notifications are sent.</p></li>
280 /// <li>
281 /// <p><code>EventEndpointDeleted</code> – Topic ARN to which <code>EndpointDeleted</code> event notifications are sent.</p></li>
282 /// <li>
283 /// <p><code>EventEndpointUpdated</code> – Topic ARN to which <code>EndpointUpdate</code> event notifications are sent.</p></li>
284 /// <li>
285 /// <p><code>EventDeliveryFailure</code> – Topic ARN to which <code>DeliveryFailure</code> event notifications are sent upon Direct Publish delivery failure (permanent) to one of the application's endpoints.</p></li>
286 /// <li>
287 /// <p><code>SuccessFeedbackRoleArn</code> – IAM role ARN used to give Amazon SNS write access to use CloudWatch Logs on your behalf.</p></li>
288 /// <li>
289 /// <p><code>FailureFeedbackRoleArn</code> – IAM role ARN used to give Amazon SNS write access to use CloudWatch Logs on your behalf.</p></li>
290 /// <li>
291 /// <p><code>SuccessFeedbackSampleRate</code> – Sample rate percentage (0-100) of successfully delivered messages.</p></li>
292 /// </ul>
293 /// <p>The following attributes only apply to <code>APNs</code> token-based authentication:</p>
294 /// <ul>
295 /// <li>
296 /// <p><code>ApplePlatformTeamID</code> – The identifier that's assigned to your Apple developer account team.</p></li>
297 /// <li>
298 /// <p><code>ApplePlatformBundleID</code> – The bundle identifier that's assigned to your iOS app.</p></li>
299 /// </ul>
300 pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
301 self.inner.get_attributes()
302 }
303}