aws_sdk_databasemigration/operation/modify_replication_task/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::modify_replication_task::_modify_replication_task_output::ModifyReplicationTaskOutputBuilder;
3
4pub use crate::operation::modify_replication_task::_modify_replication_task_input::ModifyReplicationTaskInputBuilder;
5
6impl crate::operation::modify_replication_task::builders::ModifyReplicationTaskInputBuilder {
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::modify_replication_task::ModifyReplicationTaskOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::modify_replication_task::ModifyReplicationTaskError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.modify_replication_task();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ModifyReplicationTask`.
24///
25/// <p>Modifies the specified replication task.</p>
26/// <p>You can't modify the task endpoints. The task must be stopped before you can modify it.</p>
27/// <p>For more information about DMS tasks, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.html">Working with Migration Tasks</a> in the <i>Database Migration Service User Guide</i>.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct ModifyReplicationTaskFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::modify_replication_task::builders::ModifyReplicationTaskInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::modify_replication_task::ModifyReplicationTaskOutput,
37        crate::operation::modify_replication_task::ModifyReplicationTaskError,
38    > for ModifyReplicationTaskFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::modify_replication_task::ModifyReplicationTaskOutput,
46            crate::operation::modify_replication_task::ModifyReplicationTaskError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl ModifyReplicationTaskFluentBuilder {
53    /// Creates a new `ModifyReplicationTaskFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the ModifyReplicationTask as a reference.
62    pub fn as_input(&self) -> &crate::operation::modify_replication_task::builders::ModifyReplicationTaskInputBuilder {
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::modify_replication_task::ModifyReplicationTaskOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::modify_replication_task::ModifyReplicationTaskError,
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 = crate::operation::modify_replication_task::ModifyReplicationTask::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::modify_replication_task::ModifyReplicationTask::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::modify_replication_task::ModifyReplicationTaskOutput,
99        crate::operation::modify_replication_task::ModifyReplicationTaskError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The Amazon Resource Name (ARN) of the replication task.</p>
114    pub fn replication_task_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.replication_task_arn(input.into());
116        self
117    }
118    /// <p>The Amazon Resource Name (ARN) of the replication task.</p>
119    pub fn set_replication_task_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_replication_task_arn(input);
121        self
122    }
123    /// <p>The Amazon Resource Name (ARN) of the replication task.</p>
124    pub fn get_replication_task_arn(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_replication_task_arn()
126    }
127    /// <p>The replication task identifier.</p>
128    /// <p>Constraints:</p>
129    /// <ul>
130    /// <li>
131    /// <p>Must contain 1-255 alphanumeric characters or hyphens.</p></li>
132    /// <li>
133    /// <p>First character must be a letter.</p></li>
134    /// <li>
135    /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
136    /// </ul>
137    pub fn replication_task_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.inner = self.inner.replication_task_identifier(input.into());
139        self
140    }
141    /// <p>The replication task identifier.</p>
142    /// <p>Constraints:</p>
143    /// <ul>
144    /// <li>
145    /// <p>Must contain 1-255 alphanumeric characters or hyphens.</p></li>
146    /// <li>
147    /// <p>First character must be a letter.</p></li>
148    /// <li>
149    /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
150    /// </ul>
151    pub fn set_replication_task_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_replication_task_identifier(input);
153        self
154    }
155    /// <p>The replication task identifier.</p>
156    /// <p>Constraints:</p>
157    /// <ul>
158    /// <li>
159    /// <p>Must contain 1-255 alphanumeric characters or hyphens.</p></li>
160    /// <li>
161    /// <p>First character must be a letter.</p></li>
162    /// <li>
163    /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
164    /// </ul>
165    pub fn get_replication_task_identifier(&self) -> &::std::option::Option<::std::string::String> {
166        self.inner.get_replication_task_identifier()
167    }
168    /// <p>The migration type. Valid values: <code>full-load</code> | <code>cdc</code> | <code>full-load-and-cdc</code></p>
169    pub fn migration_type(mut self, input: crate::types::MigrationTypeValue) -> Self {
170        self.inner = self.inner.migration_type(input);
171        self
172    }
173    /// <p>The migration type. Valid values: <code>full-load</code> | <code>cdc</code> | <code>full-load-and-cdc</code></p>
174    pub fn set_migration_type(mut self, input: ::std::option::Option<crate::types::MigrationTypeValue>) -> Self {
175        self.inner = self.inner.set_migration_type(input);
176        self
177    }
178    /// <p>The migration type. Valid values: <code>full-load</code> | <code>cdc</code> | <code>full-load-and-cdc</code></p>
179    pub fn get_migration_type(&self) -> &::std::option::Option<crate::types::MigrationTypeValue> {
180        self.inner.get_migration_type()
181    }
182    /// <p>When using the CLI or boto3, provide the path of the JSON file that contains the table mappings. Precede the path with <code>file://</code>. For example, <code>--table-mappings file://mappingfile.json</code>. When working with the DMS API, provide the JSON as the parameter value.</p>
183    pub fn table_mappings(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.inner = self.inner.table_mappings(input.into());
185        self
186    }
187    /// <p>When using the CLI or boto3, provide the path of the JSON file that contains the table mappings. Precede the path with <code>file://</code>. For example, <code>--table-mappings file://mappingfile.json</code>. When working with the DMS API, provide the JSON as the parameter value.</p>
188    pub fn set_table_mappings(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.inner = self.inner.set_table_mappings(input);
190        self
191    }
192    /// <p>When using the CLI or boto3, provide the path of the JSON file that contains the table mappings. Precede the path with <code>file://</code>. For example, <code>--table-mappings file://mappingfile.json</code>. When working with the DMS API, provide the JSON as the parameter value.</p>
193    pub fn get_table_mappings(&self) -> &::std::option::Option<::std::string::String> {
194        self.inner.get_table_mappings()
195    }
196    /// <p>JSON file that contains settings for the task, such as task metadata settings.</p>
197    pub fn replication_task_settings(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.inner = self.inner.replication_task_settings(input.into());
199        self
200    }
201    /// <p>JSON file that contains settings for the task, such as task metadata settings.</p>
202    pub fn set_replication_task_settings(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203        self.inner = self.inner.set_replication_task_settings(input);
204        self
205    }
206    /// <p>JSON file that contains settings for the task, such as task metadata settings.</p>
207    pub fn get_replication_task_settings(&self) -> &::std::option::Option<::std::string::String> {
208        self.inner.get_replication_task_settings()
209    }
210    /// <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>
211    /// <p>Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”</p>
212    pub fn cdc_start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
213        self.inner = self.inner.cdc_start_time(input);
214        self
215    }
216    /// <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>
217    /// <p>Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”</p>
218    pub fn set_cdc_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
219        self.inner = self.inner.set_cdc_start_time(input);
220        self
221    }
222    /// <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>
223    /// <p>Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”</p>
224    pub fn get_cdc_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
225        self.inner.get_cdc_start_time()
226    }
227    /// <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>
228    /// <p>The value can be in date, checkpoint, or LSN/SCN format.</p>
229    /// <p>Date Example: --cdc-start-position “2018-03-08T12:12:12”</p>
230    /// <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>
231    /// <p>LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”</p><note>
232    /// <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>
233    /// </note>
234    pub fn cdc_start_position(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235        self.inner = self.inner.cdc_start_position(input.into());
236        self
237    }
238    /// <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>
239    /// <p>The value can be in date, checkpoint, or LSN/SCN format.</p>
240    /// <p>Date Example: --cdc-start-position “2018-03-08T12:12:12”</p>
241    /// <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>
242    /// <p>LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”</p><note>
243    /// <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>
244    /// </note>
245    pub fn set_cdc_start_position(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
246        self.inner = self.inner.set_cdc_start_position(input);
247        self
248    }
249    /// <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>
250    /// <p>The value can be in date, checkpoint, or LSN/SCN format.</p>
251    /// <p>Date Example: --cdc-start-position “2018-03-08T12:12:12”</p>
252    /// <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>
253    /// <p>LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”</p><note>
254    /// <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>
255    /// </note>
256    pub fn get_cdc_start_position(&self) -> &::std::option::Option<::std::string::String> {
257        self.inner.get_cdc_start_position()
258    }
259    /// <p>Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.</p>
260    /// <p>Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”</p>
261    /// <p>Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“</p>
262    pub fn cdc_stop_position(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
263        self.inner = self.inner.cdc_stop_position(input.into());
264        self
265    }
266    /// <p>Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.</p>
267    /// <p>Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”</p>
268    /// <p>Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“</p>
269    pub fn set_cdc_stop_position(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
270        self.inner = self.inner.set_cdc_stop_position(input);
271        self
272    }
273    /// <p>Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.</p>
274    /// <p>Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”</p>
275    /// <p>Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“</p>
276    pub fn get_cdc_stop_position(&self) -> &::std::option::Option<::std::string::String> {
277        self.inner.get_cdc_stop_position()
278    }
279    /// <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>
280    pub fn task_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
281        self.inner = self.inner.task_data(input.into());
282        self
283    }
284    /// <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>
285    pub fn set_task_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
286        self.inner = self.inner.set_task_data(input);
287        self
288    }
289    /// <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>
290    pub fn get_task_data(&self) -> &::std::option::Option<::std::string::String> {
291        self.inner.get_task_data()
292    }
293}