aws_sdk_kendra/operation/create_index/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_index::_create_index_output::CreateIndexOutputBuilder;
3
4pub use crate::operation::create_index::_create_index_input::CreateIndexInputBuilder;
5
6impl crate::operation::create_index::builders::CreateIndexInputBuilder {
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_index::CreateIndexOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_index::CreateIndexError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_index();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateIndex`.
24///
25/// <p>Creates an Amazon Kendra index. Index creation is an asynchronous API. To determine if index creation has completed, check the <code>Status</code> field returned from a call to <code>DescribeIndex</code>. The <code>Status</code> field is set to <code>ACTIVE</code> when the index is ready to use.</p>
26/// <p>Once the index is active, you can index your documents using the <code>BatchPutDocument</code> API or using one of the supported <a href="https://docs.aws.amazon.com/kendra/latest/dg/data-sources.html">data sources</a>.</p>
27/// <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>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateIndexFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::create_index::builders::CreateIndexInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::create_index::CreateIndexOutput,
37 crate::operation::create_index::CreateIndexError,
38 > for CreateIndexFluentBuilder
39{
40 fn send(
41 self,
42 config_override: crate::config::Builder,
43 ) -> crate::client::customize::internal::BoxFuture<
44 crate::client::customize::internal::SendResult<
45 crate::operation::create_index::CreateIndexOutput,
46 crate::operation::create_index::CreateIndexError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl CreateIndexFluentBuilder {
53 /// Creates a new `CreateIndexFluentBuilder`.
54 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55 Self {
56 handle,
57 inner: ::std::default::Default::default(),
58 config_override: ::std::option::Option::None,
59 }
60 }
61 /// Access the CreateIndex as a reference.
62 pub fn as_input(&self) -> &crate::operation::create_index::builders::CreateIndexInputBuilder {
63 &self.inner
64 }
65 /// Sends the request and returns the response.
66 ///
67 /// If an error occurs, an `SdkError` will be returned with additional details that
68 /// can be matched against.
69 ///
70 /// By default, any retryable failures will be retried twice. Retry behavior
71 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72 /// set when configuring the client.
73 pub async fn send(
74 self,
75 ) -> ::std::result::Result<
76 crate::operation::create_index::CreateIndexOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::create_index::CreateIndexError,
79 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80 >,
81 > {
82 let input = self
83 .inner
84 .build()
85 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86 let runtime_plugins = crate::operation::create_index::CreateIndex::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::create_index::CreateIndex::orchestrate(&runtime_plugins, input).await
92 }
93
94 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95 pub fn customize(
96 self,
97 ) -> crate::client::customize::CustomizableOperation<
98 crate::operation::create_index::CreateIndexOutput,
99 crate::operation::create_index::CreateIndexError,
100 Self,
101 > {
102 crate::client::customize::CustomizableOperation::new(self)
103 }
104 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105 self.set_config_override(::std::option::Option::Some(config_override.into()));
106 self
107 }
108
109 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110 self.config_override = config_override;
111 self
112 }
113 /// <p>A name for the index.</p>
114 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.name(input.into());
116 self
117 }
118 /// <p>A name for the index.</p>
119 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_name(input);
121 self
122 }
123 /// <p>A name for the index.</p>
124 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
125 self.inner.get_name()
126 }
127 /// <p>The Amazon Kendra edition to use for the index. Choose <code>DEVELOPER_EDITION</code> for indexes intended for development, testing, or proof of concept. Use <code>ENTERPRISE_EDITION</code> for production. Use <code>GEN_AI_ENTERPRISE_EDITION</code> for creating generative AI applications. Once you set the edition for an index, it can't be changed.</p>
128 /// <p>The <code>Edition</code> parameter is optional. If you don't supply a value, the default is <code>ENTERPRISE_EDITION</code>.</p>
129 /// <p>For more information on quota limits for Gen AI Enterprise Edition, Enterprise Edition, and Developer Edition indices, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/quotas.html">Quotas</a>.</p>
130 pub fn edition(mut self, input: crate::types::IndexEdition) -> Self {
131 self.inner = self.inner.edition(input);
132 self
133 }
134 /// <p>The Amazon Kendra edition to use for the index. Choose <code>DEVELOPER_EDITION</code> for indexes intended for development, testing, or proof of concept. Use <code>ENTERPRISE_EDITION</code> for production. Use <code>GEN_AI_ENTERPRISE_EDITION</code> for creating generative AI applications. Once you set the edition for an index, it can't be changed.</p>
135 /// <p>The <code>Edition</code> parameter is optional. If you don't supply a value, the default is <code>ENTERPRISE_EDITION</code>.</p>
136 /// <p>For more information on quota limits for Gen AI Enterprise Edition, Enterprise Edition, and Developer Edition indices, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/quotas.html">Quotas</a>.</p>
137 pub fn set_edition(mut self, input: ::std::option::Option<crate::types::IndexEdition>) -> Self {
138 self.inner = self.inner.set_edition(input);
139 self
140 }
141 /// <p>The Amazon Kendra edition to use for the index. Choose <code>DEVELOPER_EDITION</code> for indexes intended for development, testing, or proof of concept. Use <code>ENTERPRISE_EDITION</code> for production. Use <code>GEN_AI_ENTERPRISE_EDITION</code> for creating generative AI applications. Once you set the edition for an index, it can't be changed.</p>
142 /// <p>The <code>Edition</code> parameter is optional. If you don't supply a value, the default is <code>ENTERPRISE_EDITION</code>.</p>
143 /// <p>For more information on quota limits for Gen AI Enterprise Edition, Enterprise Edition, and Developer Edition indices, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/quotas.html">Quotas</a>.</p>
144 pub fn get_edition(&self) -> &::std::option::Option<crate::types::IndexEdition> {
145 self.inner.get_edition()
146 }
147 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access your Amazon CloudWatch logs and metrics. 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>
148 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149 self.inner = self.inner.role_arn(input.into());
150 self
151 }
152 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access your Amazon CloudWatch logs and metrics. 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>
153 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154 self.inner = self.inner.set_role_arn(input);
155 self
156 }
157 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access your Amazon CloudWatch logs and metrics. 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>
158 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
159 self.inner.get_role_arn()
160 }
161 /// <p>The identifier of the KMS customer managed key (CMK) that's used to encrypt data indexed by Amazon Kendra. Amazon Kendra doesn't support asymmetric CMKs.</p>
162 pub fn server_side_encryption_configuration(mut self, input: crate::types::ServerSideEncryptionConfiguration) -> Self {
163 self.inner = self.inner.server_side_encryption_configuration(input);
164 self
165 }
166 /// <p>The identifier of the KMS customer managed key (CMK) that's used to encrypt data indexed by Amazon Kendra. Amazon Kendra doesn't support asymmetric CMKs.</p>
167 pub fn set_server_side_encryption_configuration(mut self, input: ::std::option::Option<crate::types::ServerSideEncryptionConfiguration>) -> Self {
168 self.inner = self.inner.set_server_side_encryption_configuration(input);
169 self
170 }
171 /// <p>The identifier of the KMS customer managed key (CMK) that's used to encrypt data indexed by Amazon Kendra. Amazon Kendra doesn't support asymmetric CMKs.</p>
172 pub fn get_server_side_encryption_configuration(&self) -> &::std::option::Option<crate::types::ServerSideEncryptionConfiguration> {
173 self.inner.get_server_side_encryption_configuration()
174 }
175 /// <p>A description for the index.</p>
176 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177 self.inner = self.inner.description(input.into());
178 self
179 }
180 /// <p>A description for the index.</p>
181 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182 self.inner = self.inner.set_description(input);
183 self
184 }
185 /// <p>A description for the index.</p>
186 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
187 self.inner.get_description()
188 }
189 /// <p>A token that you provide to identify the request to create an index. Multiple calls to the <code>CreateIndex</code> API with the same client token will create only one index.</p>
190 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191 self.inner = self.inner.client_token(input.into());
192 self
193 }
194 /// <p>A token that you provide to identify the request to create an index. Multiple calls to the <code>CreateIndex</code> API with the same client token will create only one index.</p>
195 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196 self.inner = self.inner.set_client_token(input);
197 self
198 }
199 /// <p>A token that you provide to identify the request to create an index. Multiple calls to the <code>CreateIndex</code> API with the same client token will create only one index.</p>
200 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
201 self.inner.get_client_token()
202 }
203 ///
204 /// Appends an item to `Tags`.
205 ///
206 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
207 ///
208 /// <p>A list of key-value pairs that identify or categorize the index. You can also use tags to help control access to the index. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
209 pub fn tags(mut self, input: crate::types::Tag) -> Self {
210 self.inner = self.inner.tags(input);
211 self
212 }
213 /// <p>A list of key-value pairs that identify or categorize the index. You can also use tags to help control access to the index. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
214 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
215 self.inner = self.inner.set_tags(input);
216 self
217 }
218 /// <p>A list of key-value pairs that identify or categorize the index. You can also use tags to help control access to the index. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
219 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
220 self.inner.get_tags()
221 }
222 ///
223 /// Appends an item to `UserTokenConfigurations`.
224 ///
225 /// To override the contents of this collection use [`set_user_token_configurations`](Self::set_user_token_configurations).
226 ///
227 /// <p>The user token configuration.</p><important>
228 /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use <code>UserTokenConfigurations</code> to configure user context policy, Amazon Kendra returns a <code>ValidationException</code> error.</p>
229 /// </important>
230 pub fn user_token_configurations(mut self, input: crate::types::UserTokenConfiguration) -> Self {
231 self.inner = self.inner.user_token_configurations(input);
232 self
233 }
234 /// <p>The user token configuration.</p><important>
235 /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use <code>UserTokenConfigurations</code> to configure user context policy, Amazon Kendra returns a <code>ValidationException</code> error.</p>
236 /// </important>
237 pub fn set_user_token_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UserTokenConfiguration>>) -> Self {
238 self.inner = self.inner.set_user_token_configurations(input);
239 self
240 }
241 /// <p>The user token configuration.</p><important>
242 /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use <code>UserTokenConfigurations</code> to configure user context policy, Amazon Kendra returns a <code>ValidationException</code> error.</p>
243 /// </important>
244 pub fn get_user_token_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UserTokenConfiguration>> {
245 self.inner.get_user_token_configurations()
246 }
247 /// <p>The user context policy.</p><important>
248 /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index, you can only use <code>ATTRIBUTE_FILTER</code> to filter search results by user context. If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use <code>USER_TOKEN</code> to configure user context policy, Amazon Kendra returns a <code>ValidationException</code> error.</p>
249 /// </important>
250 /// <dl>
251 /// <dt>
252 /// ATTRIBUTE_FILTER
253 /// </dt>
254 /// <dd>
255 /// <p>All indexed content is searchable and displayable for all users. If you want to filter search results on user context, you can use the attribute filters of <code>_user_id</code> and <code>_group_ids</code> or you can provide user and group information in <code>UserContext</code>.</p>
256 /// </dd>
257 /// <dt>
258 /// USER_TOKEN
259 /// </dt>
260 /// <dd>
261 /// <p>Enables token-based user access control to filter search results on user context. All documents with no access control and all documents accessible to the user will be searchable and displayable.</p>
262 /// </dd>
263 /// </dl>
264 pub fn user_context_policy(mut self, input: crate::types::UserContextPolicy) -> Self {
265 self.inner = self.inner.user_context_policy(input);
266 self
267 }
268 /// <p>The user context policy.</p><important>
269 /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index, you can only use <code>ATTRIBUTE_FILTER</code> to filter search results by user context. If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use <code>USER_TOKEN</code> to configure user context policy, Amazon Kendra returns a <code>ValidationException</code> error.</p>
270 /// </important>
271 /// <dl>
272 /// <dt>
273 /// ATTRIBUTE_FILTER
274 /// </dt>
275 /// <dd>
276 /// <p>All indexed content is searchable and displayable for all users. If you want to filter search results on user context, you can use the attribute filters of <code>_user_id</code> and <code>_group_ids</code> or you can provide user and group information in <code>UserContext</code>.</p>
277 /// </dd>
278 /// <dt>
279 /// USER_TOKEN
280 /// </dt>
281 /// <dd>
282 /// <p>Enables token-based user access control to filter search results on user context. All documents with no access control and all documents accessible to the user will be searchable and displayable.</p>
283 /// </dd>
284 /// </dl>
285 pub fn set_user_context_policy(mut self, input: ::std::option::Option<crate::types::UserContextPolicy>) -> Self {
286 self.inner = self.inner.set_user_context_policy(input);
287 self
288 }
289 /// <p>The user context policy.</p><important>
290 /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index, you can only use <code>ATTRIBUTE_FILTER</code> to filter search results by user context. If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use <code>USER_TOKEN</code> to configure user context policy, Amazon Kendra returns a <code>ValidationException</code> error.</p>
291 /// </important>
292 /// <dl>
293 /// <dt>
294 /// ATTRIBUTE_FILTER
295 /// </dt>
296 /// <dd>
297 /// <p>All indexed content is searchable and displayable for all users. If you want to filter search results on user context, you can use the attribute filters of <code>_user_id</code> and <code>_group_ids</code> or you can provide user and group information in <code>UserContext</code>.</p>
298 /// </dd>
299 /// <dt>
300 /// USER_TOKEN
301 /// </dt>
302 /// <dd>
303 /// <p>Enables token-based user access control to filter search results on user context. All documents with no access control and all documents accessible to the user will be searchable and displayable.</p>
304 /// </dd>
305 /// </dl>
306 pub fn get_user_context_policy(&self) -> &::std::option::Option<crate::types::UserContextPolicy> {
307 self.inner.get_user_context_policy()
308 }
309 /// <p>Gets users and groups from IAM Identity Center identity source. To configure this, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_UserGroupResolutionConfiguration.html">UserGroupResolutionConfiguration</a>. This is useful for user context filtering, where search results are filtered based on the user or their group access to documents.</p><important>
310 /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index, <code>UserGroupResolutionConfiguration</code> isn't supported.</p>
311 /// </important>
312 pub fn user_group_resolution_configuration(mut self, input: crate::types::UserGroupResolutionConfiguration) -> Self {
313 self.inner = self.inner.user_group_resolution_configuration(input);
314 self
315 }
316 /// <p>Gets users and groups from IAM Identity Center identity source. To configure this, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_UserGroupResolutionConfiguration.html">UserGroupResolutionConfiguration</a>. This is useful for user context filtering, where search results are filtered based on the user or their group access to documents.</p><important>
317 /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index, <code>UserGroupResolutionConfiguration</code> isn't supported.</p>
318 /// </important>
319 pub fn set_user_group_resolution_configuration(mut self, input: ::std::option::Option<crate::types::UserGroupResolutionConfiguration>) -> Self {
320 self.inner = self.inner.set_user_group_resolution_configuration(input);
321 self
322 }
323 /// <p>Gets users and groups from IAM Identity Center identity source. To configure this, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_UserGroupResolutionConfiguration.html">UserGroupResolutionConfiguration</a>. This is useful for user context filtering, where search results are filtered based on the user or their group access to documents.</p><important>
324 /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index, <code>UserGroupResolutionConfiguration</code> isn't supported.</p>
325 /// </important>
326 pub fn get_user_group_resolution_configuration(&self) -> &::std::option::Option<crate::types::UserGroupResolutionConfiguration> {
327 self.inner.get_user_group_resolution_configuration()
328 }
329}