aws_sdk_qconnect/operation/start_import_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_import_job::_start_import_job_output::StartImportJobOutputBuilder;
3
4pub use crate::operation::start_import_job::_start_import_job_input::StartImportJobInputBuilder;
5
6impl crate::operation::start_import_job::builders::StartImportJobInputBuilder {
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_job::StartImportJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_import_job::StartImportJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_import_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartImportJob`.
24///
25/// <p>Start an asynchronous job to import Amazon Q in Connect resources from an uploaded source file. Before calling this API, use <a href="https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html">StartContentUpload</a> to upload an asset that contains the resource data.</p>
26/// <ul>
27/// <li>
28/// <p>For importing Amazon Q in Connect quick responses, you need to upload a csv file including the quick responses. For information about how to format the csv file for importing quick responses, see <a href="https://docs.aws.amazon.com/console/connect/quick-responses/add-data">Import quick responses</a>.</p></li>
29/// </ul>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct StartImportJobFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::start_import_job::builders::StartImportJobInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37    crate::client::customize::internal::CustomizableSend<
38        crate::operation::start_import_job::StartImportJobOutput,
39        crate::operation::start_import_job::StartImportJobError,
40    > for StartImportJobFluentBuilder
41{
42    fn send(
43        self,
44        config_override: crate::config::Builder,
45    ) -> crate::client::customize::internal::BoxFuture<
46        crate::client::customize::internal::SendResult<
47            crate::operation::start_import_job::StartImportJobOutput,
48            crate::operation::start_import_job::StartImportJobError,
49        >,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl StartImportJobFluentBuilder {
55    /// Creates a new `StartImportJobFluentBuilder`.
56    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57        Self {
58            handle,
59            inner: ::std::default::Default::default(),
60            config_override: ::std::option::Option::None,
61        }
62    }
63    /// Access the StartImportJob as a reference.
64    pub fn as_input(&self) -> &crate::operation::start_import_job::builders::StartImportJobInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::start_import_job::StartImportJobOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::start_import_job::StartImportJobError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins = crate::operation::start_import_job::StartImportJob::operation_runtime_plugins(
89            self.handle.runtime_plugins.clone(),
90            &self.handle.conf,
91            self.config_override,
92        );
93        crate::operation::start_import_job::StartImportJob::orchestrate(&runtime_plugins, input).await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<
100        crate::operation::start_import_job::StartImportJobOutput,
101        crate::operation::start_import_job::StartImportJobError,
102        Self,
103    > {
104        crate::client::customize::CustomizableOperation::new(self)
105    }
106    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107        self.set_config_override(::std::option::Option::Some(config_override.into()));
108        self
109    }
110
111    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112        self.config_override = config_override;
113        self
114    }
115    /// <p>The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
116    /// <ul>
117    /// <li>
118    /// <p>For importing Amazon Q in Connect quick responses, this should be a <code>QUICK_RESPONSES</code> type knowledge base.</p></li>
119    /// </ul>
120    pub fn knowledge_base_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.knowledge_base_id(input.into());
122        self
123    }
124    /// <p>The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
125    /// <ul>
126    /// <li>
127    /// <p>For importing Amazon Q in Connect quick responses, this should be a <code>QUICK_RESPONSES</code> type knowledge base.</p></li>
128    /// </ul>
129    pub fn set_knowledge_base_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_knowledge_base_id(input);
131        self
132    }
133    /// <p>The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
134    /// <ul>
135    /// <li>
136    /// <p>For importing Amazon Q in Connect quick responses, this should be a <code>QUICK_RESPONSES</code> type knowledge base.</p></li>
137    /// </ul>
138    pub fn get_knowledge_base_id(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_knowledge_base_id()
140    }
141    /// <p>The type of the import job.</p>
142    /// <ul>
143    /// <li>
144    /// <p>For importing quick response resource, set the value to <code>QUICK_RESPONSES</code>.</p></li>
145    /// </ul>
146    pub fn import_job_type(mut self, input: crate::types::ImportJobType) -> Self {
147        self.inner = self.inner.import_job_type(input);
148        self
149    }
150    /// <p>The type of the import job.</p>
151    /// <ul>
152    /// <li>
153    /// <p>For importing quick response resource, set the value to <code>QUICK_RESPONSES</code>.</p></li>
154    /// </ul>
155    pub fn set_import_job_type(mut self, input: ::std::option::Option<crate::types::ImportJobType>) -> Self {
156        self.inner = self.inner.set_import_job_type(input);
157        self
158    }
159    /// <p>The type of the import job.</p>
160    /// <ul>
161    /// <li>
162    /// <p>For importing quick response resource, set the value to <code>QUICK_RESPONSES</code>.</p></li>
163    /// </ul>
164    pub fn get_import_job_type(&self) -> &::std::option::Option<crate::types::ImportJobType> {
165        self.inner.get_import_job_type()
166    }
167    /// <p>A pointer to the uploaded asset. This value is returned by <a href="https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html">StartContentUpload</a>.</p>
168    pub fn upload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.upload_id(input.into());
170        self
171    }
172    /// <p>A pointer to the uploaded asset. This value is returned by <a href="https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html">StartContentUpload</a>.</p>
173    pub fn set_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_upload_id(input);
175        self
176    }
177    /// <p>A pointer to the uploaded asset. This value is returned by <a href="https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html">StartContentUpload</a>.</p>
178    pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_upload_id()
180    }
181    /// <p>The tags used to organize, track, or control access for this resource.</p>
182    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.client_token(input.into());
184        self
185    }
186    /// <p>The tags used to organize, track, or control access for this resource.</p>
187    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_client_token(input);
189        self
190    }
191    /// <p>The tags used to organize, track, or control access for this resource.</p>
192    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_client_token()
194    }
195    ///
196    /// Adds a key-value pair to `metadata`.
197    ///
198    /// To override the contents of this collection use [`set_metadata`](Self::set_metadata).
199    ///
200    /// <p>The metadata fields of the imported Amazon Q in Connect resources.</p>
201    pub fn metadata(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
202        self.inner = self.inner.metadata(k.into(), v.into());
203        self
204    }
205    /// <p>The metadata fields of the imported Amazon Q in Connect resources.</p>
206    pub fn set_metadata(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
207        self.inner = self.inner.set_metadata(input);
208        self
209    }
210    /// <p>The metadata fields of the imported Amazon Q in Connect resources.</p>
211    pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
212        self.inner.get_metadata()
213    }
214    /// <p>The configuration information of the external source that the resource data are imported from.</p>
215    pub fn external_source_configuration(mut self, input: crate::types::ExternalSourceConfiguration) -> Self {
216        self.inner = self.inner.external_source_configuration(input);
217        self
218    }
219    /// <p>The configuration information of the external source that the resource data are imported from.</p>
220    pub fn set_external_source_configuration(mut self, input: ::std::option::Option<crate::types::ExternalSourceConfiguration>) -> Self {
221        self.inner = self.inner.set_external_source_configuration(input);
222        self
223    }
224    /// <p>The configuration information of the external source that the resource data are imported from.</p>
225    pub fn get_external_source_configuration(&self) -> &::std::option::Option<crate::types::ExternalSourceConfiguration> {
226        self.inner.get_external_source_configuration()
227    }
228}