aws_sdk_kendra/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 that you want to use with an Amazon Kendra index.</p>
26/// <p>You specify a name, data source connector type and description for your data source. You also specify configuration information for the data source connector.</p>
27/// <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>
28/// <p>For an example of creating an index and data source using the Python SDK, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/gs-python.html">Getting started with Python SDK</a>. For an example of creating an index and data source using the Java SDK, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/gs-java.html">Getting started with Java SDK</a>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateDataSourceFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::create_data_source::builders::CreateDataSourceInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::create_data_source::CreateDataSourceOutput,
38 crate::operation::create_data_source::CreateDataSourceError,
39 > for CreateDataSourceFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::create_data_source::CreateDataSourceOutput,
47 crate::operation::create_data_source::CreateDataSourceError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl CreateDataSourceFluentBuilder {
54 /// Creates a new `CreateDataSourceFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the CreateDataSource as a reference.
63 pub fn as_input(&self) -> &crate::operation::create_data_source::builders::CreateDataSourceInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::create_data_source::CreateDataSourceOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::create_data_source::CreateDataSourceError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::create_data_source::CreateDataSource::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::create_data_source::CreateDataSource::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::create_data_source::CreateDataSourceOutput,
100 crate::operation::create_data_source::CreateDataSourceError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 /// <p>A name for the data source connector.</p>
115 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.name(input.into());
117 self
118 }
119 /// <p>A name for the data source connector.</p>
120 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_name(input);
122 self
123 }
124 /// <p>A name for the data source connector.</p>
125 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_name()
127 }
128 /// <p>The identifier of the index you want to use with the data source connector.</p>
129 pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.inner = self.inner.index_id(input.into());
131 self
132 }
133 /// <p>The identifier of the index you want to use with the data source connector.</p>
134 pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.inner = self.inner.set_index_id(input);
136 self
137 }
138 /// <p>The identifier of the index you want to use with the data source connector.</p>
139 pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_index_id()
141 }
142 /// <p>The type of data source repository. For example, <code>SHAREPOINT</code>.</p>
143 pub fn r#type(mut self, input: crate::types::DataSourceType) -> Self {
144 self.inner = self.inner.r#type(input);
145 self
146 }
147 /// <p>The type of data source repository. For example, <code>SHAREPOINT</code>.</p>
148 pub fn set_type(mut self, input: ::std::option::Option<crate::types::DataSourceType>) -> Self {
149 self.inner = self.inner.set_type(input);
150 self
151 }
152 /// <p>The type of data source repository. For example, <code>SHAREPOINT</code>.</p>
153 pub fn get_type(&self) -> &::std::option::Option<crate::types::DataSourceType> {
154 self.inner.get_type()
155 }
156 /// <p>Configuration information to connect to your data source repository.</p>
157 /// <p>You can't specify the <code>Configuration</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>
158 /// <p>The <code>Configuration</code> parameter is required for all other data sources.</p>
159 pub fn configuration(mut self, input: crate::types::DataSourceConfiguration) -> Self {
160 self.inner = self.inner.configuration(input);
161 self
162 }
163 /// <p>Configuration information to connect to your data source repository.</p>
164 /// <p>You can't specify the <code>Configuration</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>
165 /// <p>The <code>Configuration</code> parameter is required for all other data sources.</p>
166 pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::DataSourceConfiguration>) -> Self {
167 self.inner = self.inner.set_configuration(input);
168 self
169 }
170 /// <p>Configuration information to connect to your data source repository.</p>
171 /// <p>You can't specify the <code>Configuration</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>
172 /// <p>The <code>Configuration</code> parameter is required for all other data sources.</p>
173 pub fn get_configuration(&self) -> &::std::option::Option<crate::types::DataSourceConfiguration> {
174 self.inner.get_configuration()
175 }
176 /// <p>Configuration information for an Amazon Virtual Private Cloud to connect to your data source. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/vpc-configuration.html">Configuring a VPC</a>.</p>
177 pub fn vpc_configuration(mut self, input: crate::types::DataSourceVpcConfiguration) -> Self {
178 self.inner = self.inner.vpc_configuration(input);
179 self
180 }
181 /// <p>Configuration information for an Amazon Virtual Private Cloud to connect to your data source. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/vpc-configuration.html">Configuring a VPC</a>.</p>
182 pub fn set_vpc_configuration(mut self, input: ::std::option::Option<crate::types::DataSourceVpcConfiguration>) -> Self {
183 self.inner = self.inner.set_vpc_configuration(input);
184 self
185 }
186 /// <p>Configuration information for an Amazon Virtual Private Cloud to connect to your data source. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/vpc-configuration.html">Configuring a VPC</a>.</p>
187 pub fn get_vpc_configuration(&self) -> &::std::option::Option<crate::types::DataSourceVpcConfiguration> {
188 self.inner.get_vpc_configuration()
189 }
190 /// <p>A description for the data source connector.</p>
191 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192 self.inner = self.inner.description(input.into());
193 self
194 }
195 /// <p>A description for the data source connector.</p>
196 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197 self.inner = self.inner.set_description(input);
198 self
199 }
200 /// <p>A description for the data source connector.</p>
201 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
202 self.inner.get_description()
203 }
204 /// <p>Sets the frequency for Amazon Kendra to check the documents in your data source repository and update the index. If you don't set a schedule Amazon Kendra will not periodically update the index. You can call the <code>StartDataSourceSyncJob</code> API to update the index.</p>
205 /// <p>Specify a <code>cron-</code> format schedule string or an empty string to indicate that the index is updated on demand.</p>
206 /// <p>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>
207 pub fn schedule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208 self.inner = self.inner.schedule(input.into());
209 self
210 }
211 /// <p>Sets the frequency for Amazon Kendra to check the documents in your data source repository and update the index. If you don't set a schedule Amazon Kendra will not periodically update the index. You can call the <code>StartDataSourceSyncJob</code> API to update the index.</p>
212 /// <p>Specify a <code>cron-</code> format schedule string or an empty string to indicate that the index is updated on demand.</p>
213 /// <p>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>
214 pub fn set_schedule(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
215 self.inner = self.inner.set_schedule(input);
216 self
217 }
218 /// <p>Sets the frequency for Amazon Kendra to check the documents in your data source repository and update the index. If you don't set a schedule Amazon Kendra will not periodically update the index. You can call the <code>StartDataSourceSyncJob</code> API to update the index.</p>
219 /// <p>Specify a <code>cron-</code> format schedule string or an empty string to indicate that the index is updated on demand.</p>
220 /// <p>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>
221 pub fn get_schedule(&self) -> &::std::option::Option<::std::string::String> {
222 self.inner.get_schedule()
223 }
224 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the data source and required resources. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html">IAM access roles for Amazon Kendra.</a>.</p>
225 /// <p>You can't specify the <code>RoleArn</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>
226 /// <p>The <code>RoleArn</code> parameter is required for all other data sources.</p>
227 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
228 self.inner = self.inner.role_arn(input.into());
229 self
230 }
231 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the data source and required resources. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html">IAM access roles for Amazon Kendra.</a>.</p>
232 /// <p>You can't specify the <code>RoleArn</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>
233 /// <p>The <code>RoleArn</code> parameter is required for all other data sources.</p>
234 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235 self.inner = self.inner.set_role_arn(input);
236 self
237 }
238 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the data source and required resources. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html">IAM access roles for Amazon Kendra.</a>.</p>
239 /// <p>You can't specify the <code>RoleArn</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>
240 /// <p>The <code>RoleArn</code> parameter is required for all other data sources.</p>
241 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
242 self.inner.get_role_arn()
243 }
244 ///
245 /// Appends an item to `Tags`.
246 ///
247 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
248 ///
249 /// <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>
250 pub fn tags(mut self, input: crate::types::Tag) -> Self {
251 self.inner = self.inner.tags(input);
252 self
253 }
254 /// <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>
255 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
256 self.inner = self.inner.set_tags(input);
257 self
258 }
259 /// <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>
260 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
261 self.inner.get_tags()
262 }
263 /// <p>A token that you provide to identify the 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>
264 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
265 self.inner = self.inner.client_token(input.into());
266 self
267 }
268 /// <p>A token that you provide to identify the 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>
269 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
270 self.inner = self.inner.set_client_token(input);
271 self
272 }
273 /// <p>A token that you provide to identify the 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>
274 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
275 self.inner.get_client_token()
276 }
277 /// <p>The code for a language. This allows you to support a language for all documents when creating the data source connector. English is supported by default. For more information on supported languages, including their codes, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html">Adding documents in languages other than English</a>.</p>
278 pub fn language_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
279 self.inner = self.inner.language_code(input.into());
280 self
281 }
282 /// <p>The code for a language. This allows you to support a language for all documents when creating the data source connector. English is supported by default. For more information on supported languages, including their codes, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html">Adding documents in languages other than English</a>.</p>
283 pub fn set_language_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
284 self.inner = self.inner.set_language_code(input);
285 self
286 }
287 /// <p>The code for a language. This allows you to support a language for all documents when creating the data source connector. English is supported by default. For more information on supported languages, including their codes, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html">Adding documents in languages other than English</a>.</p>
288 pub fn get_language_code(&self) -> &::std::option::Option<::std::string::String> {
289 self.inner.get_language_code()
290 }
291 /// <p>Configuration information for altering document metadata and content during the document ingestion process.</p>
292 /// <p>For more information on how to create, modify and delete document metadata, or make other content alterations when you ingest documents into Amazon Kendra, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/custom-document-enrichment.html">Customizing document metadata during the ingestion process</a>.</p>
293 pub fn custom_document_enrichment_configuration(mut self, input: crate::types::CustomDocumentEnrichmentConfiguration) -> Self {
294 self.inner = self.inner.custom_document_enrichment_configuration(input);
295 self
296 }
297 /// <p>Configuration information for altering document metadata and content during the document ingestion process.</p>
298 /// <p>For more information on how to create, modify and delete document metadata, or make other content alterations when you ingest documents into Amazon Kendra, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/custom-document-enrichment.html">Customizing document metadata during the ingestion process</a>.</p>
299 pub fn set_custom_document_enrichment_configuration(
300 mut self,
301 input: ::std::option::Option<crate::types::CustomDocumentEnrichmentConfiguration>,
302 ) -> Self {
303 self.inner = self.inner.set_custom_document_enrichment_configuration(input);
304 self
305 }
306 /// <p>Configuration information for altering document metadata and content during the document ingestion process.</p>
307 /// <p>For more information on how to create, modify and delete document metadata, or make other content alterations when you ingest documents into Amazon Kendra, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/custom-document-enrichment.html">Customizing document metadata during the ingestion process</a>.</p>
308 pub fn get_custom_document_enrichment_configuration(&self) -> &::std::option::Option<crate::types::CustomDocumentEnrichmentConfiguration> {
309 self.inner.get_custom_document_enrichment_configuration()
310 }
311}