com.amazonaws.services.kendra.model.BatchPutDocumentRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-kendra Show documentation
/*
* Copyright 2015-2020 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 BatchPutDocumentRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The identifier of the index to add the documents to. You need to create the index first using the
* CreateIndex operation.
*
*/
private String indexId;
/**
*
* The Amazon Resource Name (ARN) of a role that is allowed to run the BatchPutDocument
operation. For
* more information, see IAM Roles for Amazon
* Kendra.
*
*/
private String roleArn;
/**
*
* One or more documents to add to the index.
*
*
* Each document is limited to 5 Mb, the total size of the list is limited to 50 Mb.
*
*/
private java.util.List documents;
/**
*
* The identifier of the index to add the documents to. You need to create the index first using the
* CreateIndex operation.
*
*
* @param indexId
* The identifier of the index to add the documents to. You need to create the index first using the
* CreateIndex operation.
*/
public void setIndexId(String indexId) {
this.indexId = indexId;
}
/**
*
* The identifier of the index to add the documents to. You need to create the index first using the
* CreateIndex operation.
*
*
* @return The identifier of the index to add the documents to. You need to create the index first using the
* CreateIndex operation.
*/
public String getIndexId() {
return this.indexId;
}
/**
*
* The identifier of the index to add the documents to. You need to create the index first using the
* CreateIndex operation.
*
*
* @param indexId
* The identifier of the index to add the documents to. You need to create the index first using the
* CreateIndex operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchPutDocumentRequest withIndexId(String indexId) {
setIndexId(indexId);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of a role that is allowed to run the BatchPutDocument
operation. For
* more information, see IAM Roles for Amazon
* Kendra.
*
*
* @param roleArn
* The Amazon Resource Name (ARN) of a role that is allowed to run the BatchPutDocument
* operation. For more information, see IAM Roles for Amazon Kendra.
*/
public void setRoleArn(String roleArn) {
this.roleArn = roleArn;
}
/**
*
* The Amazon Resource Name (ARN) of a role that is allowed to run the BatchPutDocument
operation. For
* more information, see IAM Roles for Amazon
* Kendra.
*
*
* @return The Amazon Resource Name (ARN) of a role that is allowed to run the BatchPutDocument
* operation. For more information, see IAM Roles for Amazon Kendra.
*/
public String getRoleArn() {
return this.roleArn;
}
/**
*
* The Amazon Resource Name (ARN) of a role that is allowed to run the BatchPutDocument
operation. For
* more information, see IAM Roles for Amazon
* Kendra.
*
*
* @param roleArn
* The Amazon Resource Name (ARN) of a role that is allowed to run the BatchPutDocument
* operation. For more information, see IAM Roles for Amazon Kendra.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchPutDocumentRequest withRoleArn(String roleArn) {
setRoleArn(roleArn);
return this;
}
/**
*
* One or more documents to add to the index.
*
*
* Each document is limited to 5 Mb, the total size of the list is limited to 50 Mb.
*
*
* @return One or more documents to add to the index.
*
* Each document is limited to 5 Mb, the total size of the list is limited to 50 Mb.
*/
public java.util.List getDocuments() {
return documents;
}
/**
*
* One or more documents to add to the index.
*
*
* Each document is limited to 5 Mb, the total size of the list is limited to 50 Mb.
*
*
* @param documents
* One or more documents to add to the index.
*
* Each document is limited to 5 Mb, the total size of the list is limited to 50 Mb.
*/
public void setDocuments(java.util.Collection documents) {
if (documents == null) {
this.documents = null;
return;
}
this.documents = new java.util.ArrayList(documents);
}
/**
*
* One or more documents to add to the index.
*
*
* Each document is limited to 5 Mb, the total size of the list is limited to 50 Mb.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDocuments(java.util.Collection)} or {@link #withDocuments(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param documents
* One or more documents to add to the index.
*
* Each document is limited to 5 Mb, the total size of the list is limited to 50 Mb.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchPutDocumentRequest withDocuments(Document... documents) {
if (this.documents == null) {
setDocuments(new java.util.ArrayList(documents.length));
}
for (Document ele : documents) {
this.documents.add(ele);
}
return this;
}
/**
*
* One or more documents to add to the index.
*
*
* Each document is limited to 5 Mb, the total size of the list is limited to 50 Mb.
*
*
* @param documents
* One or more documents to add to the index.
*
* Each document is limited to 5 Mb, the total size of the list is limited to 50 Mb.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchPutDocumentRequest withDocuments(java.util.Collection documents) {
setDocuments(documents);
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 (getIndexId() != null)
sb.append("IndexId: ").append(getIndexId()).append(",");
if (getRoleArn() != null)
sb.append("RoleArn: ").append(getRoleArn()).append(",");
if (getDocuments() != null)
sb.append("Documents: ").append(getDocuments());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof BatchPutDocumentRequest == false)
return false;
BatchPutDocumentRequest other = (BatchPutDocumentRequest) obj;
if (other.getIndexId() == null ^ this.getIndexId() == null)
return false;
if (other.getIndexId() != null && other.getIndexId().equals(this.getIndexId()) == 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.getDocuments() == null ^ this.getDocuments() == null)
return false;
if (other.getDocuments() != null && other.getDocuments().equals(this.getDocuments()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getIndexId() == null) ? 0 : getIndexId().hashCode());
hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode());
hashCode = prime * hashCode + ((getDocuments() == null) ? 0 : getDocuments().hashCode());
return hashCode;
}
@Override
public BatchPutDocumentRequest clone() {
return (BatchPutDocumentRequest) super.clone();
}
}