aws_sdk_applicationdiscovery/operation/start_import_task/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_import_task::_start_import_task_output::StartImportTaskOutputBuilder;
3
4pub use crate::operation::start_import_task::_start_import_task_input::StartImportTaskInputBuilder;
5
6impl crate::operation::start_import_task::builders::StartImportTaskInputBuilder {
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_import_task::StartImportTaskOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_import_task::StartImportTaskError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_import_task();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartImportTask`.
24///
25/// <p>Starts an import task, which allows you to import details of your on-premises environment directly into Amazon Web Services Migration Hub without having to use the Amazon Web Services Application Discovery Service (Application Discovery Service) tools such as the Amazon Web Services Application Discovery Service Agentless Collector or Application Discovery Agent. This gives you the option to perform migration assessment and planning directly from your imported data, including the ability to group your devices as applications and track their migration status.</p>
26/// <p>To start an import request, do this:</p>
27/// <ol>
28/// <li>
29/// <p>Download the specially formatted comma separated value (CSV) import template, which you can find here: <a href="https://s3.us-west-2.amazonaws.com/templates-7cffcf56-bd96-4b1c-b45b-a5b42f282e46/import_template.csv">https://s3.us-west-2.amazonaws.com/templates-7cffcf56-bd96-4b1c-b45b-a5b42f282e46/import_template.csv</a>.</p></li>
30/// <li>
31/// <p>Fill out the template with your server and application data.</p></li>
32/// <li>
33/// <p>Upload your import file to an Amazon S3 bucket, and make a note of it's Object URL. Your import file must be in the CSV format.</p></li>
34/// <li>
35/// <p>Use the console or the <code>StartImportTask</code> command with the Amazon Web Services CLI or one of the Amazon Web Services SDKs to import the records from your file.</p></li>
36/// </ol>
37/// <p>For more information, including step-by-step procedures, see <a href="https://docs.aws.amazon.com/application-discovery/latest/userguide/discovery-import.html">Migration Hub Import</a> in the <i>Amazon Web Services Application Discovery Service User Guide</i>.</p><note>
38/// <p>There are limits to the number of import tasks you can create (and delete) in an Amazon Web Services account. For more information, see <a href="https://docs.aws.amazon.com/application-discovery/latest/userguide/ads_service_limits.html">Amazon Web Services Application Discovery Service Limits</a> in the <i>Amazon Web Services Application Discovery Service User Guide</i>.</p>
39/// </note>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct StartImportTaskFluentBuilder {
42    handle: ::std::sync::Arc<crate::client::Handle>,
43    inner: crate::operation::start_import_task::builders::StartImportTaskInputBuilder,
44    config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47    crate::client::customize::internal::CustomizableSend<
48        crate::operation::start_import_task::StartImportTaskOutput,
49        crate::operation::start_import_task::StartImportTaskError,
50    > for StartImportTaskFluentBuilder
51{
52    fn send(
53        self,
54        config_override: crate::config::Builder,
55    ) -> crate::client::customize::internal::BoxFuture<
56        crate::client::customize::internal::SendResult<
57            crate::operation::start_import_task::StartImportTaskOutput,
58            crate::operation::start_import_task::StartImportTaskError,
59        >,
60    > {
61        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62    }
63}
64impl StartImportTaskFluentBuilder {
65    /// Creates a new `StartImportTaskFluentBuilder`.
66    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
67        Self {
68            handle,
69            inner: ::std::default::Default::default(),
70            config_override: ::std::option::Option::None,
71        }
72    }
73    /// Access the StartImportTask as a reference.
74    pub fn as_input(&self) -> &crate::operation::start_import_task::builders::StartImportTaskInputBuilder {
75        &self.inner
76    }
77    /// Sends the request and returns the response.
78    ///
79    /// If an error occurs, an `SdkError` will be returned with additional details that
80    /// can be matched against.
81    ///
82    /// By default, any retryable failures will be retried twice. Retry behavior
83    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
84    /// set when configuring the client.
85    pub async fn send(
86        self,
87    ) -> ::std::result::Result<
88        crate::operation::start_import_task::StartImportTaskOutput,
89        ::aws_smithy_runtime_api::client::result::SdkError<
90            crate::operation::start_import_task::StartImportTaskError,
91            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
92        >,
93    > {
94        let input = self
95            .inner
96            .build()
97            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
98        let runtime_plugins = crate::operation::start_import_task::StartImportTask::operation_runtime_plugins(
99            self.handle.runtime_plugins.clone(),
100            &self.handle.conf,
101            self.config_override,
102        );
103        crate::operation::start_import_task::StartImportTask::orchestrate(&runtime_plugins, input).await
104    }
105
106    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
107    pub fn customize(
108        self,
109    ) -> crate::client::customize::CustomizableOperation<
110        crate::operation::start_import_task::StartImportTaskOutput,
111        crate::operation::start_import_task::StartImportTaskError,
112        Self,
113    > {
114        crate::client::customize::CustomizableOperation::new(self)
115    }
116    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117        self.set_config_override(::std::option::Option::Some(config_override.into()));
118        self
119    }
120
121    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122        self.config_override = config_override;
123        self
124    }
125    /// <p>Optional. A unique token that you can provide to prevent the same import request from occurring more than once. If you don't provide a token, a token is automatically generated.</p>
126    /// <p>Sending more than one <code>StartImportTask</code> request with the same client request token will return information about the original import task with that client request token.</p>
127    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.client_request_token(input.into());
129        self
130    }
131    /// <p>Optional. A unique token that you can provide to prevent the same import request from occurring more than once. If you don't provide a token, a token is automatically generated.</p>
132    /// <p>Sending more than one <code>StartImportTask</code> request with the same client request token will return information about the original import task with that client request token.</p>
133    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_client_request_token(input);
135        self
136    }
137    /// <p>Optional. A unique token that you can provide to prevent the same import request from occurring more than once. If you don't provide a token, a token is automatically generated.</p>
138    /// <p>Sending more than one <code>StartImportTask</code> request with the same client request token will return information about the original import task with that client request token.</p>
139    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_client_request_token()
141    }
142    /// <p>A descriptive name for this request. You can use this name to filter future requests related to this import task, such as identifying applications and servers that were included in this import task. We recommend that you use a meaningful name for each import task.</p>
143    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.name(input.into());
145        self
146    }
147    /// <p>A descriptive name for this request. You can use this name to filter future requests related to this import task, such as identifying applications and servers that were included in this import task. We recommend that you use a meaningful name for each import task.</p>
148    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_name(input);
150        self
151    }
152    /// <p>A descriptive name for this request. You can use this name to filter future requests related to this import task, such as identifying applications and servers that were included in this import task. We recommend that you use a meaningful name for each import task.</p>
153    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_name()
155    }
156    /// <p>The URL for your import file that you've uploaded to Amazon S3.</p><note>
157    /// <p>If you're using the Amazon Web Services CLI, this URL is structured as follows: <code>s3://BucketName/ImportFileName.CSV</code></p>
158    /// </note>
159    pub fn import_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.inner = self.inner.import_url(input.into());
161        self
162    }
163    /// <p>The URL for your import file that you've uploaded to Amazon S3.</p><note>
164    /// <p>If you're using the Amazon Web Services CLI, this URL is structured as follows: <code>s3://BucketName/ImportFileName.CSV</code></p>
165    /// </note>
166    pub fn set_import_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_import_url(input);
168        self
169    }
170    /// <p>The URL for your import file that you've uploaded to Amazon S3.</p><note>
171    /// <p>If you're using the Amazon Web Services CLI, this URL is structured as follows: <code>s3://BucketName/ImportFileName.CSV</code></p>
172    /// </note>
173    pub fn get_import_url(&self) -> &::std::option::Option<::std::string::String> {
174        self.inner.get_import_url()
175    }
176}