aws_sdk_qbusiness/operation/create_data_source/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_data_source::_create_data_source_output::CreateDataSourceOutputBuilder;
3
4pub use crate::operation::create_data_source::_create_data_source_input::CreateDataSourceInputBuilder;
5
6impl crate::operation::create_data_source::builders::CreateDataSourceInputBuilder {
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_source::CreateDataSourceOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_data_source::CreateDataSourceError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_data_source();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateDataSource`.
24///
25/// <p>Creates a data source connector for an Amazon Q Business application.</p>
26/// <p><code>CreateDataSource</code> is a synchronous operation. The operation returns 200 if the data source was successfully created. Otherwise, an exception is raised.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateDataSourceFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::create_data_source::builders::CreateDataSourceInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::create_data_source::CreateDataSourceOutput,
36 crate::operation::create_data_source::CreateDataSourceError,
37 > for CreateDataSourceFluentBuilder
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::create_data_source::CreateDataSourceOutput,
45 crate::operation::create_data_source::CreateDataSourceError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl CreateDataSourceFluentBuilder {
52 /// Creates a new `CreateDataSourceFluentBuilder`.
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 CreateDataSource as a reference.
61 pub fn as_input(&self) -> &crate::operation::create_data_source::builders::CreateDataSourceInputBuilder {
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::create_data_source::CreateDataSourceOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::create_data_source::CreateDataSourceError,
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::create_data_source::CreateDataSource::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::create_data_source::CreateDataSource::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::create_data_source::CreateDataSourceOutput,
98 crate::operation::create_data_source::CreateDataSourceError,
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 identifier of the Amazon Q Business application the data source will be attached to.</p>
113 pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.application_id(input.into());
115 self
116 }
117 /// <p>The identifier of the Amazon Q Business application the data source will be attached to.</p>
118 pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.inner = self.inner.set_application_id(input);
120 self
121 }
122 /// <p>The identifier of the Amazon Q Business application the data source will be attached to.</p>
123 pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
124 self.inner.get_application_id()
125 }
126 /// <p>The identifier of the index that you want to use with the data source connector.</p>
127 pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.inner = self.inner.index_id(input.into());
129 self
130 }
131 /// <p>The identifier of the index that you want to use with the data source connector.</p>
132 pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133 self.inner = self.inner.set_index_id(input);
134 self
135 }
136 /// <p>The identifier of the index that you want to use with the data source connector.</p>
137 pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
138 self.inner.get_index_id()
139 }
140 /// <p>A name for the data source connector.</p>
141 pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142 self.inner = self.inner.display_name(input.into());
143 self
144 }
145 /// <p>A name for the data source connector.</p>
146 pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147 self.inner = self.inner.set_display_name(input);
148 self
149 }
150 /// <p>A name for the data source connector.</p>
151 pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
152 self.inner.get_display_name()
153 }
154 /// <p>Configuration information to connect your data source repository to Amazon Q Business. Use this parameter to provide a JSON schema with configuration information specific to your data source connector.</p>
155 /// <p>Each data source has a JSON schema provided by Amazon Q Business that you must use. For example, the Amazon S3 and Web Crawler connectors require the following JSON schemas:</p>
156 /// <ul>
157 /// <li>
158 /// <p><a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/s3-api.html">Amazon S3 JSON schema</a></p></li>
159 /// <li>
160 /// <p><a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/web-crawler-api.html">Web Crawler JSON schema</a></p></li>
161 /// </ul>
162 /// <p>You can find configuration templates for your specific data source using the following steps:</p>
163 /// <ol>
164 /// <li>
165 /// <p>Navigate to the <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connectors-list.html">Supported connectors</a> page in the Amazon Q Business User Guide, and select the data source of your choice.</p></li>
166 /// <li>
167 /// <p>Then, from your specific data source connector page, select <b>Using the API</b>. You will find the JSON schema for your data source, including parameter descriptions, in this section.</p></li>
168 /// </ol>
169 pub fn configuration(mut self, input: ::aws_smithy_types::Document) -> Self {
170 self.inner = self.inner.configuration(input);
171 self
172 }
173 /// <p>Configuration information to connect your data source repository to Amazon Q Business. Use this parameter to provide a JSON schema with configuration information specific to your data source connector.</p>
174 /// <p>Each data source has a JSON schema provided by Amazon Q Business that you must use. For example, the Amazon S3 and Web Crawler connectors require the following JSON schemas:</p>
175 /// <ul>
176 /// <li>
177 /// <p><a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/s3-api.html">Amazon S3 JSON schema</a></p></li>
178 /// <li>
179 /// <p><a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/web-crawler-api.html">Web Crawler JSON schema</a></p></li>
180 /// </ul>
181 /// <p>You can find configuration templates for your specific data source using the following steps:</p>
182 /// <ol>
183 /// <li>
184 /// <p>Navigate to the <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connectors-list.html">Supported connectors</a> page in the Amazon Q Business User Guide, and select the data source of your choice.</p></li>
185 /// <li>
186 /// <p>Then, from your specific data source connector page, select <b>Using the API</b>. You will find the JSON schema for your data source, including parameter descriptions, in this section.</p></li>
187 /// </ol>
188 pub fn set_configuration(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
189 self.inner = self.inner.set_configuration(input);
190 self
191 }
192 /// <p>Configuration information to connect your data source repository to Amazon Q Business. Use this parameter to provide a JSON schema with configuration information specific to your data source connector.</p>
193 /// <p>Each data source has a JSON schema provided by Amazon Q Business that you must use. For example, the Amazon S3 and Web Crawler connectors require the following JSON schemas:</p>
194 /// <ul>
195 /// <li>
196 /// <p><a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/s3-api.html">Amazon S3 JSON schema</a></p></li>
197 /// <li>
198 /// <p><a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/web-crawler-api.html">Web Crawler JSON schema</a></p></li>
199 /// </ul>
200 /// <p>You can find configuration templates for your specific data source using the following steps:</p>
201 /// <ol>
202 /// <li>
203 /// <p>Navigate to the <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connectors-list.html">Supported connectors</a> page in the Amazon Q Business User Guide, and select the data source of your choice.</p></li>
204 /// <li>
205 /// <p>Then, from your specific data source connector page, select <b>Using the API</b>. You will find the JSON schema for your data source, including parameter descriptions, in this section.</p></li>
206 /// </ol>
207 pub fn get_configuration(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
208 self.inner.get_configuration()
209 }
210 /// <p>Configuration information for an Amazon VPC (Virtual Private Cloud) to connect to your data source. For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connector-vpc.html">Using Amazon VPC with Amazon Q Business connectors</a>.</p>
211 pub fn vpc_configuration(mut self, input: crate::types::DataSourceVpcConfiguration) -> Self {
212 self.inner = self.inner.vpc_configuration(input);
213 self
214 }
215 /// <p>Configuration information for an Amazon VPC (Virtual Private Cloud) to connect to your data source. For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connector-vpc.html">Using Amazon VPC with Amazon Q Business connectors</a>.</p>
216 pub fn set_vpc_configuration(mut self, input: ::std::option::Option<crate::types::DataSourceVpcConfiguration>) -> Self {
217 self.inner = self.inner.set_vpc_configuration(input);
218 self
219 }
220 /// <p>Configuration information for an Amazon VPC (Virtual Private Cloud) to connect to your data source. For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connector-vpc.html">Using Amazon VPC with Amazon Q Business connectors</a>.</p>
221 pub fn get_vpc_configuration(&self) -> &::std::option::Option<crate::types::DataSourceVpcConfiguration> {
222 self.inner.get_vpc_configuration()
223 }
224 /// <p>A description for the data source connector.</p>
225 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
226 self.inner = self.inner.description(input.into());
227 self
228 }
229 /// <p>A description for the data source connector.</p>
230 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
231 self.inner = self.inner.set_description(input);
232 self
233 }
234 /// <p>A description for the data source connector.</p>
235 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
236 self.inner.get_description()
237 }
238 ///
239 /// Appends an item to `tags`.
240 ///
241 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
242 ///
243 /// <p>A list of key-value pairs that identify or categorize the data source connector. You can also use tags to help control access to the data source connector. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
244 pub fn tags(mut self, input: crate::types::Tag) -> Self {
245 self.inner = self.inner.tags(input);
246 self
247 }
248 /// <p>A list of key-value pairs that identify or categorize the data source connector. You can also use tags to help control access to the data source connector. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
249 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
250 self.inner = self.inner.set_tags(input);
251 self
252 }
253 /// <p>A list of key-value pairs that identify or categorize the data source connector. You can also use tags to help control access to the data source connector. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
254 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
255 self.inner.get_tags()
256 }
257 /// <p>Sets the frequency for Amazon Q Business to check the documents in your data source repository and update your index. If you don't set a schedule, Amazon Q Business won't periodically update the index.</p>
258 /// <p>Specify a <code>cron-</code> format schedule string or an empty string to indicate that the index is updated on demand. You can't specify the <code>Schedule</code> parameter when the <code>Type</code> parameter is set to <code>CUSTOM</code>. If you do, you receive a <code>ValidationException</code> exception.</p>
259 pub fn sync_schedule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
260 self.inner = self.inner.sync_schedule(input.into());
261 self
262 }
263 /// <p>Sets the frequency for Amazon Q Business to check the documents in your data source repository and update your index. If you don't set a schedule, Amazon Q Business won't periodically update the index.</p>
264 /// <p>Specify a <code>cron-</code> format schedule string or an empty string to indicate that the index is updated on demand. You can't specify the <code>Schedule</code> parameter when the <code>Type</code> parameter is set to <code>CUSTOM</code>. If you do, you receive a <code>ValidationException</code> exception.</p>
265 pub fn set_sync_schedule(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
266 self.inner = self.inner.set_sync_schedule(input);
267 self
268 }
269 /// <p>Sets the frequency for Amazon Q Business to check the documents in your data source repository and update your index. If you don't set a schedule, Amazon Q Business won't periodically update the index.</p>
270 /// <p>Specify a <code>cron-</code> format schedule string or an empty string to indicate that the index is updated on demand. You can't specify the <code>Schedule</code> parameter when the <code>Type</code> parameter is set to <code>CUSTOM</code>. If you do, you receive a <code>ValidationException</code> exception.</p>
271 pub fn get_sync_schedule(&self) -> &::std::option::Option<::std::string::String> {
272 self.inner.get_sync_schedule()
273 }
274 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the data source and required resources. This field is required for all connector types except custom connectors, where it is optional.</p>
275 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
276 self.inner = self.inner.role_arn(input.into());
277 self
278 }
279 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the data source and required resources. This field is required for all connector types except custom connectors, where it is optional.</p>
280 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
281 self.inner = self.inner.set_role_arn(input);
282 self
283 }
284 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the data source and required resources. This field is required for all connector types except custom connectors, where it is optional.</p>
285 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
286 self.inner.get_role_arn()
287 }
288 /// <p>A token you provide to identify a request to create a data source connector. Multiple calls to the <code>CreateDataSource</code> API with the same client token will create only one data source connector.</p>
289 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
290 self.inner = self.inner.client_token(input.into());
291 self
292 }
293 /// <p>A token you provide to identify a request to create a data source connector. Multiple calls to the <code>CreateDataSource</code> API with the same client token will create only one data source connector.</p>
294 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
295 self.inner = self.inner.set_client_token(input);
296 self
297 }
298 /// <p>A token you provide to identify a request to create a data source connector. Multiple calls to the <code>CreateDataSource</code> API with the same client token will create only one data source connector.</p>
299 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
300 self.inner.get_client_token()
301 }
302 /// <p>Provides the configuration information for altering document metadata and content during the document ingestion process.</p>
303 /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html">Custom document enrichment</a>.</p>
304 pub fn document_enrichment_configuration(mut self, input: crate::types::DocumentEnrichmentConfiguration) -> Self {
305 self.inner = self.inner.document_enrichment_configuration(input);
306 self
307 }
308 /// <p>Provides the configuration information for altering document metadata and content during the document ingestion process.</p>
309 /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html">Custom document enrichment</a>.</p>
310 pub fn set_document_enrichment_configuration(mut self, input: ::std::option::Option<crate::types::DocumentEnrichmentConfiguration>) -> Self {
311 self.inner = self.inner.set_document_enrichment_configuration(input);
312 self
313 }
314 /// <p>Provides the configuration information for altering document metadata and content during the document ingestion process.</p>
315 /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html">Custom document enrichment</a>.</p>
316 pub fn get_document_enrichment_configuration(&self) -> &::std::option::Option<crate::types::DocumentEnrichmentConfiguration> {
317 self.inner.get_document_enrichment_configuration()
318 }
319 /// <p>The configuration for extracting information from media in documents during ingestion.</p>
320 pub fn media_extraction_configuration(mut self, input: crate::types::MediaExtractionConfiguration) -> Self {
321 self.inner = self.inner.media_extraction_configuration(input);
322 self
323 }
324 /// <p>The configuration for extracting information from media in documents during ingestion.</p>
325 pub fn set_media_extraction_configuration(mut self, input: ::std::option::Option<crate::types::MediaExtractionConfiguration>) -> Self {
326 self.inner = self.inner.set_media_extraction_configuration(input);
327 self
328 }
329 /// <p>The configuration for extracting information from media in documents during ingestion.</p>
330 pub fn get_media_extraction_configuration(&self) -> &::std::option::Option<crate::types::MediaExtractionConfiguration> {
331 self.inner.get_media_extraction_configuration()
332 }
333}