aws_sdk_elasticsearch/operation/create_elasticsearch_domain/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_elasticsearch_domain::_create_elasticsearch_domain_output::CreateElasticsearchDomainOutputBuilder;
3
4pub use crate::operation::create_elasticsearch_domain::_create_elasticsearch_domain_input::CreateElasticsearchDomainInputBuilder;
5
6impl crate::operation::create_elasticsearch_domain::builders::CreateElasticsearchDomainInputBuilder {
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_elasticsearch_domain::CreateElasticsearchDomainOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_elasticsearch_domain::CreateElasticsearchDomainError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_elasticsearch_domain();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateElasticsearchDomain`.
24///
25/// <p>Creates a new Elasticsearch domain. For more information, see <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomains" target="_blank">Creating Elasticsearch Domains</a> in the <i>Amazon Elasticsearch Service Developer Guide</i>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateElasticsearchDomainFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_elasticsearch_domain::builders::CreateElasticsearchDomainInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_elasticsearch_domain::CreateElasticsearchDomainOutput,
35        crate::operation::create_elasticsearch_domain::CreateElasticsearchDomainError,
36    > for CreateElasticsearchDomainFluentBuilder
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::create_elasticsearch_domain::CreateElasticsearchDomainOutput,
44            crate::operation::create_elasticsearch_domain::CreateElasticsearchDomainError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateElasticsearchDomainFluentBuilder {
51    /// Creates a new `CreateElasticsearchDomainFluentBuilder`.
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 CreateElasticsearchDomain as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_elasticsearch_domain::builders::CreateElasticsearchDomainInputBuilder {
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::create_elasticsearch_domain::CreateElasticsearchDomainOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_elasticsearch_domain::CreateElasticsearchDomainError,
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::create_elasticsearch_domain::CreateElasticsearchDomain::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_elasticsearch_domain::CreateElasticsearchDomain::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::create_elasticsearch_domain::CreateElasticsearchDomainOutput,
97        crate::operation::create_elasticsearch_domain::CreateElasticsearchDomainError,
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 name of the Elasticsearch domain that you are creating. Domain names are unique across the domains owned by an account within an AWS region. Domain names must start with a lowercase letter and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).</p>
112    pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.domain_name(input.into());
114        self
115    }
116    /// <p>The name of the Elasticsearch domain that you are creating. Domain names are unique across the domains owned by an account within an AWS region. Domain names must start with a lowercase letter and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).</p>
117    pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_domain_name(input);
119        self
120    }
121    /// <p>The name of the Elasticsearch domain that you are creating. Domain names are unique across the domains owned by an account within an AWS region. Domain names must start with a lowercase letter and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).</p>
122    pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_domain_name()
124    }
125    /// <p>String of format X.Y to specify version for the Elasticsearch domain eg. "1.5" or "2.3". For more information, see <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomains" target="_blank">Creating Elasticsearch Domains</a> in the <i>Amazon Elasticsearch Service Developer Guide</i>.</p>
126    pub fn elasticsearch_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.elasticsearch_version(input.into());
128        self
129    }
130    /// <p>String of format X.Y to specify version for the Elasticsearch domain eg. "1.5" or "2.3". For more information, see <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomains" target="_blank">Creating Elasticsearch Domains</a> in the <i>Amazon Elasticsearch Service Developer Guide</i>.</p>
131    pub fn set_elasticsearch_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_elasticsearch_version(input);
133        self
134    }
135    /// <p>String of format X.Y to specify version for the Elasticsearch domain eg. "1.5" or "2.3". For more information, see <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomains" target="_blank">Creating Elasticsearch Domains</a> in the <i>Amazon Elasticsearch Service Developer Guide</i>.</p>
136    pub fn get_elasticsearch_version(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_elasticsearch_version()
138    }
139    /// <p>Configuration options for an Elasticsearch domain. Specifies the instance type and number of instances in the domain cluster.</p>
140    pub fn elasticsearch_cluster_config(mut self, input: crate::types::ElasticsearchClusterConfig) -> Self {
141        self.inner = self.inner.elasticsearch_cluster_config(input);
142        self
143    }
144    /// <p>Configuration options for an Elasticsearch domain. Specifies the instance type and number of instances in the domain cluster.</p>
145    pub fn set_elasticsearch_cluster_config(mut self, input: ::std::option::Option<crate::types::ElasticsearchClusterConfig>) -> Self {
146        self.inner = self.inner.set_elasticsearch_cluster_config(input);
147        self
148    }
149    /// <p>Configuration options for an Elasticsearch domain. Specifies the instance type and number of instances in the domain cluster.</p>
150    pub fn get_elasticsearch_cluster_config(&self) -> &::std::option::Option<crate::types::ElasticsearchClusterConfig> {
151        self.inner.get_elasticsearch_cluster_config()
152    }
153    /// <p>Options to enable, disable and specify the type and size of EBS storage volumes.</p>
154    pub fn ebs_options(mut self, input: crate::types::EbsOptions) -> Self {
155        self.inner = self.inner.ebs_options(input);
156        self
157    }
158    /// <p>Options to enable, disable and specify the type and size of EBS storage volumes.</p>
159    pub fn set_ebs_options(mut self, input: ::std::option::Option<crate::types::EbsOptions>) -> Self {
160        self.inner = self.inner.set_ebs_options(input);
161        self
162    }
163    /// <p>Options to enable, disable and specify the type and size of EBS storage volumes.</p>
164    pub fn get_ebs_options(&self) -> &::std::option::Option<crate::types::EbsOptions> {
165        self.inner.get_ebs_options()
166    }
167    /// <p>IAM access policy as a JSON-formatted string.</p>
168    pub fn access_policies(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.access_policies(input.into());
170        self
171    }
172    /// <p>IAM access policy as a JSON-formatted string.</p>
173    pub fn set_access_policies(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_access_policies(input);
175        self
176    }
177    /// <p>IAM access policy as a JSON-formatted string.</p>
178    pub fn get_access_policies(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_access_policies()
180    }
181    /// <p>Option to set time, in UTC format, of the daily automated snapshot. Default value is 0 hours.</p>
182    pub fn snapshot_options(mut self, input: crate::types::SnapshotOptions) -> Self {
183        self.inner = self.inner.snapshot_options(input);
184        self
185    }
186    /// <p>Option to set time, in UTC format, of the daily automated snapshot. Default value is 0 hours.</p>
187    pub fn set_snapshot_options(mut self, input: ::std::option::Option<crate::types::SnapshotOptions>) -> Self {
188        self.inner = self.inner.set_snapshot_options(input);
189        self
190    }
191    /// <p>Option to set time, in UTC format, of the daily automated snapshot. Default value is 0 hours.</p>
192    pub fn get_snapshot_options(&self) -> &::std::option::Option<crate::types::SnapshotOptions> {
193        self.inner.get_snapshot_options()
194    }
195    /// <p>Options to specify the subnets and security groups for VPC endpoint. For more information, see <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html#es-creating-vpc" target="_blank">Creating a VPC</a> in <i>VPC Endpoints for Amazon Elasticsearch Service Domains</i></p>
196    pub fn vpc_options(mut self, input: crate::types::VpcOptions) -> Self {
197        self.inner = self.inner.vpc_options(input);
198        self
199    }
200    /// <p>Options to specify the subnets and security groups for VPC endpoint. For more information, see <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html#es-creating-vpc" target="_blank">Creating a VPC</a> in <i>VPC Endpoints for Amazon Elasticsearch Service Domains</i></p>
201    pub fn set_vpc_options(mut self, input: ::std::option::Option<crate::types::VpcOptions>) -> Self {
202        self.inner = self.inner.set_vpc_options(input);
203        self
204    }
205    /// <p>Options to specify the subnets and security groups for VPC endpoint. For more information, see <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html#es-creating-vpc" target="_blank">Creating a VPC</a> in <i>VPC Endpoints for Amazon Elasticsearch Service Domains</i></p>
206    pub fn get_vpc_options(&self) -> &::std::option::Option<crate::types::VpcOptions> {
207        self.inner.get_vpc_options()
208    }
209    /// <p>Options to specify the Cognito user and identity pools for Kibana authentication. For more information, see <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-cognito-auth.html" target="_blank">Amazon Cognito Authentication for Kibana</a>.</p>
210    pub fn cognito_options(mut self, input: crate::types::CognitoOptions) -> Self {
211        self.inner = self.inner.cognito_options(input);
212        self
213    }
214    /// <p>Options to specify the Cognito user and identity pools for Kibana authentication. For more information, see <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-cognito-auth.html" target="_blank">Amazon Cognito Authentication for Kibana</a>.</p>
215    pub fn set_cognito_options(mut self, input: ::std::option::Option<crate::types::CognitoOptions>) -> Self {
216        self.inner = self.inner.set_cognito_options(input);
217        self
218    }
219    /// <p>Options to specify the Cognito user and identity pools for Kibana authentication. For more information, see <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-cognito-auth.html" target="_blank">Amazon Cognito Authentication for Kibana</a>.</p>
220    pub fn get_cognito_options(&self) -> &::std::option::Option<crate::types::CognitoOptions> {
221        self.inner.get_cognito_options()
222    }
223    /// <p>Specifies the Encryption At Rest Options.</p>
224    pub fn encryption_at_rest_options(mut self, input: crate::types::EncryptionAtRestOptions) -> Self {
225        self.inner = self.inner.encryption_at_rest_options(input);
226        self
227    }
228    /// <p>Specifies the Encryption At Rest Options.</p>
229    pub fn set_encryption_at_rest_options(mut self, input: ::std::option::Option<crate::types::EncryptionAtRestOptions>) -> Self {
230        self.inner = self.inner.set_encryption_at_rest_options(input);
231        self
232    }
233    /// <p>Specifies the Encryption At Rest Options.</p>
234    pub fn get_encryption_at_rest_options(&self) -> &::std::option::Option<crate::types::EncryptionAtRestOptions> {
235        self.inner.get_encryption_at_rest_options()
236    }
237    /// <p>Specifies the NodeToNodeEncryptionOptions.</p>
238    pub fn node_to_node_encryption_options(mut self, input: crate::types::NodeToNodeEncryptionOptions) -> Self {
239        self.inner = self.inner.node_to_node_encryption_options(input);
240        self
241    }
242    /// <p>Specifies the NodeToNodeEncryptionOptions.</p>
243    pub fn set_node_to_node_encryption_options(mut self, input: ::std::option::Option<crate::types::NodeToNodeEncryptionOptions>) -> Self {
244        self.inner = self.inner.set_node_to_node_encryption_options(input);
245        self
246    }
247    /// <p>Specifies the NodeToNodeEncryptionOptions.</p>
248    pub fn get_node_to_node_encryption_options(&self) -> &::std::option::Option<crate::types::NodeToNodeEncryptionOptions> {
249        self.inner.get_node_to_node_encryption_options()
250    }
251    ///
252    /// Adds a key-value pair to `AdvancedOptions`.
253    ///
254    /// To override the contents of this collection use [`set_advanced_options`](Self::set_advanced_options).
255    ///
256    /// <p>Option to allow references to indices in an HTTP request body. Must be <code>false</code> when configuring access to individual sub-resources. By default, the value is <code>true</code>. See <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-advanced-options" target="_blank">Configuration Advanced Options</a> for more information.</p>
257    pub fn advanced_options(
258        mut self,
259        k: impl ::std::convert::Into<::std::string::String>,
260        v: impl ::std::convert::Into<::std::string::String>,
261    ) -> Self {
262        self.inner = self.inner.advanced_options(k.into(), v.into());
263        self
264    }
265    /// <p>Option to allow references to indices in an HTTP request body. Must be <code>false</code> when configuring access to individual sub-resources. By default, the value is <code>true</code>. See <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-advanced-options" target="_blank">Configuration Advanced Options</a> for more information.</p>
266    pub fn set_advanced_options(
267        mut self,
268        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
269    ) -> Self {
270        self.inner = self.inner.set_advanced_options(input);
271        self
272    }
273    /// <p>Option to allow references to indices in an HTTP request body. Must be <code>false</code> when configuring access to individual sub-resources. By default, the value is <code>true</code>. See <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-advanced-options" target="_blank">Configuration Advanced Options</a> for more information.</p>
274    pub fn get_advanced_options(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
275        self.inner.get_advanced_options()
276    }
277    ///
278    /// Adds a key-value pair to `LogPublishingOptions`.
279    ///
280    /// To override the contents of this collection use [`set_log_publishing_options`](Self::set_log_publishing_options).
281    ///
282    /// <p>Map of <code>LogType</code> and <code>LogPublishingOption</code>, each containing options to publish a given type of Elasticsearch log.</p>
283    pub fn log_publishing_options(mut self, k: crate::types::LogType, v: crate::types::LogPublishingOption) -> Self {
284        self.inner = self.inner.log_publishing_options(k, v);
285        self
286    }
287    /// <p>Map of <code>LogType</code> and <code>LogPublishingOption</code>, each containing options to publish a given type of Elasticsearch log.</p>
288    pub fn set_log_publishing_options(
289        mut self,
290        input: ::std::option::Option<::std::collections::HashMap<crate::types::LogType, crate::types::LogPublishingOption>>,
291    ) -> Self {
292        self.inner = self.inner.set_log_publishing_options(input);
293        self
294    }
295    /// <p>Map of <code>LogType</code> and <code>LogPublishingOption</code>, each containing options to publish a given type of Elasticsearch log.</p>
296    pub fn get_log_publishing_options(
297        &self,
298    ) -> &::std::option::Option<::std::collections::HashMap<crate::types::LogType, crate::types::LogPublishingOption>> {
299        self.inner.get_log_publishing_options()
300    }
301    /// <p>Options to specify configuration that will be applied to the domain endpoint.</p>
302    pub fn domain_endpoint_options(mut self, input: crate::types::DomainEndpointOptions) -> Self {
303        self.inner = self.inner.domain_endpoint_options(input);
304        self
305    }
306    /// <p>Options to specify configuration that will be applied to the domain endpoint.</p>
307    pub fn set_domain_endpoint_options(mut self, input: ::std::option::Option<crate::types::DomainEndpointOptions>) -> Self {
308        self.inner = self.inner.set_domain_endpoint_options(input);
309        self
310    }
311    /// <p>Options to specify configuration that will be applied to the domain endpoint.</p>
312    pub fn get_domain_endpoint_options(&self) -> &::std::option::Option<crate::types::DomainEndpointOptions> {
313        self.inner.get_domain_endpoint_options()
314    }
315    /// <p>Specifies advanced security options.</p>
316    pub fn advanced_security_options(mut self, input: crate::types::AdvancedSecurityOptionsInput) -> Self {
317        self.inner = self.inner.advanced_security_options(input);
318        self
319    }
320    /// <p>Specifies advanced security options.</p>
321    pub fn set_advanced_security_options(mut self, input: ::std::option::Option<crate::types::AdvancedSecurityOptionsInput>) -> Self {
322        self.inner = self.inner.set_advanced_security_options(input);
323        self
324    }
325    /// <p>Specifies advanced security options.</p>
326    pub fn get_advanced_security_options(&self) -> &::std::option::Option<crate::types::AdvancedSecurityOptionsInput> {
327        self.inner.get_advanced_security_options()
328    }
329    /// <p>Specifies Auto-Tune options.</p>
330    pub fn auto_tune_options(mut self, input: crate::types::AutoTuneOptionsInput) -> Self {
331        self.inner = self.inner.auto_tune_options(input);
332        self
333    }
334    /// <p>Specifies Auto-Tune options.</p>
335    pub fn set_auto_tune_options(mut self, input: ::std::option::Option<crate::types::AutoTuneOptionsInput>) -> Self {
336        self.inner = self.inner.set_auto_tune_options(input);
337        self
338    }
339    /// <p>Specifies Auto-Tune options.</p>
340    pub fn get_auto_tune_options(&self) -> &::std::option::Option<crate::types::AutoTuneOptionsInput> {
341        self.inner.get_auto_tune_options()
342    }
343    ///
344    /// Appends an item to `TagList`.
345    ///
346    /// To override the contents of this collection use [`set_tag_list`](Self::set_tag_list).
347    ///
348    /// <p>A list of <code>Tag</code> added during domain creation.</p>
349    pub fn tag_list(mut self, input: crate::types::Tag) -> Self {
350        self.inner = self.inner.tag_list(input);
351        self
352    }
353    /// <p>A list of <code>Tag</code> added during domain creation.</p>
354    pub fn set_tag_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
355        self.inner = self.inner.set_tag_list(input);
356        self
357    }
358    /// <p>A list of <code>Tag</code> added during domain creation.</p>
359    pub fn get_tag_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
360        self.inner.get_tag_list()
361    }
362}