Skip to content

Commit

Permalink
feat(aws-android-sdk-transcribe): update models to latest (#3364)
Browse files Browse the repository at this point in the history
Co-authored-by: Tyler Roach <tjroach@amazon.com>
  • Loading branch information
awsmobilesdk and tylerjroach authored Aug 11, 2023
1 parent 152718b commit 9134f0b
Show file tree
Hide file tree
Showing 12 changed files with 776 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,21 @@ public class StartTranscriptionJobRequest extends AmazonWebServiceRequest implem
*/
private java.util.Map<String, LanguageIdSettings> languageIdSettings;

/**
* <p>
* Enables toxic speech detection in your transcript. If you include
* <code>ToxicityDetection</code> in your request, you must also include
* <code>ToxicityCategories</code>.
* </p>
* <p>
* For information on the types of toxic speech Amazon Transcribe can
* detect, see <a href=
* "https://docs.aws.amazon.com/transcribe/latest/dg/toxic-language.html"
* >Detecting toxic speech</a>.
* </p>
*/
private java.util.List<ToxicityDetectionSettings> toxicityDetection;

/**
* <p>
* A unique name, chosen by you, for your transcription job. The name that
Expand Down Expand Up @@ -4172,6 +4187,149 @@ public StartTranscriptionJobRequest clearLanguageIdSettingsEntries() {
return this;
}

/**
* <p>
* Enables toxic speech detection in your transcript. If you include
* <code>ToxicityDetection</code> in your request, you must also include
* <code>ToxicityCategories</code>.
* </p>
* <p>
* For information on the types of toxic speech Amazon Transcribe can
* detect, see <a href=
* "https://docs.aws.amazon.com/transcribe/latest/dg/toxic-language.html"
* >Detecting toxic speech</a>.
* </p>
*
* @return <p>
* Enables toxic speech detection in your transcript. If you include
* <code>ToxicityDetection</code> in your request, you must also
* include <code>ToxicityCategories</code>.
* </p>
* <p>
* For information on the types of toxic speech Amazon Transcribe
* can detect, see <a href=
* "https://docs.aws.amazon.com/transcribe/latest/dg/toxic-language.html"
* >Detecting toxic speech</a>.
* </p>
*/
public java.util.List<ToxicityDetectionSettings> getToxicityDetection() {
return toxicityDetection;
}

/**
* <p>
* Enables toxic speech detection in your transcript. If you include
* <code>ToxicityDetection</code> in your request, you must also include
* <code>ToxicityCategories</code>.
* </p>
* <p>
* For information on the types of toxic speech Amazon Transcribe can
* detect, see <a href=
* "https://docs.aws.amazon.com/transcribe/latest/dg/toxic-language.html"
* >Detecting toxic speech</a>.
* </p>
*
* @param toxicityDetection <p>
* Enables toxic speech detection in your transcript. If you
* include <code>ToxicityDetection</code> in your request, you
* must also include <code>ToxicityCategories</code>.
* </p>
* <p>
* For information on the types of toxic speech Amazon Transcribe
* can detect, see <a href=
* "https://docs.aws.amazon.com/transcribe/latest/dg/toxic-language.html"
* >Detecting toxic speech</a>.
* </p>
*/
public void setToxicityDetection(
java.util.Collection<ToxicityDetectionSettings> toxicityDetection) {
if (toxicityDetection == null) {
this.toxicityDetection = null;
return;
}

this.toxicityDetection = new java.util.ArrayList<ToxicityDetectionSettings>(
toxicityDetection);
}

/**
* <p>
* Enables toxic speech detection in your transcript. If you include
* <code>ToxicityDetection</code> in your request, you must also include
* <code>ToxicityCategories</code>.
* </p>
* <p>
* For information on the types of toxic speech Amazon Transcribe can
* detect, see <a href=
* "https://docs.aws.amazon.com/transcribe/latest/dg/toxic-language.html"
* >Detecting toxic speech</a>.
* </p>
* <p>
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param toxicityDetection <p>
* Enables toxic speech detection in your transcript. If you
* include <code>ToxicityDetection</code> in your request, you
* must also include <code>ToxicityCategories</code>.
* </p>
* <p>
* For information on the types of toxic speech Amazon Transcribe
* can detect, see <a href=
* "https://docs.aws.amazon.com/transcribe/latest/dg/toxic-language.html"
* >Detecting toxic speech</a>.
* </p>
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public StartTranscriptionJobRequest withToxicityDetection(
ToxicityDetectionSettings... toxicityDetection) {
if (getToxicityDetection() == null) {
this.toxicityDetection = new java.util.ArrayList<ToxicityDetectionSettings>(
toxicityDetection.length);
}
for (ToxicityDetectionSettings value : toxicityDetection) {
this.toxicityDetection.add(value);
}
return this;
}

/**
* <p>
* Enables toxic speech detection in your transcript. If you include
* <code>ToxicityDetection</code> in your request, you must also include
* <code>ToxicityCategories</code>.
* </p>
* <p>
* For information on the types of toxic speech Amazon Transcribe can
* detect, see <a href=
* "https://docs.aws.amazon.com/transcribe/latest/dg/toxic-language.html"
* >Detecting toxic speech</a>.
* </p>
* <p>
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param toxicityDetection <p>
* Enables toxic speech detection in your transcript. If you
* include <code>ToxicityDetection</code> in your request, you
* must also include <code>ToxicityCategories</code>.
* </p>
* <p>
* For information on the types of toxic speech Amazon Transcribe
* can detect, see <a href=
* "https://docs.aws.amazon.com/transcribe/latest/dg/toxic-language.html"
* >Detecting toxic speech</a>.
* </p>
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public StartTranscriptionJobRequest withToxicityDetection(
java.util.Collection<ToxicityDetectionSettings> toxicityDetection) {
setToxicityDetection(toxicityDetection);
return this;
}

/**
* Returns a string representation of this object; useful for testing and
* debugging.
Expand Down Expand Up @@ -4220,7 +4378,9 @@ public String toString() {
if (getTags() != null)
sb.append("Tags: " + getTags() + ",");
if (getLanguageIdSettings() != null)
sb.append("LanguageIdSettings: " + getLanguageIdSettings());
sb.append("LanguageIdSettings: " + getLanguageIdSettings() + ",");
if (getToxicityDetection() != null)
sb.append("ToxicityDetection: " + getToxicityDetection());
sb.append("}");
return sb.toString();
}
Expand Down Expand Up @@ -4267,6 +4427,8 @@ public int hashCode() {
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode
+ ((getLanguageIdSettings() == null) ? 0 : getLanguageIdSettings().hashCode());
hashCode = prime * hashCode
+ ((getToxicityDetection() == null) ? 0 : getToxicityDetection().hashCode());
return hashCode;
}

Expand Down Expand Up @@ -4375,6 +4537,11 @@ public boolean equals(Object obj) {
if (other.getLanguageIdSettings() != null
&& other.getLanguageIdSettings().equals(this.getLanguageIdSettings()) == false)
return false;
if (other.getToxicityDetection() == null ^ this.getToxicityDetection() == null)
return false;
if (other.getToxicityDetection() != null
&& other.getToxicityDetection().equals(this.getToxicityDetection()) == false)
return false;
return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright 2010-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.transcribe.model;

import java.util.HashMap;
import java.util.Map;

/**
* Toxicity Category
*/
public enum ToxicityCategory {

ALL("ALL");

private String value;

private ToxicityCategory(String value) {
this.value = value;
}

@Override
public String toString() {
return value;
}

private static final Map<String, ToxicityCategory> enumMap;
static {
enumMap = new HashMap<String, ToxicityCategory>();
enumMap.put("ALL", ALL);
}

/**
* Use this in place of valueOf.
*
* @param value real value
* @return ToxicityCategory corresponding to the value
*/
public static ToxicityCategory fromValue(String value) {
if (value == null || value.isEmpty()) {
throw new IllegalArgumentException("Value cannot be null or empty!");
} else if (enumMap.containsKey(value)) {
return enumMap.get(value);
} else {
throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
}
}
}
Loading

0 comments on commit 9134f0b

Please sign in to comment.