aws_sdk_databasemigration/operation/create_replication_task/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_replication_task::_create_replication_task_output::CreateReplicationTaskOutputBuilder;
3
4pub use crate::operation::create_replication_task::_create_replication_task_input::CreateReplicationTaskInputBuilder;
5
6impl crate::operation::create_replication_task::builders::CreateReplicationTaskInputBuilder {
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_task::CreateReplicationTaskOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_replication_task::CreateReplicationTaskError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_replication_task();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateReplicationTask`.
24///
25/// <p>Creates a replication task using the specified parameters.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateReplicationTaskFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_replication_task::builders::CreateReplicationTaskInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_replication_task::CreateReplicationTaskOutput,
35        crate::operation::create_replication_task::CreateReplicationTaskError,
36    > for CreateReplicationTaskFluentBuilder
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_task::CreateReplicationTaskOutput,
44            crate::operation::create_replication_task::CreateReplicationTaskError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateReplicationTaskFluentBuilder {
51    /// Creates a new `CreateReplicationTaskFluentBuilder`.
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 CreateReplicationTask as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_replication_task::builders::CreateReplicationTaskInputBuilder {
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_replication_task::CreateReplicationTaskOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_replication_task::CreateReplicationTaskError,
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_replication_task::CreateReplicationTask::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_replication_task::CreateReplicationTask::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_replication_task::CreateReplicationTaskOutput,
97        crate::operation::create_replication_task::CreateReplicationTaskError,
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>An identifier for the replication task.</p>
112    /// <p>Constraints:</p>
113    /// <ul>
114    /// <li>
115    /// <p>Must contain 1-255 alphanumeric characters or hyphens.</p></li>
116    /// <li>
117    /// <p>First character must be a letter.</p></li>
118    /// <li>
119    /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
120    /// </ul>
121    pub fn replication_task_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.replication_task_identifier(input.into());
123        self
124    }
125    /// <p>An identifier for the replication task.</p>
126    /// <p>Constraints:</p>
127    /// <ul>
128    /// <li>
129    /// <p>Must contain 1-255 alphanumeric characters or hyphens.</p></li>
130    /// <li>
131    /// <p>First character must be a letter.</p></li>
132    /// <li>
133    /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
134    /// </ul>
135    pub fn set_replication_task_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_replication_task_identifier(input);
137        self
138    }
139    /// <p>An identifier for the replication task.</p>
140    /// <p>Constraints:</p>
141    /// <ul>
142    /// <li>
143    /// <p>Must contain 1-255 alphanumeric characters or hyphens.</p></li>
144    /// <li>
145    /// <p>First character must be a letter.</p></li>
146    /// <li>
147    /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
148    /// </ul>
149    pub fn get_replication_task_identifier(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_replication_task_identifier()
151    }
152    /// <p>An Amazon Resource Name (ARN) that uniquely identifies the source endpoint.</p>
153    pub fn source_endpoint_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.inner = self.inner.source_endpoint_arn(input.into());
155        self
156    }
157    /// <p>An Amazon Resource Name (ARN) that uniquely identifies the source endpoint.</p>
158    pub fn set_source_endpoint_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.inner = self.inner.set_source_endpoint_arn(input);
160        self
161    }
162    /// <p>An Amazon Resource Name (ARN) that uniquely identifies the source endpoint.</p>
163    pub fn get_source_endpoint_arn(&self) -> &::std::option::Option<::std::string::String> {
164        self.inner.get_source_endpoint_arn()
165    }
166    /// <p>An Amazon Resource Name (ARN) that uniquely identifies the target endpoint.</p>
167    pub fn target_endpoint_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168        self.inner = self.inner.target_endpoint_arn(input.into());
169        self
170    }
171    /// <p>An Amazon Resource Name (ARN) that uniquely identifies the target endpoint.</p>
172    pub fn set_target_endpoint_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173        self.inner = self.inner.set_target_endpoint_arn(input);
174        self
175    }
176    /// <p>An Amazon Resource Name (ARN) that uniquely identifies the target endpoint.</p>
177    pub fn get_target_endpoint_arn(&self) -> &::std::option::Option<::std::string::String> {
178        self.inner.get_target_endpoint_arn()
179    }
180    /// <p>The Amazon Resource Name (ARN) of a replication instance.</p>
181    pub fn replication_instance_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182        self.inner = self.inner.replication_instance_arn(input.into());
183        self
184    }
185    /// <p>The Amazon Resource Name (ARN) of a replication instance.</p>
186    pub fn set_replication_instance_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187        self.inner = self.inner.set_replication_instance_arn(input);
188        self
189    }
190    /// <p>The Amazon Resource Name (ARN) of a replication instance.</p>
191    pub fn get_replication_instance_arn(&self) -> &::std::option::Option<::std::string::String> {
192        self.inner.get_replication_instance_arn()
193    }
194    /// <p>The migration type. Valid values: <code>full-load</code> | <code>cdc</code> | <code>full-load-and-cdc</code></p>
195    pub fn migration_type(mut self, input: crate::types::MigrationTypeValue) -> Self {
196        self.inner = self.inner.migration_type(input);
197        self
198    }
199    /// <p>The migration type. Valid values: <code>full-load</code> | <code>cdc</code> | <code>full-load-and-cdc</code></p>
200    pub fn set_migration_type(mut self, input: ::std::option::Option<crate::types::MigrationTypeValue>) -> Self {
201        self.inner = self.inner.set_migration_type(input);
202        self
203    }
204    /// <p>The migration type. Valid values: <code>full-load</code> | <code>cdc</code> | <code>full-load-and-cdc</code></p>
205    pub fn get_migration_type(&self) -> &::std::option::Option<crate::types::MigrationTypeValue> {
206        self.inner.get_migration_type()
207    }
208    /// <p>The table mappings for the task, in JSON format. For more information, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.html">Using Table Mapping to Specify Task Settings</a> in the <i>Database Migration Service User Guide.</i></p>
209    pub fn table_mappings(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210        self.inner = self.inner.table_mappings(input.into());
211        self
212    }
213    /// <p>The table mappings for the task, in JSON format. For more information, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.html">Using Table Mapping to Specify Task Settings</a> in the <i>Database Migration Service User Guide.</i></p>
214    pub fn set_table_mappings(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
215        self.inner = self.inner.set_table_mappings(input);
216        self
217    }
218    /// <p>The table mappings for the task, in JSON format. For more information, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.html">Using Table Mapping to Specify Task Settings</a> in the <i>Database Migration Service User Guide.</i></p>
219    pub fn get_table_mappings(&self) -> &::std::option::Option<::std::string::String> {
220        self.inner.get_table_mappings()
221    }
222    /// <p>Overall settings for the task, in JSON format. For more information, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html">Specifying Task Settings for Database Migration Service Tasks</a> in the <i>Database Migration Service User Guide.</i></p>
223    pub fn replication_task_settings(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
224        self.inner = self.inner.replication_task_settings(input.into());
225        self
226    }
227    /// <p>Overall settings for the task, in JSON format. For more information, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html">Specifying Task Settings for Database Migration Service Tasks</a> in the <i>Database Migration Service User Guide.</i></p>
228    pub fn set_replication_task_settings(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229        self.inner = self.inner.set_replication_task_settings(input);
230        self
231    }
232    /// <p>Overall settings for the task, in JSON format. For more information, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html">Specifying Task Settings for Database Migration Service Tasks</a> in the <i>Database Migration Service User Guide.</i></p>
233    pub fn get_replication_task_settings(&self) -> &::std::option::Option<::std::string::String> {
234        self.inner.get_replication_task_settings()
235    }
236    /// <p>Indicates the start time for a change data capture (CDC) operation. Use either CdcStartTime or CdcStartPosition to specify when you want a CDC operation to start. Specifying both values results in an error.</p>
237    /// <p>Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”</p>
238    pub fn cdc_start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
239        self.inner = self.inner.cdc_start_time(input);
240        self
241    }
242    /// <p>Indicates the start time for a change data capture (CDC) operation. Use either CdcStartTime or CdcStartPosition to specify when you want a CDC operation to start. Specifying both values results in an error.</p>
243    /// <p>Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”</p>
244    pub fn set_cdc_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
245        self.inner = self.inner.set_cdc_start_time(input);
246        self
247    }
248    /// <p>Indicates the start time for a change data capture (CDC) operation. Use either CdcStartTime or CdcStartPosition to specify when you want a CDC operation to start. Specifying both values results in an error.</p>
249    /// <p>Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”</p>
250    pub fn get_cdc_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
251        self.inner.get_cdc_start_time()
252    }
253    /// <p>Indicates when you want a change data capture (CDC) operation to start. Use either CdcStartPosition or CdcStartTime to specify when you want a CDC operation to start. Specifying both values results in an error.</p>
254    /// <p>The value can be in date, checkpoint, or LSN/SCN format.</p>
255    /// <p>Date Example: --cdc-start-position “2018-03-08T12:12:12”</p>
256    /// <p>Checkpoint Example: --cdc-start-position "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93"</p>
257    /// <p>LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”</p><note>
258    /// <p>When you use this task setting with a source PostgreSQL database, a logical replication slot should already be created and associated with the source endpoint. You can verify this by setting the <code>slotName</code> extra connection attribute to the name of this logical replication slot. For more information, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html#CHAP_Source.PostgreSQL.ConnectionAttrib">Extra Connection Attributes When Using PostgreSQL as a Source for DMS</a>.</p>
259    /// </note>
260    pub fn cdc_start_position(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
261        self.inner = self.inner.cdc_start_position(input.into());
262        self
263    }
264    /// <p>Indicates when you want a change data capture (CDC) operation to start. Use either CdcStartPosition or CdcStartTime to specify when you want a CDC operation to start. Specifying both values results in an error.</p>
265    /// <p>The value can be in date, checkpoint, or LSN/SCN format.</p>
266    /// <p>Date Example: --cdc-start-position “2018-03-08T12:12:12”</p>
267    /// <p>Checkpoint Example: --cdc-start-position "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93"</p>
268    /// <p>LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”</p><note>
269    /// <p>When you use this task setting with a source PostgreSQL database, a logical replication slot should already be created and associated with the source endpoint. You can verify this by setting the <code>slotName</code> extra connection attribute to the name of this logical replication slot. For more information, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html#CHAP_Source.PostgreSQL.ConnectionAttrib">Extra Connection Attributes When Using PostgreSQL as a Source for DMS</a>.</p>
270    /// </note>
271    pub fn set_cdc_start_position(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
272        self.inner = self.inner.set_cdc_start_position(input);
273        self
274    }
275    /// <p>Indicates when you want a change data capture (CDC) operation to start. Use either CdcStartPosition or CdcStartTime to specify when you want a CDC operation to start. Specifying both values results in an error.</p>
276    /// <p>The value can be in date, checkpoint, or LSN/SCN format.</p>
277    /// <p>Date Example: --cdc-start-position “2018-03-08T12:12:12”</p>
278    /// <p>Checkpoint Example: --cdc-start-position "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93"</p>
279    /// <p>LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”</p><note>
280    /// <p>When you use this task setting with a source PostgreSQL database, a logical replication slot should already be created and associated with the source endpoint. You can verify this by setting the <code>slotName</code> extra connection attribute to the name of this logical replication slot. For more information, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html#CHAP_Source.PostgreSQL.ConnectionAttrib">Extra Connection Attributes When Using PostgreSQL as a Source for DMS</a>.</p>
281    /// </note>
282    pub fn get_cdc_start_position(&self) -> &::std::option::Option<::std::string::String> {
283        self.inner.get_cdc_start_position()
284    }
285    /// <p>Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.</p>
286    /// <p>Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”</p>
287    /// <p>Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“</p>
288    pub fn cdc_stop_position(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
289        self.inner = self.inner.cdc_stop_position(input.into());
290        self
291    }
292    /// <p>Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.</p>
293    /// <p>Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”</p>
294    /// <p>Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“</p>
295    pub fn set_cdc_stop_position(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
296        self.inner = self.inner.set_cdc_stop_position(input);
297        self
298    }
299    /// <p>Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.</p>
300    /// <p>Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”</p>
301    /// <p>Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“</p>
302    pub fn get_cdc_stop_position(&self) -> &::std::option::Option<::std::string::String> {
303        self.inner.get_cdc_stop_position()
304    }
305    ///
306    /// Appends an item to `Tags`.
307    ///
308    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
309    ///
310    /// <p>One or more tags to be assigned to the replication task.</p>
311    pub fn tags(mut self, input: crate::types::Tag) -> Self {
312        self.inner = self.inner.tags(input);
313        self
314    }
315    /// <p>One or more tags to be assigned to the replication task.</p>
316    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
317        self.inner = self.inner.set_tags(input);
318        self
319    }
320    /// <p>One or more tags to be assigned to the replication task.</p>
321    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
322        self.inner.get_tags()
323    }
324    /// <p>Supplemental information that the task requires to migrate the data for certain source and target endpoints. For more information, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.TaskData.html">Specifying Supplemental Data for Task Settings</a> in the <i>Database Migration Service User Guide.</i></p>
325    pub fn task_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
326        self.inner = self.inner.task_data(input.into());
327        self
328    }
329    /// <p>Supplemental information that the task requires to migrate the data for certain source and target endpoints. For more information, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.TaskData.html">Specifying Supplemental Data for Task Settings</a> in the <i>Database Migration Service User Guide.</i></p>
330    pub fn set_task_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
331        self.inner = self.inner.set_task_data(input);
332        self
333    }
334    /// <p>Supplemental information that the task requires to migrate the data for certain source and target endpoints. For more information, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.TaskData.html">Specifying Supplemental Data for Task Settings</a> in the <i>Database Migration Service User Guide.</i></p>
335    pub fn get_task_data(&self) -> &::std::option::Option<::std::string::String> {
336        self.inner.get_task_data()
337    }
338    /// <p>A friendly name for the resource identifier at the end of the <code>EndpointArn</code> response parameter that is returned in the created <code>Endpoint</code> object. The value for this parameter can have up to 31 characters. It can contain only ASCII letters, digits, and hyphen ('-'). Also, it can't end with a hyphen or contain two consecutive hyphens, and can only begin with a letter, such as <code>Example-App-ARN1</code>. For example, this value might result in the <code>EndpointArn</code> value <code>arn:aws:dms:eu-west-1:012345678901:rep:Example-App-ARN1</code>. If you don't specify a <code>ResourceIdentifier</code> value, DMS generates a default identifier value for the end of <code>EndpointArn</code>.</p>
339    pub fn resource_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
340        self.inner = self.inner.resource_identifier(input.into());
341        self
342    }
343    /// <p>A friendly name for the resource identifier at the end of the <code>EndpointArn</code> response parameter that is returned in the created <code>Endpoint</code> object. The value for this parameter can have up to 31 characters. It can contain only ASCII letters, digits, and hyphen ('-'). Also, it can't end with a hyphen or contain two consecutive hyphens, and can only begin with a letter, such as <code>Example-App-ARN1</code>. For example, this value might result in the <code>EndpointArn</code> value <code>arn:aws:dms:eu-west-1:012345678901:rep:Example-App-ARN1</code>. If you don't specify a <code>ResourceIdentifier</code> value, DMS generates a default identifier value for the end of <code>EndpointArn</code>.</p>
344    pub fn set_resource_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
345        self.inner = self.inner.set_resource_identifier(input);
346        self
347    }
348    /// <p>A friendly name for the resource identifier at the end of the <code>EndpointArn</code> response parameter that is returned in the created <code>Endpoint</code> object. The value for this parameter can have up to 31 characters. It can contain only ASCII letters, digits, and hyphen ('-'). Also, it can't end with a hyphen or contain two consecutive hyphens, and can only begin with a letter, such as <code>Example-App-ARN1</code>. For example, this value might result in the <code>EndpointArn</code> value <code>arn:aws:dms:eu-west-1:012345678901:rep:Example-App-ARN1</code>. If you don't specify a <code>ResourceIdentifier</code> value, DMS generates a default identifier value for the end of <code>EndpointArn</code>.</p>
349    pub fn get_resource_identifier(&self) -> &::std::option::Option<::std::string::String> {
350        self.inner.get_resource_identifier()
351    }
352}