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>When the migration type is <code>full-load</code> or <code>full-load-and-cdc</code>, the only valid value for the first run of the task is <code>start-replication</code>. This option will start the migration.</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>The <code>resume-processing</code> option isn't applicable for a full-load task, because you can't resume partially loaded tables 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 pub fn start_replication_task_type(mut self, input: crate::types::StartReplicationTaskTypeValue) -> Self {
132 self.inner = self.inner.start_replication_task_type(input);
133 self
134 }
135 /// <p>The type of replication task to start.</p>
136 /// <p>When the migration type is <code>full-load</code> or <code>full-load-and-cdc</code>, the only valid value for the first run of the task is <code>start-replication</code>. This option will start the migration.</p>
137 /// <p>You can also use <code>ReloadTables</code> to reload specific tables that failed during migration instead of restarting the task.</p>
138 /// <p>The <code>resume-processing</code> option isn't applicable for a full-load task, because you can't resume partially loaded tables during the full load phase.</p>
139 /// <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>
140 pub fn set_start_replication_task_type(mut self, input: ::std::option::Option<crate::types::StartReplicationTaskTypeValue>) -> Self {
141 self.inner = self.inner.set_start_replication_task_type(input);
142 self
143 }
144 /// <p>The type of replication task to start.</p>
145 /// <p>When the migration type is <code>full-load</code> or <code>full-load-and-cdc</code>, the only valid value for the first run of the task is <code>start-replication</code>. This option will start the migration.</p>
146 /// <p>You can also use <code>ReloadTables</code> to reload specific tables that failed during migration instead of restarting the task.</p>
147 /// <p>The <code>resume-processing</code> option isn't applicable for a full-load task, because you can't resume partially loaded tables during the full load phase.</p>
148 /// <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>
149 pub fn get_start_replication_task_type(&self) -> &::std::option::Option<crate::types::StartReplicationTaskTypeValue> {
150 self.inner.get_start_replication_task_type()
151 }
152 /// <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>
153 /// <p>Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”</p>
154 pub fn cdc_start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
155 self.inner = self.inner.cdc_start_time(input);
156 self
157 }
158 /// <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>
159 /// <p>Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”</p>
160 pub fn set_cdc_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
161 self.inner = self.inner.set_cdc_start_time(input);
162 self
163 }
164 /// <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>
165 /// <p>Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”</p>
166 pub fn get_cdc_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
167 self.inner.get_cdc_start_time()
168 }
169 /// <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>
170 /// <p>The value can be in date, checkpoint, or LSN/SCN format.</p>
171 /// <p>Date Example: --cdc-start-position “2018-03-08T12:12:12”</p>
172 /// <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>
173 /// <p>LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”</p><note>
174 /// <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>
175 /// </note>
176 pub fn cdc_start_position(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177 self.inner = self.inner.cdc_start_position(input.into());
178 self
179 }
180 /// <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>
181 /// <p>The value can be in date, checkpoint, or LSN/SCN format.</p>
182 /// <p>Date Example: --cdc-start-position “2018-03-08T12:12:12”</p>
183 /// <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>
184 /// <p>LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”</p><note>
185 /// <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>
186 /// </note>
187 pub fn set_cdc_start_position(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188 self.inner = self.inner.set_cdc_start_position(input);
189 self
190 }
191 /// <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>
192 /// <p>The value can be in date, checkpoint, or LSN/SCN format.</p>
193 /// <p>Date Example: --cdc-start-position “2018-03-08T12:12:12”</p>
194 /// <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>
195 /// <p>LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”</p><note>
196 /// <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>
197 /// </note>
198 pub fn get_cdc_start_position(&self) -> &::std::option::Option<::std::string::String> {
199 self.inner.get_cdc_start_position()
200 }
201 /// <p>Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.</p>
202 /// <p>Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”</p>
203 /// <p>Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“</p>
204 pub fn cdc_stop_position(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205 self.inner = self.inner.cdc_stop_position(input.into());
206 self
207 }
208 /// <p>Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.</p>
209 /// <p>Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”</p>
210 /// <p>Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“</p>
211 pub fn set_cdc_stop_position(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212 self.inner = self.inner.set_cdc_stop_position(input);
213 self
214 }
215 /// <p>Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.</p>
216 /// <p>Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”</p>
217 /// <p>Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“</p>
218 pub fn get_cdc_stop_position(&self) -> &::std::option::Option<::std::string::String> {
219 self.inner.get_cdc_stop_position()
220 }
221}