aws_sdk_databasemigration/operation/start_replication_task/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_replication_task::_start_replication_task_output::StartReplicationTaskOutputBuilder;
3
4pub use crate::operation::start_replication_task::_start_replication_task_input::StartReplicationTaskInputBuilder;
5
6impl crate::operation::start_replication_task::builders::StartReplicationTaskInputBuilder {
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::start_replication_task::StartReplicationTaskOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::start_replication_task::StartReplicationTaskError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.start_replication_task();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `StartReplicationTask`.
24///
25/// <p>Starts the replication task.</p>
26/// <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>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct StartReplicationTaskFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::start_replication_task::builders::StartReplicationTaskInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::start_replication_task::StartReplicationTaskOutput,
36 crate::operation::start_replication_task::StartReplicationTaskError,
37 > for StartReplicationTaskFluentBuilder
38{
39 fn send(
40 self,
41 config_override: crate::config::Builder,
42 ) -> crate::client::customize::internal::BoxFuture<
43 crate::client::customize::internal::SendResult<
44 crate::operation::start_replication_task::StartReplicationTaskOutput,
45 crate::operation::start_replication_task::StartReplicationTaskError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl StartReplicationTaskFluentBuilder {
52 /// Creates a new `StartReplicationTaskFluentBuilder`.
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54 Self {
55 handle,
56 inner: ::std::default::Default::default(),
57 config_override: ::std::option::Option::None,
58 }
59 }
60 /// Access the StartReplicationTask as a reference.
61 pub fn as_input(&self) -> &crate::operation::start_replication_task::builders::StartReplicationTaskInputBuilder {
62 &self.inner
63 }
64 /// Sends the request and returns the response.
65 ///
66 /// If an error occurs, an `SdkError` will be returned with additional details that
67 /// can be matched against.
68 ///
69 /// By default, any retryable failures will be retried twice. Retry behavior
70 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71 /// set when configuring the client.
72 pub async fn send(
73 self,
74 ) -> ::std::result::Result<
75 crate::operation::start_replication_task::StartReplicationTaskOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::start_replication_task::StartReplicationTaskError,
78 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79 >,
80 > {
81 let input = self
82 .inner
83 .build()
84 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85 let runtime_plugins = crate::operation::start_replication_task::StartReplicationTask::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::start_replication_task::StartReplicationTask::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::start_replication_task::StartReplicationTaskOutput,
98 crate::operation::start_replication_task::StartReplicationTaskError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// <p>The Amazon Resource Name (ARN) of the replication task to be started.</p>
113 pub fn replication_task_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.replication_task_arn(input.into());
115 self
116 }
117 /// <p>The Amazon Resource Name (ARN) of the replication task to be started.</p>
118 pub fn set_replication_task_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.inner = self.inner.set_replication_task_arn(input);
120 self
121 }
122 /// <p>The Amazon Resource Name (ARN) of the replication task to be started.</p>
123 pub fn get_replication_task_arn(&self) -> &::std::option::Option<::std::string::String> {
124 self.inner.get_replication_task_arn()
125 }
126 /// <p>The type of replication task to start.</p>
127 /// <p><code>start-replication</code> is the only valid action that can be used for the first time a task with the migration type of <code>full-load</code>full-load, <code>full-load-and-cdc</code> or <code>cdc</code> is run. Any other action used for the first time on a given task, such as <code>resume-processing</code> and reload-target will result in data errors.</p>
128 /// <p>You can also use <code>ReloadTables</code> to reload specific tables that failed during migration instead of restarting the task.</p>
129 /// <p>For a <code>full-load</code> task, the resume-processing option will reload any tables that were partially loaded or not yet loaded during the full load phase.</p>
130 /// <p>For a <code>full-load-and-cdc</code> task, DMS migrates table data, and then applies data changes that occur on the source. To load all the tables again, and start capturing source changes, use <code>reload-target</code>. Otherwise use <code>resume-processing</code>, to replicate the changes from the last stop position.</p>
131 /// <p>For a <code>cdc</code> only task, to start from a specific position, you must use start-replication and also specify the start position. Check the source endpoint DMS documentation for any limitations. For example, not all sources support starting from a time.</p><note>
132 /// <p><code>resume-processing</code> is only available for previously executed tasks.</p>
133 /// </note>
134 pub fn start_replication_task_type(mut self, input: crate::types::StartReplicationTaskTypeValue) -> Self {
135 self.inner = self.inner.start_replication_task_type(input);
136 self
137 }
138 /// <p>The type of replication task to start.</p>
139 /// <p><code>start-replication</code> is the only valid action that can be used for the first time a task with the migration type of <code>full-load</code>full-load, <code>full-load-and-cdc</code> or <code>cdc</code> is run. Any other action used for the first time on a given task, such as <code>resume-processing</code> and reload-target will result in data errors.</p>
140 /// <p>You can also use <code>ReloadTables</code> to reload specific tables that failed during migration instead of restarting the task.</p>
141 /// <p>For a <code>full-load</code> task, the resume-processing option will reload any tables that were partially loaded or not yet loaded during the full load phase.</p>
142 /// <p>For a <code>full-load-and-cdc</code> task, DMS migrates table data, and then applies data changes that occur on the source. To load all the tables again, and start capturing source changes, use <code>reload-target</code>. Otherwise use <code>resume-processing</code>, to replicate the changes from the last stop position.</p>
143 /// <p>For a <code>cdc</code> only task, to start from a specific position, you must use start-replication and also specify the start position. Check the source endpoint DMS documentation for any limitations. For example, not all sources support starting from a time.</p><note>
144 /// <p><code>resume-processing</code> is only available for previously executed tasks.</p>
145 /// </note>
146 pub fn set_start_replication_task_type(mut self, input: ::std::option::Option<crate::types::StartReplicationTaskTypeValue>) -> Self {
147 self.inner = self.inner.set_start_replication_task_type(input);
148 self
149 }
150 /// <p>The type of replication task to start.</p>
151 /// <p><code>start-replication</code> is the only valid action that can be used for the first time a task with the migration type of <code>full-load</code>full-load, <code>full-load-and-cdc</code> or <code>cdc</code> is run. Any other action used for the first time on a given task, such as <code>resume-processing</code> and reload-target will result in data errors.</p>
152 /// <p>You can also use <code>ReloadTables</code> to reload specific tables that failed during migration instead of restarting the task.</p>
153 /// <p>For a <code>full-load</code> task, the resume-processing option will reload any tables that were partially loaded or not yet loaded during the full load phase.</p>
154 /// <p>For a <code>full-load-and-cdc</code> task, DMS migrates table data, and then applies data changes that occur on the source. To load all the tables again, and start capturing source changes, use <code>reload-target</code>. Otherwise use <code>resume-processing</code>, to replicate the changes from the last stop position.</p>
155 /// <p>For a <code>cdc</code> only task, to start from a specific position, you must use start-replication and also specify the start position. Check the source endpoint DMS documentation for any limitations. For example, not all sources support starting from a time.</p><note>
156 /// <p><code>resume-processing</code> is only available for previously executed tasks.</p>
157 /// </note>
158 pub fn get_start_replication_task_type(&self) -> &::std::option::Option<crate::types::StartReplicationTaskTypeValue> {
159 self.inner.get_start_replication_task_type()
160 }
161 /// <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>
162 /// <p>Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”</p>
163 pub fn cdc_start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
164 self.inner = self.inner.cdc_start_time(input);
165 self
166 }
167 /// <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>
168 /// <p>Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”</p>
169 pub fn set_cdc_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
170 self.inner = self.inner.set_cdc_start_time(input);
171 self
172 }
173 /// <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>
174 /// <p>Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”</p>
175 pub fn get_cdc_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
176 self.inner.get_cdc_start_time()
177 }
178 /// <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>
179 /// <p>The value can be in date, checkpoint, or LSN/SCN format.</p>
180 /// <p>Date Example: --cdc-start-position “2018-03-08T12:12:12”</p>
181 /// <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>
182 /// <p>LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”</p><note>
183 /// <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>
184 /// </note>
185 pub fn cdc_start_position(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186 self.inner = self.inner.cdc_start_position(input.into());
187 self
188 }
189 /// <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>
190 /// <p>The value can be in date, checkpoint, or LSN/SCN format.</p>
191 /// <p>Date Example: --cdc-start-position “2018-03-08T12:12:12”</p>
192 /// <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>
193 /// <p>LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”</p><note>
194 /// <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>
195 /// </note>
196 pub fn set_cdc_start_position(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197 self.inner = self.inner.set_cdc_start_position(input);
198 self
199 }
200 /// <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>
201 /// <p>The value can be in date, checkpoint, or LSN/SCN format.</p>
202 /// <p>Date Example: --cdc-start-position “2018-03-08T12:12:12”</p>
203 /// <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>
204 /// <p>LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”</p><note>
205 /// <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>
206 /// </note>
207 pub fn get_cdc_start_position(&self) -> &::std::option::Option<::std::string::String> {
208 self.inner.get_cdc_start_position()
209 }
210 /// <p>Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.</p>
211 /// <p>Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”</p>
212 /// <p>Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“</p>
213 pub fn cdc_stop_position(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214 self.inner = self.inner.cdc_stop_position(input.into());
215 self
216 }
217 /// <p>Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.</p>
218 /// <p>Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”</p>
219 /// <p>Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“</p>
220 pub fn set_cdc_stop_position(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221 self.inner = self.inner.set_cdc_stop_position(input);
222 self
223 }
224 /// <p>Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.</p>
225 /// <p>Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”</p>
226 /// <p>Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“</p>
227 pub fn get_cdc_stop_position(&self) -> &::std::option::Option<::std::string::String> {
228 self.inner.get_cdc_stop_position()
229 }
230}