aws_sdk_drs/operation/create_replication_configuration_template/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_replication_configuration_template::_create_replication_configuration_template_output::CreateReplicationConfigurationTemplateOutputBuilder;
3
4pub use crate::operation::create_replication_configuration_template::_create_replication_configuration_template_input::CreateReplicationConfigurationTemplateInputBuilder;
5
6impl crate::operation::create_replication_configuration_template::builders::CreateReplicationConfigurationTemplateInputBuilder {
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_replication_configuration_template::CreateReplicationConfigurationTemplateOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_replication_configuration_template::CreateReplicationConfigurationTemplateError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_replication_configuration_template();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateReplicationConfigurationTemplate`.
24///
25/// <p>Creates a new ReplicationConfigurationTemplate.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateReplicationConfigurationTemplateFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_replication_configuration_template::builders::CreateReplicationConfigurationTemplateInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_replication_configuration_template::CreateReplicationConfigurationTemplateOutput,
35        crate::operation::create_replication_configuration_template::CreateReplicationConfigurationTemplateError,
36    > for CreateReplicationConfigurationTemplateFluentBuilder
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_replication_configuration_template::CreateReplicationConfigurationTemplateOutput,
44            crate::operation::create_replication_configuration_template::CreateReplicationConfigurationTemplateError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateReplicationConfigurationTemplateFluentBuilder {
51    /// Creates a new `CreateReplicationConfigurationTemplateFluentBuilder`.
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 CreateReplicationConfigurationTemplate as a reference.
60    pub fn as_input(
61        &self,
62    ) -> &crate::operation::create_replication_configuration_template::builders::CreateReplicationConfigurationTemplateInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::create_replication_configuration_template::CreateReplicationConfigurationTemplateOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::create_replication_configuration_template::CreateReplicationConfigurationTemplateError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins =
87            crate::operation::create_replication_configuration_template::CreateReplicationConfigurationTemplate::operation_runtime_plugins(
88                self.handle.runtime_plugins.clone(),
89                &self.handle.conf,
90                self.config_override,
91            );
92        crate::operation::create_replication_configuration_template::CreateReplicationConfigurationTemplate::orchestrate(&runtime_plugins, input)
93            .await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<
100        crate::operation::create_replication_configuration_template::CreateReplicationConfigurationTemplateOutput,
101        crate::operation::create_replication_configuration_template::CreateReplicationConfigurationTemplateError,
102        Self,
103    > {
104        crate::client::customize::CustomizableOperation::new(self)
105    }
106    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107        self.set_config_override(::std::option::Option::Some(config_override.into()));
108        self
109    }
110
111    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112        self.config_override = config_override;
113        self
114    }
115    /// <p>The subnet to be used by the replication staging area.</p>
116    pub fn staging_area_subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.inner = self.inner.staging_area_subnet_id(input.into());
118        self
119    }
120    /// <p>The subnet to be used by the replication staging area.</p>
121    pub fn set_staging_area_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_staging_area_subnet_id(input);
123        self
124    }
125    /// <p>The subnet to be used by the replication staging area.</p>
126    pub fn get_staging_area_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
127        self.inner.get_staging_area_subnet_id()
128    }
129    /// <p>Whether to associate the default Elastic Disaster Recovery Security group with the Replication Configuration Template.</p>
130    pub fn associate_default_security_group(mut self, input: bool) -> Self {
131        self.inner = self.inner.associate_default_security_group(input);
132        self
133    }
134    /// <p>Whether to associate the default Elastic Disaster Recovery Security group with the Replication Configuration Template.</p>
135    pub fn set_associate_default_security_group(mut self, input: ::std::option::Option<bool>) -> Self {
136        self.inner = self.inner.set_associate_default_security_group(input);
137        self
138    }
139    /// <p>Whether to associate the default Elastic Disaster Recovery Security group with the Replication Configuration Template.</p>
140    pub fn get_associate_default_security_group(&self) -> &::std::option::Option<bool> {
141        self.inner.get_associate_default_security_group()
142    }
143    ///
144    /// Appends an item to `replicationServersSecurityGroupsIDs`.
145    ///
146    /// To override the contents of this collection use [`set_replication_servers_security_groups_ids`](Self::set_replication_servers_security_groups_ids).
147    ///
148    /// <p>The security group IDs that will be used by the replication server.</p>
149    pub fn replication_servers_security_groups_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.inner = self.inner.replication_servers_security_groups_ids(input.into());
151        self
152    }
153    /// <p>The security group IDs that will be used by the replication server.</p>
154    pub fn set_replication_servers_security_groups_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
155        self.inner = self.inner.set_replication_servers_security_groups_ids(input);
156        self
157    }
158    /// <p>The security group IDs that will be used by the replication server.</p>
159    pub fn get_replication_servers_security_groups_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
160        self.inner.get_replication_servers_security_groups_ids()
161    }
162    /// <p>The instance type to be used for the replication server.</p>
163    pub fn replication_server_instance_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.inner = self.inner.replication_server_instance_type(input.into());
165        self
166    }
167    /// <p>The instance type to be used for the replication server.</p>
168    pub fn set_replication_server_instance_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169        self.inner = self.inner.set_replication_server_instance_type(input);
170        self
171    }
172    /// <p>The instance type to be used for the replication server.</p>
173    pub fn get_replication_server_instance_type(&self) -> &::std::option::Option<::std::string::String> {
174        self.inner.get_replication_server_instance_type()
175    }
176    /// <p>Whether to use a dedicated Replication Server in the replication staging area.</p>
177    pub fn use_dedicated_replication_server(mut self, input: bool) -> Self {
178        self.inner = self.inner.use_dedicated_replication_server(input);
179        self
180    }
181    /// <p>Whether to use a dedicated Replication Server in the replication staging area.</p>
182    pub fn set_use_dedicated_replication_server(mut self, input: ::std::option::Option<bool>) -> Self {
183        self.inner = self.inner.set_use_dedicated_replication_server(input);
184        self
185    }
186    /// <p>Whether to use a dedicated Replication Server in the replication staging area.</p>
187    pub fn get_use_dedicated_replication_server(&self) -> &::std::option::Option<bool> {
188        self.inner.get_use_dedicated_replication_server()
189    }
190    /// <p>The Staging Disk EBS volume type to be used during replication.</p>
191    pub fn default_large_staging_disk_type(mut self, input: crate::types::ReplicationConfigurationDefaultLargeStagingDiskType) -> Self {
192        self.inner = self.inner.default_large_staging_disk_type(input);
193        self
194    }
195    /// <p>The Staging Disk EBS volume type to be used during replication.</p>
196    pub fn set_default_large_staging_disk_type(
197        mut self,
198        input: ::std::option::Option<crate::types::ReplicationConfigurationDefaultLargeStagingDiskType>,
199    ) -> Self {
200        self.inner = self.inner.set_default_large_staging_disk_type(input);
201        self
202    }
203    /// <p>The Staging Disk EBS volume type to be used during replication.</p>
204    pub fn get_default_large_staging_disk_type(&self) -> &::std::option::Option<crate::types::ReplicationConfigurationDefaultLargeStagingDiskType> {
205        self.inner.get_default_large_staging_disk_type()
206    }
207    /// <p>The type of EBS encryption to be used during replication.</p>
208    pub fn ebs_encryption(mut self, input: crate::types::ReplicationConfigurationEbsEncryption) -> Self {
209        self.inner = self.inner.ebs_encryption(input);
210        self
211    }
212    /// <p>The type of EBS encryption to be used during replication.</p>
213    pub fn set_ebs_encryption(mut self, input: ::std::option::Option<crate::types::ReplicationConfigurationEbsEncryption>) -> Self {
214        self.inner = self.inner.set_ebs_encryption(input);
215        self
216    }
217    /// <p>The type of EBS encryption to be used during replication.</p>
218    pub fn get_ebs_encryption(&self) -> &::std::option::Option<crate::types::ReplicationConfigurationEbsEncryption> {
219        self.inner.get_ebs_encryption()
220    }
221    /// <p>The ARN of the EBS encryption key to be used during replication.</p>
222    pub fn ebs_encryption_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223        self.inner = self.inner.ebs_encryption_key_arn(input.into());
224        self
225    }
226    /// <p>The ARN of the EBS encryption key to be used during replication.</p>
227    pub fn set_ebs_encryption_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
228        self.inner = self.inner.set_ebs_encryption_key_arn(input);
229        self
230    }
231    /// <p>The ARN of the EBS encryption key to be used during replication.</p>
232    pub fn get_ebs_encryption_key_arn(&self) -> &::std::option::Option<::std::string::String> {
233        self.inner.get_ebs_encryption_key_arn()
234    }
235    /// <p>Configure bandwidth throttling for the outbound data transfer rate of the Source Server in Mbps.</p>
236    pub fn bandwidth_throttling(mut self, input: i64) -> Self {
237        self.inner = self.inner.bandwidth_throttling(input);
238        self
239    }
240    /// <p>Configure bandwidth throttling for the outbound data transfer rate of the Source Server in Mbps.</p>
241    pub fn set_bandwidth_throttling(mut self, input: ::std::option::Option<i64>) -> Self {
242        self.inner = self.inner.set_bandwidth_throttling(input);
243        self
244    }
245    /// <p>Configure bandwidth throttling for the outbound data transfer rate of the Source Server in Mbps.</p>
246    pub fn get_bandwidth_throttling(&self) -> &::std::option::Option<i64> {
247        self.inner.get_bandwidth_throttling()
248    }
249    /// <p>The data plane routing mechanism that will be used for replication.</p>
250    pub fn data_plane_routing(mut self, input: crate::types::ReplicationConfigurationDataPlaneRouting) -> Self {
251        self.inner = self.inner.data_plane_routing(input);
252        self
253    }
254    /// <p>The data plane routing mechanism that will be used for replication.</p>
255    pub fn set_data_plane_routing(mut self, input: ::std::option::Option<crate::types::ReplicationConfigurationDataPlaneRouting>) -> Self {
256        self.inner = self.inner.set_data_plane_routing(input);
257        self
258    }
259    /// <p>The data plane routing mechanism that will be used for replication.</p>
260    pub fn get_data_plane_routing(&self) -> &::std::option::Option<crate::types::ReplicationConfigurationDataPlaneRouting> {
261        self.inner.get_data_plane_routing()
262    }
263    /// <p>Whether to create a Public IP for the Recovery Instance by default.</p>
264    pub fn create_public_ip(mut self, input: bool) -> Self {
265        self.inner = self.inner.create_public_ip(input);
266        self
267    }
268    /// <p>Whether to create a Public IP for the Recovery Instance by default.</p>
269    pub fn set_create_public_ip(mut self, input: ::std::option::Option<bool>) -> Self {
270        self.inner = self.inner.set_create_public_ip(input);
271        self
272    }
273    /// <p>Whether to create a Public IP for the Recovery Instance by default.</p>
274    pub fn get_create_public_ip(&self) -> &::std::option::Option<bool> {
275        self.inner.get_create_public_ip()
276    }
277    ///
278    /// Adds a key-value pair to `stagingAreaTags`.
279    ///
280    /// To override the contents of this collection use [`set_staging_area_tags`](Self::set_staging_area_tags).
281    ///
282    /// <p>A set of tags to be associated with all resources created in the replication staging area: EC2 replication server, EBS volumes, EBS snapshots, etc.</p>
283    pub fn staging_area_tags(
284        mut self,
285        k: impl ::std::convert::Into<::std::string::String>,
286        v: impl ::std::convert::Into<::std::string::String>,
287    ) -> Self {
288        self.inner = self.inner.staging_area_tags(k.into(), v.into());
289        self
290    }
291    /// <p>A set of tags to be associated with all resources created in the replication staging area: EC2 replication server, EBS volumes, EBS snapshots, etc.</p>
292    pub fn set_staging_area_tags(
293        mut self,
294        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
295    ) -> Self {
296        self.inner = self.inner.set_staging_area_tags(input);
297        self
298    }
299    /// <p>A set of tags to be associated with all resources created in the replication staging area: EC2 replication server, EBS volumes, EBS snapshots, etc.</p>
300    pub fn get_staging_area_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
301        self.inner.get_staging_area_tags()
302    }
303    ///
304    /// Appends an item to `pitPolicy`.
305    ///
306    /// To override the contents of this collection use [`set_pit_policy`](Self::set_pit_policy).
307    ///
308    /// <p>The Point in time (PIT) policy to manage snapshots taken during replication.</p>
309    pub fn pit_policy(mut self, input: crate::types::PitPolicyRule) -> Self {
310        self.inner = self.inner.pit_policy(input);
311        self
312    }
313    /// <p>The Point in time (PIT) policy to manage snapshots taken during replication.</p>
314    pub fn set_pit_policy(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PitPolicyRule>>) -> Self {
315        self.inner = self.inner.set_pit_policy(input);
316        self
317    }
318    /// <p>The Point in time (PIT) policy to manage snapshots taken during replication.</p>
319    pub fn get_pit_policy(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PitPolicyRule>> {
320        self.inner.get_pit_policy()
321    }
322    ///
323    /// Adds a key-value pair to `tags`.
324    ///
325    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
326    ///
327    /// <p>A set of tags to be associated with the Replication Configuration Template resource.</p>
328    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
329        self.inner = self.inner.tags(k.into(), v.into());
330        self
331    }
332    /// <p>A set of tags to be associated with the Replication Configuration Template resource.</p>
333    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
334        self.inner = self.inner.set_tags(input);
335        self
336    }
337    /// <p>A set of tags to be associated with the Replication Configuration Template resource.</p>
338    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
339        self.inner.get_tags()
340    }
341    /// <p>Whether to allow the AWS replication agent to automatically replicate newly added disks.</p>
342    pub fn auto_replicate_new_disks(mut self, input: bool) -> Self {
343        self.inner = self.inner.auto_replicate_new_disks(input);
344        self
345    }
346    /// <p>Whether to allow the AWS replication agent to automatically replicate newly added disks.</p>
347    pub fn set_auto_replicate_new_disks(mut self, input: ::std::option::Option<bool>) -> Self {
348        self.inner = self.inner.set_auto_replicate_new_disks(input);
349        self
350    }
351    /// <p>Whether to allow the AWS replication agent to automatically replicate newly added disks.</p>
352    pub fn get_auto_replicate_new_disks(&self) -> &::std::option::Option<bool> {
353        self.inner.get_auto_replicate_new_disks()
354    }
355}