aws_sdk_ses/operation/create_configuration_set_event_destination/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_configuration_set_event_destination::_create_configuration_set_event_destination_output::CreateConfigurationSetEventDestinationOutputBuilder;
3
4pub use crate::operation::create_configuration_set_event_destination::_create_configuration_set_event_destination_input::CreateConfigurationSetEventDestinationInputBuilder;
5
6impl crate::operation::create_configuration_set_event_destination::builders::CreateConfigurationSetEventDestinationInputBuilder {
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::create_configuration_set_event_destination::CreateConfigurationSetEventDestinationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_configuration_set_event_destination::CreateConfigurationSetEventDestinationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_configuration_set_event_destination();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateConfigurationSetEventDestination`.
24///
25/// <p>Creates a configuration set event destination.</p><note>
26/// <p>When you create or update an event destination, you must provide one, and only one, destination. The destination can be CloudWatch, Amazon Kinesis Firehose, or Amazon Simple Notification Service (Amazon SNS).</p>
27/// </note>
28/// <p>An event destination is the Amazon Web Services service to which Amazon SES publishes the email sending events associated with a configuration set. For information about using configuration sets, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity.html">Amazon SES Developer Guide</a>.</p>
29/// <p>You can execute this operation no more than once per second.</p>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct CreateConfigurationSetEventDestinationFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::create_configuration_set_event_destination::builders::CreateConfigurationSetEventDestinationInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37    crate::client::customize::internal::CustomizableSend<
38        crate::operation::create_configuration_set_event_destination::CreateConfigurationSetEventDestinationOutput,
39        crate::operation::create_configuration_set_event_destination::CreateConfigurationSetEventDestinationError,
40    > for CreateConfigurationSetEventDestinationFluentBuilder
41{
42    fn send(
43        self,
44        config_override: crate::config::Builder,
45    ) -> crate::client::customize::internal::BoxFuture<
46        crate::client::customize::internal::SendResult<
47            crate::operation::create_configuration_set_event_destination::CreateConfigurationSetEventDestinationOutput,
48            crate::operation::create_configuration_set_event_destination::CreateConfigurationSetEventDestinationError,
49        >,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl CreateConfigurationSetEventDestinationFluentBuilder {
55    /// Creates a new `CreateConfigurationSetEventDestinationFluentBuilder`.
56    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57        Self {
58            handle,
59            inner: ::std::default::Default::default(),
60            config_override: ::std::option::Option::None,
61        }
62    }
63    /// Access the CreateConfigurationSetEventDestination as a reference.
64    pub fn as_input(
65        &self,
66    ) -> &crate::operation::create_configuration_set_event_destination::builders::CreateConfigurationSetEventDestinationInputBuilder {
67        &self.inner
68    }
69    /// Sends the request and returns the response.
70    ///
71    /// If an error occurs, an `SdkError` will be returned with additional details that
72    /// can be matched against.
73    ///
74    /// By default, any retryable failures will be retried twice. Retry behavior
75    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76    /// set when configuring the client.
77    pub async fn send(
78        self,
79    ) -> ::std::result::Result<
80        crate::operation::create_configuration_set_event_destination::CreateConfigurationSetEventDestinationOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::create_configuration_set_event_destination::CreateConfigurationSetEventDestinationError,
83            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84        >,
85    > {
86        let input = self
87            .inner
88            .build()
89            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90        let runtime_plugins =
91            crate::operation::create_configuration_set_event_destination::CreateConfigurationSetEventDestination::operation_runtime_plugins(
92                self.handle.runtime_plugins.clone(),
93                &self.handle.conf,
94                self.config_override,
95            );
96        crate::operation::create_configuration_set_event_destination::CreateConfigurationSetEventDestination::orchestrate(&runtime_plugins, input)
97            .await
98    }
99
100    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101    pub fn customize(
102        self,
103    ) -> crate::client::customize::CustomizableOperation<
104        crate::operation::create_configuration_set_event_destination::CreateConfigurationSetEventDestinationOutput,
105        crate::operation::create_configuration_set_event_destination::CreateConfigurationSetEventDestinationError,
106        Self,
107    > {
108        crate::client::customize::CustomizableOperation::new(self)
109    }
110    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111        self.set_config_override(::std::option::Option::Some(config_override.into()));
112        self
113    }
114
115    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116        self.config_override = config_override;
117        self
118    }
119    /// <p>The name of the configuration set that the event destination should be associated with.</p>
120    pub fn configuration_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.configuration_set_name(input.into());
122        self
123    }
124    /// <p>The name of the configuration set that the event destination should be associated with.</p>
125    pub fn set_configuration_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_configuration_set_name(input);
127        self
128    }
129    /// <p>The name of the configuration set that the event destination should be associated with.</p>
130    pub fn get_configuration_set_name(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_configuration_set_name()
132    }
133    /// <p>An object that describes the Amazon Web Services service that email sending event where information is published.</p>
134    pub fn event_destination(mut self, input: crate::types::EventDestination) -> Self {
135        self.inner = self.inner.event_destination(input);
136        self
137    }
138    /// <p>An object that describes the Amazon Web Services service that email sending event where information is published.</p>
139    pub fn set_event_destination(mut self, input: ::std::option::Option<crate::types::EventDestination>) -> Self {
140        self.inner = self.inner.set_event_destination(input);
141        self
142    }
143    /// <p>An object that describes the Amazon Web Services service that email sending event where information is published.</p>
144    pub fn get_event_destination(&self) -> &::std::option::Option<crate::types::EventDestination> {
145        self.inner.get_event_destination()
146    }
147}