/* * Copyright 2018-2023 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.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Provides the configuration information for applying basic logic to alter document metadata and content when ingesting * documents into Amazon Kendra. To apply advanced logic, to go beyond what you can do with basic logic, see HookConfiguration. *
** For more information, see Customizing document metadata * during the ingestion process. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class InlineCustomDocumentEnrichmentConfiguration implements Serializable, Cloneable, StructuredPojo { /** ** Configuration of the condition used for the target document attribute or metadata field when ingesting documents * into Amazon Kendra. *
*/ private DocumentAttributeCondition condition; /** ** Configuration of the target document attribute or metadata field when ingesting documents into Amazon Kendra. You * can also include a value. *
*/ private DocumentAttributeTarget target; /** *
* TRUE
to delete content if the condition used for the target attribute is met.
*
* Configuration of the condition used for the target document attribute or metadata field when ingesting documents * into Amazon Kendra. *
* * @param condition * Configuration of the condition used for the target document attribute or metadata field when ingesting * documents into Amazon Kendra. */ public void setCondition(DocumentAttributeCondition condition) { this.condition = condition; } /** ** Configuration of the condition used for the target document attribute or metadata field when ingesting documents * into Amazon Kendra. *
* * @return Configuration of the condition used for the target document attribute or metadata field when ingesting * documents into Amazon Kendra. */ public DocumentAttributeCondition getCondition() { return this.condition; } /** ** Configuration of the condition used for the target document attribute or metadata field when ingesting documents * into Amazon Kendra. *
* * @param condition * Configuration of the condition used for the target document attribute or metadata field when ingesting * documents into Amazon Kendra. * @return Returns a reference to this object so that method calls can be chained together. */ public InlineCustomDocumentEnrichmentConfiguration withCondition(DocumentAttributeCondition condition) { setCondition(condition); return this; } /** ** Configuration of the target document attribute or metadata field when ingesting documents into Amazon Kendra. You * can also include a value. *
* * @param target * Configuration of the target document attribute or metadata field when ingesting documents into Amazon * Kendra. You can also include a value. */ public void setTarget(DocumentAttributeTarget target) { this.target = target; } /** ** Configuration of the target document attribute or metadata field when ingesting documents into Amazon Kendra. You * can also include a value. *
* * @return Configuration of the target document attribute or metadata field when ingesting documents into Amazon * Kendra. You can also include a value. */ public DocumentAttributeTarget getTarget() { return this.target; } /** ** Configuration of the target document attribute or metadata field when ingesting documents into Amazon Kendra. You * can also include a value. *
* * @param target * Configuration of the target document attribute or metadata field when ingesting documents into Amazon * Kendra. You can also include a value. * @return Returns a reference to this object so that method calls can be chained together. */ public InlineCustomDocumentEnrichmentConfiguration withTarget(DocumentAttributeTarget target) { setTarget(target); return this; } /** *
* TRUE
to delete content if the condition used for the target attribute is met.
*
TRUE
to delete content if the condition used for the target attribute is met.
*/
public void setDocumentContentDeletion(Boolean documentContentDeletion) {
this.documentContentDeletion = documentContentDeletion;
}
/**
*
* TRUE
to delete content if the condition used for the target attribute is met.
*
TRUE
to delete content if the condition used for the target attribute is met.
*/
public Boolean getDocumentContentDeletion() {
return this.documentContentDeletion;
}
/**
*
* TRUE
to delete content if the condition used for the target attribute is met.
*
TRUE
to delete content if the condition used for the target attribute is met.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InlineCustomDocumentEnrichmentConfiguration withDocumentContentDeletion(Boolean documentContentDeletion) {
setDocumentContentDeletion(documentContentDeletion);
return this;
}
/**
*
* TRUE
to delete content if the condition used for the target attribute is met.
*
TRUE
to delete content if the condition used for the target attribute is met.
*/
public Boolean isDocumentContentDeletion() {
return this.documentContentDeletion;
}
/**
* 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 (getCondition() != null)
sb.append("Condition: ").append(getCondition()).append(",");
if (getTarget() != null)
sb.append("Target: ").append(getTarget()).append(",");
if (getDocumentContentDeletion() != null)
sb.append("DocumentContentDeletion: ").append(getDocumentContentDeletion());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof InlineCustomDocumentEnrichmentConfiguration == false)
return false;
InlineCustomDocumentEnrichmentConfiguration other = (InlineCustomDocumentEnrichmentConfiguration) obj;
if (other.getCondition() == null ^ this.getCondition() == null)
return false;
if (other.getCondition() != null && other.getCondition().equals(this.getCondition()) == false)
return false;
if (other.getTarget() == null ^ this.getTarget() == null)
return false;
if (other.getTarget() != null && other.getTarget().equals(this.getTarget()) == false)
return false;
if (other.getDocumentContentDeletion() == null ^ this.getDocumentContentDeletion() == null)
return false;
if (other.getDocumentContentDeletion() != null && other.getDocumentContentDeletion().equals(this.getDocumentContentDeletion()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCondition() == null) ? 0 : getCondition().hashCode());
hashCode = prime * hashCode + ((getTarget() == null) ? 0 : getTarget().hashCode());
hashCode = prime * hashCode + ((getDocumentContentDeletion() == null) ? 0 : getDocumentContentDeletion().hashCode());
return hashCode;
}
@Override
public InlineCustomDocumentEnrichmentConfiguration clone() {
try {
return (InlineCustomDocumentEnrichmentConfiguration) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.kendra.model.transform.InlineCustomDocumentEnrichmentConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}