aws_sdk_databasemigration/operation/create_data_migration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_data_migration::_create_data_migration_output::CreateDataMigrationOutputBuilder;
3
4pub use crate::operation::create_data_migration::_create_data_migration_input::CreateDataMigrationInputBuilder;
5
6impl crate::operation::create_data_migration::builders::CreateDataMigrationInputBuilder {
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_data_migration::CreateDataMigrationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_data_migration::CreateDataMigrationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_data_migration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateDataMigration`.
24///
25/// <p>Creates a data migration using the provided settings.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateDataMigrationFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_data_migration::builders::CreateDataMigrationInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_data_migration::CreateDataMigrationOutput,
35        crate::operation::create_data_migration::CreateDataMigrationError,
36    > for CreateDataMigrationFluentBuilder
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_data_migration::CreateDataMigrationOutput,
44            crate::operation::create_data_migration::CreateDataMigrationError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateDataMigrationFluentBuilder {
51    /// Creates a new `CreateDataMigrationFluentBuilder`.
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 CreateDataMigration as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_data_migration::builders::CreateDataMigrationInputBuilder {
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_data_migration::CreateDataMigrationOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_data_migration::CreateDataMigrationError,
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_data_migration::CreateDataMigration::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_data_migration::CreateDataMigration::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_data_migration::CreateDataMigrationOutput,
97        crate::operation::create_data_migration::CreateDataMigrationError,
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>A user-friendly name for the data migration. Data migration names have the following constraints:</p>
112    /// <ul>
113    /// <li>
114    /// <p>Must begin with a letter, and can only contain ASCII letters, digits, and hyphens.</p></li>
115    /// <li>
116    /// <p>Can't end with a hyphen or contain two consecutive hyphens.</p></li>
117    /// <li>
118    /// <p>Length must be from 1 to 255 characters.</p></li>
119    /// </ul>
120    pub fn data_migration_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.data_migration_name(input.into());
122        self
123    }
124    /// <p>A user-friendly name for the data migration. Data migration names have the following constraints:</p>
125    /// <ul>
126    /// <li>
127    /// <p>Must begin with a letter, and can only contain ASCII letters, digits, and hyphens.</p></li>
128    /// <li>
129    /// <p>Can't end with a hyphen or contain two consecutive hyphens.</p></li>
130    /// <li>
131    /// <p>Length must be from 1 to 255 characters.</p></li>
132    /// </ul>
133    pub fn set_data_migration_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_data_migration_name(input);
135        self
136    }
137    /// <p>A user-friendly name for the data migration. Data migration names have the following constraints:</p>
138    /// <ul>
139    /// <li>
140    /// <p>Must begin with a letter, and can only contain ASCII letters, digits, and hyphens.</p></li>
141    /// <li>
142    /// <p>Can't end with a hyphen or contain two consecutive hyphens.</p></li>
143    /// <li>
144    /// <p>Length must be from 1 to 255 characters.</p></li>
145    /// </ul>
146    pub fn get_data_migration_name(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_data_migration_name()
148    }
149    /// <p>An identifier for the migration project.</p>
150    pub fn migration_project_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.migration_project_identifier(input.into());
152        self
153    }
154    /// <p>An identifier for the migration project.</p>
155    pub fn set_migration_project_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_migration_project_identifier(input);
157        self
158    }
159    /// <p>An identifier for the migration project.</p>
160    pub fn get_migration_project_identifier(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_migration_project_identifier()
162    }
163    /// <p>Specifies if the data migration is full-load only, change data capture (CDC) only, or full-load and CDC.</p>
164    pub fn data_migration_type(mut self, input: crate::types::MigrationTypeValue) -> Self {
165        self.inner = self.inner.data_migration_type(input);
166        self
167    }
168    /// <p>Specifies if the data migration is full-load only, change data capture (CDC) only, or full-load and CDC.</p>
169    pub fn set_data_migration_type(mut self, input: ::std::option::Option<crate::types::MigrationTypeValue>) -> Self {
170        self.inner = self.inner.set_data_migration_type(input);
171        self
172    }
173    /// <p>Specifies if the data migration is full-load only, change data capture (CDC) only, or full-load and CDC.</p>
174    pub fn get_data_migration_type(&self) -> &::std::option::Option<crate::types::MigrationTypeValue> {
175        self.inner.get_data_migration_type()
176    }
177    /// <p>The Amazon Resource Name (ARN) for the service access role that you want to use to create the data migration.</p>
178    pub fn service_access_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179        self.inner = self.inner.service_access_role_arn(input.into());
180        self
181    }
182    /// <p>The Amazon Resource Name (ARN) for the service access role that you want to use to create the data migration.</p>
183    pub fn set_service_access_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184        self.inner = self.inner.set_service_access_role_arn(input);
185        self
186    }
187    /// <p>The Amazon Resource Name (ARN) for the service access role that you want to use to create the data migration.</p>
188    pub fn get_service_access_role_arn(&self) -> &::std::option::Option<::std::string::String> {
189        self.inner.get_service_access_role_arn()
190    }
191    /// <p>Specifies whether to enable CloudWatch logs for the data migration.</p>
192    pub fn enable_cloudwatch_logs(mut self, input: bool) -> Self {
193        self.inner = self.inner.enable_cloudwatch_logs(input);
194        self
195    }
196    /// <p>Specifies whether to enable CloudWatch logs for the data migration.</p>
197    pub fn set_enable_cloudwatch_logs(mut self, input: ::std::option::Option<bool>) -> Self {
198        self.inner = self.inner.set_enable_cloudwatch_logs(input);
199        self
200    }
201    /// <p>Specifies whether to enable CloudWatch logs for the data migration.</p>
202    pub fn get_enable_cloudwatch_logs(&self) -> &::std::option::Option<bool> {
203        self.inner.get_enable_cloudwatch_logs()
204    }
205    ///
206    /// Appends an item to `SourceDataSettings`.
207    ///
208    /// To override the contents of this collection use [`set_source_data_settings`](Self::set_source_data_settings).
209    ///
210    /// <p>Specifies information about the source data provider.</p>
211    pub fn source_data_settings(mut self, input: crate::types::SourceDataSetting) -> Self {
212        self.inner = self.inner.source_data_settings(input);
213        self
214    }
215    /// <p>Specifies information about the source data provider.</p>
216    pub fn set_source_data_settings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SourceDataSetting>>) -> Self {
217        self.inner = self.inner.set_source_data_settings(input);
218        self
219    }
220    /// <p>Specifies information about the source data provider.</p>
221    pub fn get_source_data_settings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SourceDataSetting>> {
222        self.inner.get_source_data_settings()
223    }
224    ///
225    /// Appends an item to `TargetDataSettings`.
226    ///
227    /// To override the contents of this collection use [`set_target_data_settings`](Self::set_target_data_settings).
228    ///
229    /// <p>Specifies information about the target data provider.</p>
230    pub fn target_data_settings(mut self, input: crate::types::TargetDataSetting) -> Self {
231        self.inner = self.inner.target_data_settings(input);
232        self
233    }
234    /// <p>Specifies information about the target data provider.</p>
235    pub fn set_target_data_settings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TargetDataSetting>>) -> Self {
236        self.inner = self.inner.set_target_data_settings(input);
237        self
238    }
239    /// <p>Specifies information about the target data provider.</p>
240    pub fn get_target_data_settings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TargetDataSetting>> {
241        self.inner.get_target_data_settings()
242    }
243    /// <p>The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target.</p>
244    pub fn number_of_jobs(mut self, input: i32) -> Self {
245        self.inner = self.inner.number_of_jobs(input);
246        self
247    }
248    /// <p>The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target.</p>
249    pub fn set_number_of_jobs(mut self, input: ::std::option::Option<i32>) -> Self {
250        self.inner = self.inner.set_number_of_jobs(input);
251        self
252    }
253    /// <p>The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target.</p>
254    pub fn get_number_of_jobs(&self) -> &::std::option::Option<i32> {
255        self.inner.get_number_of_jobs()
256    }
257    ///
258    /// Appends an item to `Tags`.
259    ///
260    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
261    ///
262    /// <p>One or more tags to be assigned to the data migration.</p>
263    pub fn tags(mut self, input: crate::types::Tag) -> Self {
264        self.inner = self.inner.tags(input);
265        self
266    }
267    /// <p>One or more tags to be assigned to the data migration.</p>
268    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
269        self.inner = self.inner.set_tags(input);
270        self
271    }
272    /// <p>One or more tags to be assigned to the data migration.</p>
273    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
274        self.inner.get_tags()
275    }
276    /// <p>An optional JSON string specifying what tables, views, and schemas to include or exclude from the migration.</p>
277    pub fn selection_rules(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
278        self.inner = self.inner.selection_rules(input.into());
279        self
280    }
281    /// <p>An optional JSON string specifying what tables, views, and schemas to include or exclude from the migration.</p>
282    pub fn set_selection_rules(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
283        self.inner = self.inner.set_selection_rules(input);
284        self
285    }
286    /// <p>An optional JSON string specifying what tables, views, and schemas to include or exclude from the migration.</p>
287    pub fn get_selection_rules(&self) -> &::std::option::Option<::std::string::String> {
288        self.inner.get_selection_rules()
289    }
290}