aws_sdk_sesv2/operation/create_email_identity/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_email_identity::_create_email_identity_output::CreateEmailIdentityOutputBuilder;
3
4pub use crate::operation::create_email_identity::_create_email_identity_input::CreateEmailIdentityInputBuilder;
5
6impl crate::operation::create_email_identity::builders::CreateEmailIdentityInputBuilder {
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_email_identity::CreateEmailIdentityOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_email_identity::CreateEmailIdentityError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_email_identity();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateEmailIdentity`.
24///
25/// <p>Starts the process of verifying an email identity. An <i>identity</i> is an email address or domain that you use when you send email. Before you can use an identity to send email, you first have to verify it. By verifying an identity, you demonstrate that you're the owner of the identity, and that you've given Amazon SES API v2 permission to send email from the identity.</p>
26/// <p>When you verify an email address, Amazon SES sends an email to the address. Your email address is verified as soon as you follow the link in the verification email.</p>
27/// <p>When you verify a domain without specifying the <code>DkimSigningAttributes</code> object, this operation provides a set of DKIM tokens. You can convert these tokens into CNAME records, which you then add to the DNS configuration for your domain. Your domain is verified when Amazon SES detects these records in the DNS configuration for your domain. This verification method is known as <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html">Easy DKIM</a>.</p>
28/// <p>Alternatively, you can perform the verification process by providing your own public-private key pair. This verification method is known as Bring Your Own DKIM (BYODKIM). To use BYODKIM, your call to the <code>CreateEmailIdentity</code> operation has to include the <code>DkimSigningAttributes</code> object. When you specify this object, you provide a selector (a component of the DNS record name that identifies the public key to use for DKIM authentication) and a private key.</p>
29/// <p>When you verify a domain, this operation provides a set of DKIM tokens, which you can convert into CNAME tokens. You add these CNAME tokens to the DNS configuration for your domain. Your domain is verified when Amazon SES detects these records in the DNS configuration for your domain. For some DNS providers, it can take 72 hours or more to complete the domain verification process.</p>
30/// <p>Additionally, you can associate an existing configuration set with the email identity that you're verifying.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct CreateEmailIdentityFluentBuilder {
33 handle: ::std::sync::Arc<crate::client::Handle>,
34 inner: crate::operation::create_email_identity::builders::CreateEmailIdentityInputBuilder,
35 config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38 crate::client::customize::internal::CustomizableSend<
39 crate::operation::create_email_identity::CreateEmailIdentityOutput,
40 crate::operation::create_email_identity::CreateEmailIdentityError,
41 > for CreateEmailIdentityFluentBuilder
42{
43 fn send(
44 self,
45 config_override: crate::config::Builder,
46 ) -> crate::client::customize::internal::BoxFuture<
47 crate::client::customize::internal::SendResult<
48 crate::operation::create_email_identity::CreateEmailIdentityOutput,
49 crate::operation::create_email_identity::CreateEmailIdentityError,
50 >,
51 > {
52 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53 }
54}
55impl CreateEmailIdentityFluentBuilder {
56 /// Creates a new `CreateEmailIdentityFluentBuilder`.
57 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58 Self {
59 handle,
60 inner: ::std::default::Default::default(),
61 config_override: ::std::option::Option::None,
62 }
63 }
64 /// Access the CreateEmailIdentity as a reference.
65 pub fn as_input(&self) -> &crate::operation::create_email_identity::builders::CreateEmailIdentityInputBuilder {
66 &self.inner
67 }
68 /// Sends the request and returns the response.
69 ///
70 /// If an error occurs, an `SdkError` will be returned with additional details that
71 /// can be matched against.
72 ///
73 /// By default, any retryable failures will be retried twice. Retry behavior
74 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75 /// set when configuring the client.
76 pub async fn send(
77 self,
78 ) -> ::std::result::Result<
79 crate::operation::create_email_identity::CreateEmailIdentityOutput,
80 ::aws_smithy_runtime_api::client::result::SdkError<
81 crate::operation::create_email_identity::CreateEmailIdentityError,
82 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83 >,
84 > {
85 let input = self
86 .inner
87 .build()
88 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89 let runtime_plugins = crate::operation::create_email_identity::CreateEmailIdentity::operation_runtime_plugins(
90 self.handle.runtime_plugins.clone(),
91 &self.handle.conf,
92 self.config_override,
93 );
94 crate::operation::create_email_identity::CreateEmailIdentity::orchestrate(&runtime_plugins, input).await
95 }
96
97 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98 pub fn customize(
99 self,
100 ) -> crate::client::customize::CustomizableOperation<
101 crate::operation::create_email_identity::CreateEmailIdentityOutput,
102 crate::operation::create_email_identity::CreateEmailIdentityError,
103 Self,
104 > {
105 crate::client::customize::CustomizableOperation::new(self)
106 }
107 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108 self.set_config_override(::std::option::Option::Some(config_override.into()));
109 self
110 }
111
112 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113 self.config_override = config_override;
114 self
115 }
116 /// <p>The email address or domain to verify.</p>
117 pub fn email_identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118 self.inner = self.inner.email_identity(input.into());
119 self
120 }
121 /// <p>The email address or domain to verify.</p>
122 pub fn set_email_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123 self.inner = self.inner.set_email_identity(input);
124 self
125 }
126 /// <p>The email address or domain to verify.</p>
127 pub fn get_email_identity(&self) -> &::std::option::Option<::std::string::String> {
128 self.inner.get_email_identity()
129 }
130 ///
131 /// Appends an item to `Tags`.
132 ///
133 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
134 ///
135 /// <p>An array of objects that define the tags (keys and values) to associate with the email identity.</p>
136 pub fn tags(mut self, input: crate::types::Tag) -> Self {
137 self.inner = self.inner.tags(input);
138 self
139 }
140 /// <p>An array of objects that define the tags (keys and values) to associate with the email identity.</p>
141 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
142 self.inner = self.inner.set_tags(input);
143 self
144 }
145 /// <p>An array of objects that define the tags (keys and values) to associate with the email identity.</p>
146 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
147 self.inner.get_tags()
148 }
149 /// <p>If your request includes this object, Amazon SES configures the identity to use Bring Your Own DKIM (BYODKIM) for DKIM authentication purposes, or, configures the key length to be used for <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html">Easy DKIM</a>.</p>
150 /// <p>You can only specify this object if the email identity is a domain, as opposed to an address.</p>
151 pub fn dkim_signing_attributes(mut self, input: crate::types::DkimSigningAttributes) -> Self {
152 self.inner = self.inner.dkim_signing_attributes(input);
153 self
154 }
155 /// <p>If your request includes this object, Amazon SES configures the identity to use Bring Your Own DKIM (BYODKIM) for DKIM authentication purposes, or, configures the key length to be used for <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html">Easy DKIM</a>.</p>
156 /// <p>You can only specify this object if the email identity is a domain, as opposed to an address.</p>
157 pub fn set_dkim_signing_attributes(mut self, input: ::std::option::Option<crate::types::DkimSigningAttributes>) -> Self {
158 self.inner = self.inner.set_dkim_signing_attributes(input);
159 self
160 }
161 /// <p>If your request includes this object, Amazon SES configures the identity to use Bring Your Own DKIM (BYODKIM) for DKIM authentication purposes, or, configures the key length to be used for <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html">Easy DKIM</a>.</p>
162 /// <p>You can only specify this object if the email identity is a domain, as opposed to an address.</p>
163 pub fn get_dkim_signing_attributes(&self) -> &::std::option::Option<crate::types::DkimSigningAttributes> {
164 self.inner.get_dkim_signing_attributes()
165 }
166 /// <p>The configuration set to use by default when sending from this identity. Note that any configuration set defined in the email sending request takes precedence.</p>
167 pub fn configuration_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168 self.inner = self.inner.configuration_set_name(input.into());
169 self
170 }
171 /// <p>The configuration set to use by default when sending from this identity. Note that any configuration set defined in the email sending request takes precedence.</p>
172 pub fn set_configuration_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173 self.inner = self.inner.set_configuration_set_name(input);
174 self
175 }
176 /// <p>The configuration set to use by default when sending from this identity. Note that any configuration set defined in the email sending request takes precedence.</p>
177 pub fn get_configuration_set_name(&self) -> &::std::option::Option<::std::string::String> {
178 self.inner.get_configuration_set_name()
179 }
180}