com.amazonaws.services.transcribe.model.ContentRedaction Maven / Gradle / Ivy
/*
* 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.transcribe.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Makes it possible to redact or flag specified personally identifiable information (PII) in your transcript. If you
* use ContentRedaction
, you must also include the sub-parameters: RedactionOutput
and
* RedactionType
. You can optionally include PiiEntityTypes
to choose which types of PII you
* want to redact.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ContentRedaction implements Serializable, Cloneable, StructuredPojo {
/**
*
* Specify the category of information you want to redact; PII
(personally identifiable information) is
* the only valid value. You can use PiiEntityTypes
to choose which types of PII you want to redact. If
* you do not include PiiEntityTypes
in your request, all PII is redacted.
*
*/
private String redactionType;
/**
*
* Specify if you want only a redacted transcript, or if you want a redacted and an unredacted transcript.
*
*
* When you choose redacted
Amazon Transcribe creates only a redacted transcript.
*
*
* When you choose redacted_and_unredacted
Amazon Transcribe creates a redacted and an unredacted
* transcript (as two separate files).
*
*/
private String redactionOutput;
/**
*
* Specify which types of personally identifiable information (PII) you want to redact in your transcript. You can
* include as many types as you'd like, or you can select ALL
. If you do not include
* PiiEntityTypes
in your request, all PII is redacted.
*
*/
private java.util.List piiEntityTypes;
/**
*
* Specify the category of information you want to redact; PII
(personally identifiable information) is
* the only valid value. You can use PiiEntityTypes
to choose which types of PII you want to redact. If
* you do not include PiiEntityTypes
in your request, all PII is redacted.
*
*
* @param redactionType
* Specify the category of information you want to redact; PII
(personally identifiable
* information) is the only valid value. You can use PiiEntityTypes
to choose which types of PII
* you want to redact. If you do not include PiiEntityTypes
in your request, all PII is
* redacted.
* @see RedactionType
*/
public void setRedactionType(String redactionType) {
this.redactionType = redactionType;
}
/**
*
* Specify the category of information you want to redact; PII
(personally identifiable information) is
* the only valid value. You can use PiiEntityTypes
to choose which types of PII you want to redact. If
* you do not include PiiEntityTypes
in your request, all PII is redacted.
*
*
* @return Specify the category of information you want to redact; PII
(personally identifiable
* information) is the only valid value. You can use PiiEntityTypes
to choose which types of
* PII you want to redact. If you do not include PiiEntityTypes
in your request, all PII is
* redacted.
* @see RedactionType
*/
public String getRedactionType() {
return this.redactionType;
}
/**
*
* Specify the category of information you want to redact; PII
(personally identifiable information) is
* the only valid value. You can use PiiEntityTypes
to choose which types of PII you want to redact. If
* you do not include PiiEntityTypes
in your request, all PII is redacted.
*
*
* @param redactionType
* Specify the category of information you want to redact; PII
(personally identifiable
* information) is the only valid value. You can use PiiEntityTypes
to choose which types of PII
* you want to redact. If you do not include PiiEntityTypes
in your request, all PII is
* redacted.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RedactionType
*/
public ContentRedaction withRedactionType(String redactionType) {
setRedactionType(redactionType);
return this;
}
/**
*
* Specify the category of information you want to redact; PII
(personally identifiable information) is
* the only valid value. You can use PiiEntityTypes
to choose which types of PII you want to redact. If
* you do not include PiiEntityTypes
in your request, all PII is redacted.
*
*
* @param redactionType
* Specify the category of information you want to redact; PII
(personally identifiable
* information) is the only valid value. You can use PiiEntityTypes
to choose which types of PII
* you want to redact. If you do not include PiiEntityTypes
in your request, all PII is
* redacted.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RedactionType
*/
public ContentRedaction withRedactionType(RedactionType redactionType) {
this.redactionType = redactionType.toString();
return this;
}
/**
*
* Specify if you want only a redacted transcript, or if you want a redacted and an unredacted transcript.
*
*
* When you choose redacted
Amazon Transcribe creates only a redacted transcript.
*
*
* When you choose redacted_and_unredacted
Amazon Transcribe creates a redacted and an unredacted
* transcript (as two separate files).
*
*
* @param redactionOutput
* Specify if you want only a redacted transcript, or if you want a redacted and an unredacted
* transcript.
*
* When you choose redacted
Amazon Transcribe creates only a redacted transcript.
*
*
* When you choose redacted_and_unredacted
Amazon Transcribe creates a redacted and an
* unredacted transcript (as two separate files).
* @see RedactionOutput
*/
public void setRedactionOutput(String redactionOutput) {
this.redactionOutput = redactionOutput;
}
/**
*
* Specify if you want only a redacted transcript, or if you want a redacted and an unredacted transcript.
*
*
* When you choose redacted
Amazon Transcribe creates only a redacted transcript.
*
*
* When you choose redacted_and_unredacted
Amazon Transcribe creates a redacted and an unredacted
* transcript (as two separate files).
*
*
* @return Specify if you want only a redacted transcript, or if you want a redacted and an unredacted
* transcript.
*
* When you choose redacted
Amazon Transcribe creates only a redacted transcript.
*
*
* When you choose redacted_and_unredacted
Amazon Transcribe creates a redacted and an
* unredacted transcript (as two separate files).
* @see RedactionOutput
*/
public String getRedactionOutput() {
return this.redactionOutput;
}
/**
*
* Specify if you want only a redacted transcript, or if you want a redacted and an unredacted transcript.
*
*
* When you choose redacted
Amazon Transcribe creates only a redacted transcript.
*
*
* When you choose redacted_and_unredacted
Amazon Transcribe creates a redacted and an unredacted
* transcript (as two separate files).
*
*
* @param redactionOutput
* Specify if you want only a redacted transcript, or if you want a redacted and an unredacted
* transcript.
*
* When you choose redacted
Amazon Transcribe creates only a redacted transcript.
*
*
* When you choose redacted_and_unredacted
Amazon Transcribe creates a redacted and an
* unredacted transcript (as two separate files).
* @return Returns a reference to this object so that method calls can be chained together.
* @see RedactionOutput
*/
public ContentRedaction withRedactionOutput(String redactionOutput) {
setRedactionOutput(redactionOutput);
return this;
}
/**
*
* Specify if you want only a redacted transcript, or if you want a redacted and an unredacted transcript.
*
*
* When you choose redacted
Amazon Transcribe creates only a redacted transcript.
*
*
* When you choose redacted_and_unredacted
Amazon Transcribe creates a redacted and an unredacted
* transcript (as two separate files).
*
*
* @param redactionOutput
* Specify if you want only a redacted transcript, or if you want a redacted and an unredacted
* transcript.
*
* When you choose redacted
Amazon Transcribe creates only a redacted transcript.
*
*
* When you choose redacted_and_unredacted
Amazon Transcribe creates a redacted and an
* unredacted transcript (as two separate files).
* @return Returns a reference to this object so that method calls can be chained together.
* @see RedactionOutput
*/
public ContentRedaction withRedactionOutput(RedactionOutput redactionOutput) {
this.redactionOutput = redactionOutput.toString();
return this;
}
/**
*
* Specify which types of personally identifiable information (PII) you want to redact in your transcript. You can
* include as many types as you'd like, or you can select ALL
. If you do not include
* PiiEntityTypes
in your request, all PII is redacted.
*
*
* @return Specify which types of personally identifiable information (PII) you want to redact in your transcript.
* You can include as many types as you'd like, or you can select ALL
. If you do not include
* PiiEntityTypes
in your request, all PII is redacted.
* @see PiiEntityType
*/
public java.util.List getPiiEntityTypes() {
return piiEntityTypes;
}
/**
*
* Specify which types of personally identifiable information (PII) you want to redact in your transcript. You can
* include as many types as you'd like, or you can select ALL
. If you do not include
* PiiEntityTypes
in your request, all PII is redacted.
*
*
* @param piiEntityTypes
* Specify which types of personally identifiable information (PII) you want to redact in your transcript.
* You can include as many types as you'd like, or you can select ALL
. If you do not include
* PiiEntityTypes
in your request, all PII is redacted.
* @see PiiEntityType
*/
public void setPiiEntityTypes(java.util.Collection piiEntityTypes) {
if (piiEntityTypes == null) {
this.piiEntityTypes = null;
return;
}
this.piiEntityTypes = new java.util.ArrayList(piiEntityTypes);
}
/**
*
* Specify which types of personally identifiable information (PII) you want to redact in your transcript. You can
* include as many types as you'd like, or you can select ALL
. If you do not include
* PiiEntityTypes
in your request, all PII is redacted.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPiiEntityTypes(java.util.Collection)} or {@link #withPiiEntityTypes(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param piiEntityTypes
* Specify which types of personally identifiable information (PII) you want to redact in your transcript.
* You can include as many types as you'd like, or you can select ALL
. If you do not include
* PiiEntityTypes
in your request, all PII is redacted.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PiiEntityType
*/
public ContentRedaction withPiiEntityTypes(String... piiEntityTypes) {
if (this.piiEntityTypes == null) {
setPiiEntityTypes(new java.util.ArrayList(piiEntityTypes.length));
}
for (String ele : piiEntityTypes) {
this.piiEntityTypes.add(ele);
}
return this;
}
/**
*
* Specify which types of personally identifiable information (PII) you want to redact in your transcript. You can
* include as many types as you'd like, or you can select ALL
. If you do not include
* PiiEntityTypes
in your request, all PII is redacted.
*
*
* @param piiEntityTypes
* Specify which types of personally identifiable information (PII) you want to redact in your transcript.
* You can include as many types as you'd like, or you can select ALL
. If you do not include
* PiiEntityTypes
in your request, all PII is redacted.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PiiEntityType
*/
public ContentRedaction withPiiEntityTypes(java.util.Collection piiEntityTypes) {
setPiiEntityTypes(piiEntityTypes);
return this;
}
/**
*
* Specify which types of personally identifiable information (PII) you want to redact in your transcript. You can
* include as many types as you'd like, or you can select ALL
. If you do not include
* PiiEntityTypes
in your request, all PII is redacted.
*
*
* @param piiEntityTypes
* Specify which types of personally identifiable information (PII) you want to redact in your transcript.
* You can include as many types as you'd like, or you can select ALL
. If you do not include
* PiiEntityTypes
in your request, all PII is redacted.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PiiEntityType
*/
public ContentRedaction withPiiEntityTypes(PiiEntityType... piiEntityTypes) {
java.util.ArrayList piiEntityTypesCopy = new java.util.ArrayList(piiEntityTypes.length);
for (PiiEntityType value : piiEntityTypes) {
piiEntityTypesCopy.add(value.toString());
}
if (getPiiEntityTypes() == null) {
setPiiEntityTypes(piiEntityTypesCopy);
} else {
getPiiEntityTypes().addAll(piiEntityTypesCopy);
}
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 (getRedactionType() != null)
sb.append("RedactionType: ").append(getRedactionType()).append(",");
if (getRedactionOutput() != null)
sb.append("RedactionOutput: ").append(getRedactionOutput()).append(",");
if (getPiiEntityTypes() != null)
sb.append("PiiEntityTypes: ").append(getPiiEntityTypes());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ContentRedaction == false)
return false;
ContentRedaction other = (ContentRedaction) obj;
if (other.getRedactionType() == null ^ this.getRedactionType() == null)
return false;
if (other.getRedactionType() != null && other.getRedactionType().equals(this.getRedactionType()) == false)
return false;
if (other.getRedactionOutput() == null ^ this.getRedactionOutput() == null)
return false;
if (other.getRedactionOutput() != null && other.getRedactionOutput().equals(this.getRedactionOutput()) == false)
return false;
if (other.getPiiEntityTypes() == null ^ this.getPiiEntityTypes() == null)
return false;
if (other.getPiiEntityTypes() != null && other.getPiiEntityTypes().equals(this.getPiiEntityTypes()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getRedactionType() == null) ? 0 : getRedactionType().hashCode());
hashCode = prime * hashCode + ((getRedactionOutput() == null) ? 0 : getRedactionOutput().hashCode());
hashCode = prime * hashCode + ((getPiiEntityTypes() == null) ? 0 : getPiiEntityTypes().hashCode());
return hashCode;
}
@Override
public ContentRedaction clone() {
try {
return (ContentRedaction) 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.transcribe.model.transform.ContentRedactionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}