com.amazonaws.services.kendra.model.UpdateIndexRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-kendra Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.kendra.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UpdateIndexRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The identifier of the index you want to update.
*
*/
private String id;
/**
*
* A new name for the index.
*
*/
private String name;
/**
*
* An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon CloudWatch logs
* and metrics.
*
*/
private String roleArn;
/**
*
* A new description for the index.
*
*/
private String description;
/**
*
* 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.
*
*/
private java.util.List documentMetadataConfigurationUpdates;
/**
*
* 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.
*
*
* 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.
*
*/
private CapacityUnitsConfiguration capacityUnits;
/**
*
* The user token configuration.
*
*/
private java.util.List userTokenConfigurations;
/**
*
* The user context policy.
*
*/
private String userContextPolicy;
/**
*
* Gets users and groups from IAM Identity Center identity source. To configure this, see UserGroupResolutionConfiguration. This is useful for user context filtering, where search results are
* filtered based on the user or their group access to documents.
*
*/
private UserGroupResolutionConfiguration userGroupResolutionConfiguration;
/**
*
* The identifier of the index you want to update.
*
*
* @param id
* The identifier of the index you want to update.
*/
public void setId(String id) {
this.id = id;
}
/**
*
* The identifier of the index you want to update.
*
*
* @return The identifier of the index you want to update.
*/
public String getId() {
return this.id;
}
/**
*
* The identifier of the index you want to update.
*
*
* @param id
* The identifier of the index you want to update.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateIndexRequest withId(String id) {
setId(id);
return this;
}
/**
*
* A new name for the index.
*
*
* @param name
* A new name for the index.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* A new name for the index.
*
*
* @return A new name for the index.
*/
public String getName() {
return this.name;
}
/**
*
* A new name for the index.
*
*
* @param name
* A new name for the index.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateIndexRequest withName(String name) {
setName(name);
return this;
}
/**
*
* An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon CloudWatch logs
* and metrics.
*
*
* @param roleArn
* An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon
* CloudWatch logs and metrics.
*/
public void setRoleArn(String roleArn) {
this.roleArn = roleArn;
}
/**
*
* An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon CloudWatch logs
* and metrics.
*
*
* @return An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon
* CloudWatch logs and metrics.
*/
public String getRoleArn() {
return this.roleArn;
}
/**
*
* An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon CloudWatch logs
* and metrics.
*
*
* @param roleArn
* An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon
* CloudWatch logs and metrics.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateIndexRequest withRoleArn(String roleArn) {
setRoleArn(roleArn);
return this;
}
/**
*
* A new description for the index.
*
*
* @param description
* A new description for the index.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* A new description for the index.
*
*
* @return A new description for the index.
*/
public String getDescription() {
return this.description;
}
/**
*
* A new description for the index.
*
*
* @param description
* A new description for the index.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateIndexRequest withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* 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.
*
*
* @return 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.
*/
public java.util.List getDocumentMetadataConfigurationUpdates() {
return documentMetadataConfigurationUpdates;
}
/**
*
* 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.
*
*
* @param documentMetadataConfigurationUpdates
* 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.
*/
public void setDocumentMetadataConfigurationUpdates(java.util.Collection documentMetadataConfigurationUpdates) {
if (documentMetadataConfigurationUpdates == null) {
this.documentMetadataConfigurationUpdates = null;
return;
}
this.documentMetadataConfigurationUpdates = new java.util.ArrayList(documentMetadataConfigurationUpdates);
}
/**
*
* 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.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDocumentMetadataConfigurationUpdates(java.util.Collection)} or
* {@link #withDocumentMetadataConfigurationUpdates(java.util.Collection)} if you want to override the existing
* values.
*
*
* @param documentMetadataConfigurationUpdates
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateIndexRequest withDocumentMetadataConfigurationUpdates(DocumentMetadataConfiguration... documentMetadataConfigurationUpdates) {
if (this.documentMetadataConfigurationUpdates == null) {
setDocumentMetadataConfigurationUpdates(new java.util.ArrayList(documentMetadataConfigurationUpdates.length));
}
for (DocumentMetadataConfiguration ele : documentMetadataConfigurationUpdates) {
this.documentMetadataConfigurationUpdates.add(ele);
}
return this;
}
/**
*
* 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.
*
*
* @param documentMetadataConfigurationUpdates
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateIndexRequest withDocumentMetadataConfigurationUpdates(java.util.Collection documentMetadataConfigurationUpdates) {
setDocumentMetadataConfigurationUpdates(documentMetadataConfigurationUpdates);
return this;
}
/**
*
* 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.
*
*
* 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.
*
*
* @param capacityUnits
* 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.
*
* 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.
*/
public void setCapacityUnits(CapacityUnitsConfiguration capacityUnits) {
this.capacityUnits = capacityUnits;
}
/**
*
* 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.
*
*
* 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.
*
*
* @return 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.
*
* 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.
*/
public CapacityUnitsConfiguration getCapacityUnits() {
return this.capacityUnits;
}
/**
*
* 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.
*
*
* 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.
*
*
* @param capacityUnits
* 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.
*
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateIndexRequest withCapacityUnits(CapacityUnitsConfiguration capacityUnits) {
setCapacityUnits(capacityUnits);
return this;
}
/**
*
* The user token configuration.
*
*
* @return The user token configuration.
*/
public java.util.List getUserTokenConfigurations() {
return userTokenConfigurations;
}
/**
*
* The user token configuration.
*
*
* @param userTokenConfigurations
* The user token configuration.
*/
public void setUserTokenConfigurations(java.util.Collection userTokenConfigurations) {
if (userTokenConfigurations == null) {
this.userTokenConfigurations = null;
return;
}
this.userTokenConfigurations = new java.util.ArrayList(userTokenConfigurations);
}
/**
*
* The user token configuration.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setUserTokenConfigurations(java.util.Collection)} or
* {@link #withUserTokenConfigurations(java.util.Collection)} if you want to override the existing values.
*
*
* @param userTokenConfigurations
* The user token configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateIndexRequest withUserTokenConfigurations(UserTokenConfiguration... userTokenConfigurations) {
if (this.userTokenConfigurations == null) {
setUserTokenConfigurations(new java.util.ArrayList(userTokenConfigurations.length));
}
for (UserTokenConfiguration ele : userTokenConfigurations) {
this.userTokenConfigurations.add(ele);
}
return this;
}
/**
*
* The user token configuration.
*
*
* @param userTokenConfigurations
* The user token configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateIndexRequest withUserTokenConfigurations(java.util.Collection userTokenConfigurations) {
setUserTokenConfigurations(userTokenConfigurations);
return this;
}
/**
*
* The user context policy.
*
*
* @param userContextPolicy
* The user context policy.
* @see UserContextPolicy
*/
public void setUserContextPolicy(String userContextPolicy) {
this.userContextPolicy = userContextPolicy;
}
/**
*
* The user context policy.
*
*
* @return The user context policy.
* @see UserContextPolicy
*/
public String getUserContextPolicy() {
return this.userContextPolicy;
}
/**
*
* The user context policy.
*
*
* @param userContextPolicy
* The user context policy.
* @return Returns a reference to this object so that method calls can be chained together.
* @see UserContextPolicy
*/
public UpdateIndexRequest withUserContextPolicy(String userContextPolicy) {
setUserContextPolicy(userContextPolicy);
return this;
}
/**
*
* The user context policy.
*
*
* @param userContextPolicy
* The user context policy.
* @return Returns a reference to this object so that method calls can be chained together.
* @see UserContextPolicy
*/
public UpdateIndexRequest withUserContextPolicy(UserContextPolicy userContextPolicy) {
this.userContextPolicy = userContextPolicy.toString();
return this;
}
/**
*
* Gets users and groups from IAM Identity Center identity source. To configure this, see UserGroupResolutionConfiguration. This is useful for user context filtering, where search results are
* filtered based on the user or their group access to documents.
*
*
* @param userGroupResolutionConfiguration
* Gets users and groups from IAM Identity Center identity source. To configure this, see UserGroupResolutionConfiguration. This is useful for user context filtering, where search results are
* filtered based on the user or their group access to documents.
*/
public void setUserGroupResolutionConfiguration(UserGroupResolutionConfiguration userGroupResolutionConfiguration) {
this.userGroupResolutionConfiguration = userGroupResolutionConfiguration;
}
/**
*
* Gets users and groups from IAM Identity Center identity source. To configure this, see UserGroupResolutionConfiguration. This is useful for user context filtering, where search results are
* filtered based on the user or their group access to documents.
*
*
* @return Gets users and groups from IAM Identity Center identity source. To configure this, see UserGroupResolutionConfiguration. This is useful for user context filtering, where search results
* are filtered based on the user or their group access to documents.
*/
public UserGroupResolutionConfiguration getUserGroupResolutionConfiguration() {
return this.userGroupResolutionConfiguration;
}
/**
*
* Gets users and groups from IAM Identity Center identity source. To configure this, see UserGroupResolutionConfiguration. This is useful for user context filtering, where search results are
* filtered based on the user or their group access to documents.
*
*
* @param userGroupResolutionConfiguration
* Gets users and groups from IAM Identity Center identity source. To configure this, see UserGroupResolutionConfiguration. This is useful for user context filtering, where search results are
* filtered based on the user or their group access to documents.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateIndexRequest withUserGroupResolutionConfiguration(UserGroupResolutionConfiguration userGroupResolutionConfiguration) {
setUserGroupResolutionConfiguration(userGroupResolutionConfiguration);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getId() != null)
sb.append("Id: ").append(getId()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getRoleArn() != null)
sb.append("RoleArn: ").append(getRoleArn()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getDocumentMetadataConfigurationUpdates() != null)
sb.append("DocumentMetadataConfigurationUpdates: ").append(getDocumentMetadataConfigurationUpdates()).append(",");
if (getCapacityUnits() != null)
sb.append("CapacityUnits: ").append(getCapacityUnits()).append(",");
if (getUserTokenConfigurations() != null)
sb.append("UserTokenConfigurations: ").append(getUserTokenConfigurations()).append(",");
if (getUserContextPolicy() != null)
sb.append("UserContextPolicy: ").append(getUserContextPolicy()).append(",");
if (getUserGroupResolutionConfiguration() != null)
sb.append("UserGroupResolutionConfiguration: ").append(getUserGroupResolutionConfiguration());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof UpdateIndexRequest == false)
return false;
UpdateIndexRequest other = (UpdateIndexRequest) obj;
if (other.getId() == null ^ this.getId() == null)
return false;
if (other.getId() != null && other.getId().equals(this.getId()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getRoleArn() == null ^ this.getRoleArn() == null)
return false;
if (other.getRoleArn() != null && other.getRoleArn().equals(this.getRoleArn()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getDocumentMetadataConfigurationUpdates() == null ^ this.getDocumentMetadataConfigurationUpdates() == null)
return false;
if (other.getDocumentMetadataConfigurationUpdates() != null
&& other.getDocumentMetadataConfigurationUpdates().equals(this.getDocumentMetadataConfigurationUpdates()) == false)
return false;
if (other.getCapacityUnits() == null ^ this.getCapacityUnits() == null)
return false;
if (other.getCapacityUnits() != null && other.getCapacityUnits().equals(this.getCapacityUnits()) == false)
return false;
if (other.getUserTokenConfigurations() == null ^ this.getUserTokenConfigurations() == null)
return false;
if (other.getUserTokenConfigurations() != null && other.getUserTokenConfigurations().equals(this.getUserTokenConfigurations()) == false)
return false;
if (other.getUserContextPolicy() == null ^ this.getUserContextPolicy() == null)
return false;
if (other.getUserContextPolicy() != null && other.getUserContextPolicy().equals(this.getUserContextPolicy()) == false)
return false;
if (other.getUserGroupResolutionConfiguration() == null ^ this.getUserGroupResolutionConfiguration() == null)
return false;
if (other.getUserGroupResolutionConfiguration() != null
&& other.getUserGroupResolutionConfiguration().equals(this.getUserGroupResolutionConfiguration()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getDocumentMetadataConfigurationUpdates() == null) ? 0 : getDocumentMetadataConfigurationUpdates().hashCode());
hashCode = prime * hashCode + ((getCapacityUnits() == null) ? 0 : getCapacityUnits().hashCode());
hashCode = prime * hashCode + ((getUserTokenConfigurations() == null) ? 0 : getUserTokenConfigurations().hashCode());
hashCode = prime * hashCode + ((getUserContextPolicy() == null) ? 0 : getUserContextPolicy().hashCode());
hashCode = prime * hashCode + ((getUserGroupResolutionConfiguration() == null) ? 0 : getUserGroupResolutionConfiguration().hashCode());
return hashCode;
}
@Override
public UpdateIndexRequest clone() {
return (UpdateIndexRequest) super.clone();
}
}