aws_sdk_kendra/operation/update_index/
_update_index_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateIndexInput {
6    /// <p>The identifier of the index you want to update.</p>
7    pub id: ::std::option::Option<::std::string::String>,
8    /// <p>A new name for the index.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon CloudWatch logs and metrics.</p>
11    pub role_arn: ::std::option::Option<::std::string::String>,
12    /// <p>A new description for the index.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>The document metadata configuration you want to update for the index. Document metadata are fields or attributes associated with your documents. For example, the company department name associated with each document.</p>
15    pub document_metadata_configuration_updates: ::std::option::Option<::std::vec::Vec<crate::types::DocumentMetadataConfiguration>>,
16    /// <p>Sets the number of additional document storage and query capacity units that should be used by the index. You can change the capacity of the index up to 5 times per day, or make 5 API calls.</p>
17    /// <p>If you are using extra storage units, you can't reduce the storage capacity below what is required to meet the storage needs for your index.</p>
18    pub capacity_units: ::std::option::Option<crate::types::CapacityUnitsConfiguration>,
19    /// <p>The user token configuration.</p><important>
20    /// <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>
21    /// </important>
22    pub user_token_configurations: ::std::option::Option<::std::vec::Vec<crate::types::UserTokenConfiguration>>,
23    /// <p>The user context policy.</p><important>
24    /// <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>
25    /// </important>
26    pub user_context_policy: ::std::option::Option<crate::types::UserContextPolicy>,
27    /// <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>
28    /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index, <code>UserGroupResolutionConfiguration</code> isn't supported.</p>
29    /// </important>
30    pub user_group_resolution_configuration: ::std::option::Option<crate::types::UserGroupResolutionConfiguration>,
31}
32impl UpdateIndexInput {
33    /// <p>The identifier of the index you want to update.</p>
34    pub fn id(&self) -> ::std::option::Option<&str> {
35        self.id.as_deref()
36    }
37    /// <p>A new name for the index.</p>
38    pub fn name(&self) -> ::std::option::Option<&str> {
39        self.name.as_deref()
40    }
41    /// <p>An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon CloudWatch logs and metrics.</p>
42    pub fn role_arn(&self) -> ::std::option::Option<&str> {
43        self.role_arn.as_deref()
44    }
45    /// <p>A new description for the index.</p>
46    pub fn description(&self) -> ::std::option::Option<&str> {
47        self.description.as_deref()
48    }
49    /// <p>The document metadata configuration you want to update for the index. Document metadata are fields or attributes associated with your documents. For example, the company department name associated with each document.</p>
50    ///
51    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.document_metadata_configuration_updates.is_none()`.
52    pub fn document_metadata_configuration_updates(&self) -> &[crate::types::DocumentMetadataConfiguration] {
53        self.document_metadata_configuration_updates.as_deref().unwrap_or_default()
54    }
55    /// <p>Sets the number of additional document storage and query capacity units that should be used by the index. You can change the capacity of the index up to 5 times per day, or make 5 API calls.</p>
56    /// <p>If you are using extra storage units, you can't reduce the storage capacity below what is required to meet the storage needs for your index.</p>
57    pub fn capacity_units(&self) -> ::std::option::Option<&crate::types::CapacityUnitsConfiguration> {
58        self.capacity_units.as_ref()
59    }
60    /// <p>The user token configuration.</p><important>
61    /// <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>
62    /// </important>
63    ///
64    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.user_token_configurations.is_none()`.
65    pub fn user_token_configurations(&self) -> &[crate::types::UserTokenConfiguration] {
66        self.user_token_configurations.as_deref().unwrap_or_default()
67    }
68    /// <p>The user context policy.</p><important>
69    /// <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>
70    /// </important>
71    pub fn user_context_policy(&self) -> ::std::option::Option<&crate::types::UserContextPolicy> {
72        self.user_context_policy.as_ref()
73    }
74    /// <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>
75    /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index, <code>UserGroupResolutionConfiguration</code> isn't supported.</p>
76    /// </important>
77    pub fn user_group_resolution_configuration(&self) -> ::std::option::Option<&crate::types::UserGroupResolutionConfiguration> {
78        self.user_group_resolution_configuration.as_ref()
79    }
80}
81impl UpdateIndexInput {
82    /// Creates a new builder-style object to manufacture [`UpdateIndexInput`](crate::operation::update_index::UpdateIndexInput).
83    pub fn builder() -> crate::operation::update_index::builders::UpdateIndexInputBuilder {
84        crate::operation::update_index::builders::UpdateIndexInputBuilder::default()
85    }
86}
87
88/// A builder for [`UpdateIndexInput`](crate::operation::update_index::UpdateIndexInput).
89#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
90#[non_exhaustive]
91pub struct UpdateIndexInputBuilder {
92    pub(crate) id: ::std::option::Option<::std::string::String>,
93    pub(crate) name: ::std::option::Option<::std::string::String>,
94    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
95    pub(crate) description: ::std::option::Option<::std::string::String>,
96    pub(crate) document_metadata_configuration_updates: ::std::option::Option<::std::vec::Vec<crate::types::DocumentMetadataConfiguration>>,
97    pub(crate) capacity_units: ::std::option::Option<crate::types::CapacityUnitsConfiguration>,
98    pub(crate) user_token_configurations: ::std::option::Option<::std::vec::Vec<crate::types::UserTokenConfiguration>>,
99    pub(crate) user_context_policy: ::std::option::Option<crate::types::UserContextPolicy>,
100    pub(crate) user_group_resolution_configuration: ::std::option::Option<crate::types::UserGroupResolutionConfiguration>,
101}
102impl UpdateIndexInputBuilder {
103    /// <p>The identifier of the index you want to update.</p>
104    /// This field is required.
105    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.id = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>The identifier of the index you want to update.</p>
110    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.id = input;
112        self
113    }
114    /// <p>The identifier of the index you want to update.</p>
115    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
116        &self.id
117    }
118    /// <p>A new name for the index.</p>
119    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.name = ::std::option::Option::Some(input.into());
121        self
122    }
123    /// <p>A new name for the index.</p>
124    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.name = input;
126        self
127    }
128    /// <p>A new name for the index.</p>
129    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
130        &self.name
131    }
132    /// <p>An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon CloudWatch logs and metrics.</p>
133    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.role_arn = ::std::option::Option::Some(input.into());
135        self
136    }
137    /// <p>An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon CloudWatch logs and metrics.</p>
138    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.role_arn = input;
140        self
141    }
142    /// <p>An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon CloudWatch logs and metrics.</p>
143    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
144        &self.role_arn
145    }
146    /// <p>A new description for the index.</p>
147    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.description = ::std::option::Option::Some(input.into());
149        self
150    }
151    /// <p>A new description for the index.</p>
152    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.description = input;
154        self
155    }
156    /// <p>A new description for the index.</p>
157    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
158        &self.description
159    }
160    /// Appends an item to `document_metadata_configuration_updates`.
161    ///
162    /// To override the contents of this collection use [`set_document_metadata_configuration_updates`](Self::set_document_metadata_configuration_updates).
163    ///
164    /// <p>The document metadata configuration you want to update for the index. Document metadata are fields or attributes associated with your documents. For example, the company department name associated with each document.</p>
165    pub fn document_metadata_configuration_updates(mut self, input: crate::types::DocumentMetadataConfiguration) -> Self {
166        let mut v = self.document_metadata_configuration_updates.unwrap_or_default();
167        v.push(input);
168        self.document_metadata_configuration_updates = ::std::option::Option::Some(v);
169        self
170    }
171    /// <p>The document metadata configuration you want to update for the index. Document metadata are fields or attributes associated with your documents. For example, the company department name associated with each document.</p>
172    pub fn set_document_metadata_configuration_updates(
173        mut self,
174        input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentMetadataConfiguration>>,
175    ) -> Self {
176        self.document_metadata_configuration_updates = input;
177        self
178    }
179    /// <p>The document metadata configuration you want to update for the index. Document metadata are fields or attributes associated with your documents. For example, the company department name associated with each document.</p>
180    pub fn get_document_metadata_configuration_updates(
181        &self,
182    ) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentMetadataConfiguration>> {
183        &self.document_metadata_configuration_updates
184    }
185    /// <p>Sets the number of additional document storage and query capacity units that should be used by the index. You can change the capacity of the index up to 5 times per day, or make 5 API calls.</p>
186    /// <p>If you are using extra storage units, you can't reduce the storage capacity below what is required to meet the storage needs for your index.</p>
187    pub fn capacity_units(mut self, input: crate::types::CapacityUnitsConfiguration) -> Self {
188        self.capacity_units = ::std::option::Option::Some(input);
189        self
190    }
191    /// <p>Sets the number of additional document storage and query capacity units that should be used by the index. You can change the capacity of the index up to 5 times per day, or make 5 API calls.</p>
192    /// <p>If you are using extra storage units, you can't reduce the storage capacity below what is required to meet the storage needs for your index.</p>
193    pub fn set_capacity_units(mut self, input: ::std::option::Option<crate::types::CapacityUnitsConfiguration>) -> Self {
194        self.capacity_units = input;
195        self
196    }
197    /// <p>Sets the number of additional document storage and query capacity units that should be used by the index. You can change the capacity of the index up to 5 times per day, or make 5 API calls.</p>
198    /// <p>If you are using extra storage units, you can't reduce the storage capacity below what is required to meet the storage needs for your index.</p>
199    pub fn get_capacity_units(&self) -> &::std::option::Option<crate::types::CapacityUnitsConfiguration> {
200        &self.capacity_units
201    }
202    /// Appends an item to `user_token_configurations`.
203    ///
204    /// To override the contents of this collection use [`set_user_token_configurations`](Self::set_user_token_configurations).
205    ///
206    /// <p>The user token configuration.</p><important>
207    /// <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>
208    /// </important>
209    pub fn user_token_configurations(mut self, input: crate::types::UserTokenConfiguration) -> Self {
210        let mut v = self.user_token_configurations.unwrap_or_default();
211        v.push(input);
212        self.user_token_configurations = ::std::option::Option::Some(v);
213        self
214    }
215    /// <p>The user token configuration.</p><important>
216    /// <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>
217    /// </important>
218    pub fn set_user_token_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UserTokenConfiguration>>) -> Self {
219        self.user_token_configurations = input;
220        self
221    }
222    /// <p>The user token configuration.</p><important>
223    /// <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>
224    /// </important>
225    pub fn get_user_token_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UserTokenConfiguration>> {
226        &self.user_token_configurations
227    }
228    /// <p>The user context policy.</p><important>
229    /// <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>
230    /// </important>
231    pub fn user_context_policy(mut self, input: crate::types::UserContextPolicy) -> Self {
232        self.user_context_policy = ::std::option::Option::Some(input);
233        self
234    }
235    /// <p>The user context policy.</p><important>
236    /// <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>
237    /// </important>
238    pub fn set_user_context_policy(mut self, input: ::std::option::Option<crate::types::UserContextPolicy>) -> Self {
239        self.user_context_policy = input;
240        self
241    }
242    /// <p>The user context policy.</p><important>
243    /// <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>
244    /// </important>
245    pub fn get_user_context_policy(&self) -> &::std::option::Option<crate::types::UserContextPolicy> {
246        &self.user_context_policy
247    }
248    /// <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>
249    /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index, <code>UserGroupResolutionConfiguration</code> isn't supported.</p>
250    /// </important>
251    pub fn user_group_resolution_configuration(mut self, input: crate::types::UserGroupResolutionConfiguration) -> Self {
252        self.user_group_resolution_configuration = ::std::option::Option::Some(input);
253        self
254    }
255    /// <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>
256    /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index, <code>UserGroupResolutionConfiguration</code> isn't supported.</p>
257    /// </important>
258    pub fn set_user_group_resolution_configuration(mut self, input: ::std::option::Option<crate::types::UserGroupResolutionConfiguration>) -> Self {
259        self.user_group_resolution_configuration = input;
260        self
261    }
262    /// <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>
263    /// <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index, <code>UserGroupResolutionConfiguration</code> isn't supported.</p>
264    /// </important>
265    pub fn get_user_group_resolution_configuration(&self) -> &::std::option::Option<crate::types::UserGroupResolutionConfiguration> {
266        &self.user_group_resolution_configuration
267    }
268    /// Consumes the builder and constructs a [`UpdateIndexInput`](crate::operation::update_index::UpdateIndexInput).
269    pub fn build(self) -> ::std::result::Result<crate::operation::update_index::UpdateIndexInput, ::aws_smithy_types::error::operation::BuildError> {
270        ::std::result::Result::Ok(crate::operation::update_index::UpdateIndexInput {
271            id: self.id,
272            name: self.name,
273            role_arn: self.role_arn,
274            description: self.description,
275            document_metadata_configuration_updates: self.document_metadata_configuration_updates,
276            capacity_units: self.capacity_units,
277            user_token_configurations: self.user_token_configurations,
278            user_context_policy: self.user_context_policy,
279            user_group_resolution_configuration: self.user_group_resolution_configuration,
280        })
281    }
282}