aws_sdk_ses/operation/set_identity_headers_in_notifications_enabled/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::set_identity_headers_in_notifications_enabled::_set_identity_headers_in_notifications_enabled_output::SetIdentityHeadersInNotificationsEnabledOutputBuilder;
3
4pub use crate::operation::set_identity_headers_in_notifications_enabled::_set_identity_headers_in_notifications_enabled_input::SetIdentityHeadersInNotificationsEnabledInputBuilder;
5
6impl crate::operation::set_identity_headers_in_notifications_enabled::builders::SetIdentityHeadersInNotificationsEnabledInputBuilder {
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_identity_headers_in_notifications_enabled::SetIdentityHeadersInNotificationsEnabledOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::set_identity_headers_in_notifications_enabled::SetIdentityHeadersInNotificationsEnabledError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.set_identity_headers_in_notifications_enabled();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SetIdentityHeadersInNotificationsEnabled`.
24///
25/// <p>Given an identity (an email address or a domain), sets whether Amazon SES includes the original email headers in the Amazon Simple Notification Service (Amazon SNS) notifications of a specified type.</p>
26/// <p>You can execute this operation no more than once per second.</p>
27/// <p>For more information about using notifications with Amazon SES, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity-using-notifications.html">Amazon SES Developer Guide</a>.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct SetIdentityHeadersInNotificationsEnabledFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::set_identity_headers_in_notifications_enabled::builders::SetIdentityHeadersInNotificationsEnabledInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::set_identity_headers_in_notifications_enabled::SetIdentityHeadersInNotificationsEnabledOutput,
37        crate::operation::set_identity_headers_in_notifications_enabled::SetIdentityHeadersInNotificationsEnabledError,
38    > for SetIdentityHeadersInNotificationsEnabledFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::set_identity_headers_in_notifications_enabled::SetIdentityHeadersInNotificationsEnabledOutput,
46            crate::operation::set_identity_headers_in_notifications_enabled::SetIdentityHeadersInNotificationsEnabledError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl SetIdentityHeadersInNotificationsEnabledFluentBuilder {
53    /// Creates a new `SetIdentityHeadersInNotificationsEnabledFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the SetIdentityHeadersInNotificationsEnabled as a reference.
62    pub fn as_input(
63        &self,
64    ) -> &crate::operation::set_identity_headers_in_notifications_enabled::builders::SetIdentityHeadersInNotificationsEnabledInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::set_identity_headers_in_notifications_enabled::SetIdentityHeadersInNotificationsEnabledOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::set_identity_headers_in_notifications_enabled::SetIdentityHeadersInNotificationsEnabledError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins =
89            crate::operation::set_identity_headers_in_notifications_enabled::SetIdentityHeadersInNotificationsEnabled::operation_runtime_plugins(
90                self.handle.runtime_plugins.clone(),
91                &self.handle.conf,
92                self.config_override,
93            );
94        crate::operation::set_identity_headers_in_notifications_enabled::SetIdentityHeadersInNotificationsEnabled::orchestrate(
95            &runtime_plugins,
96            input,
97        )
98        .await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::set_identity_headers_in_notifications_enabled::SetIdentityHeadersInNotificationsEnabledOutput,
106        crate::operation::set_identity_headers_in_notifications_enabled::SetIdentityHeadersInNotificationsEnabledError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>The identity for which to enable or disable headers in notifications. Examples: <code>user@example.com</code>, <code>example.com</code>.</p>
121    pub fn identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.identity(input.into());
123        self
124    }
125    /// <p>The identity for which to enable or disable headers in notifications. Examples: <code>user@example.com</code>, <code>example.com</code>.</p>
126    pub fn set_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_identity(input);
128        self
129    }
130    /// <p>The identity for which to enable or disable headers in notifications. Examples: <code>user@example.com</code>, <code>example.com</code>.</p>
131    pub fn get_identity(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_identity()
133    }
134    /// <p>The notification type for which to enable or disable headers in notifications.</p>
135    pub fn notification_type(mut self, input: crate::types::NotificationType) -> Self {
136        self.inner = self.inner.notification_type(input);
137        self
138    }
139    /// <p>The notification type for which to enable or disable headers in notifications.</p>
140    pub fn set_notification_type(mut self, input: ::std::option::Option<crate::types::NotificationType>) -> Self {
141        self.inner = self.inner.set_notification_type(input);
142        self
143    }
144    /// <p>The notification type for which to enable or disable headers in notifications.</p>
145    pub fn get_notification_type(&self) -> &::std::option::Option<crate::types::NotificationType> {
146        self.inner.get_notification_type()
147    }
148    /// <p>Sets whether Amazon SES includes the original email headers in Amazon SNS notifications of the specified notification type. A value of <code>true</code> specifies that Amazon SES includes headers in notifications, and a value of <code>false</code> specifies that Amazon SES does not include headers in notifications.</p>
149    /// <p>This value can only be set when <code>NotificationType</code> is already set to use a particular Amazon SNS topic.</p>
150    pub fn enabled(mut self, input: bool) -> Self {
151        self.inner = self.inner.enabled(input);
152        self
153    }
154    /// <p>Sets whether Amazon SES includes the original email headers in Amazon SNS notifications of the specified notification type. A value of <code>true</code> specifies that Amazon SES includes headers in notifications, and a value of <code>false</code> specifies that Amazon SES does not include headers in notifications.</p>
155    /// <p>This value can only be set when <code>NotificationType</code> is already set to use a particular Amazon SNS topic.</p>
156    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
157        self.inner = self.inner.set_enabled(input);
158        self
159    }
160    /// <p>Sets whether Amazon SES includes the original email headers in Amazon SNS notifications of the specified notification type. A value of <code>true</code> specifies that Amazon SES includes headers in notifications, and a value of <code>false</code> specifies that Amazon SES does not include headers in notifications.</p>
161    /// <p>This value can only be set when <code>NotificationType</code> is already set to use a particular Amazon SNS topic.</p>
162    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
163        self.inner.get_enabled()
164    }
165}