From e8ce8b3dc2390a5e21a30edfe7599fbca1ab7298 Mon Sep 17 00:00:00 2001 From: awsmobilesdk Date: Tue, 31 Oct 2023 18:20:51 +0000 Subject: [PATCH] feat(aws-android-sdk-translate): update models to latest --- .../services/translate/AmazonTranslate.java | 13 +- .../translate/AmazonTranslateAsync.java | 26 +- .../translate/AmazonTranslateAsyncClient.java | 26 +- .../translate/AmazonTranslateClient.java | 13 +- .../services/translate/model/Brevity.java | 60 +++ .../services/translate/model/Document.java | 102 +++-- .../model/StartTextTranslationJobRequest.java | 157 +++++++- .../model/TranslateDocumentRequest.java | 320 ++++++++++++--- .../model/TranslateDocumentResult.java | 164 +++++++- .../translate/model/TranslateTextRequest.java | 164 +++++++- .../translate/model/TranslationSettings.java | 380 +++++++++++++++--- .../TranslationSettingsJsonMarshaller.java | 5 + .../TranslationSettingsJsonUnmarshaller.java | 3 + 13 files changed, 1183 insertions(+), 250 deletions(-) create mode 100644 aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/Brevity.java diff --git a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslate.java b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslate.java index dd3d443348d..571fdf16262 100644 --- a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslate.java +++ b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslate.java @@ -495,14 +495,11 @@ TagResourceResult tagResource(TagResourceRequest tagResourceRequest) /** *

* Translates the input document from the source language to the target - * language. This synchronous operation supports plain text or HTML for the - * input document. TranslateDocument supports translations from - * English to any supported language, and from any supported language to - * English. Therefore, specify either the source language code or the target - * language code as “en” (English). - *

- *

- * TranslateDocument does not support language auto-detection. + * language. This synchronous operation supports text, HTML, or Word + * documents as the input document. TranslateDocument supports + * translations from English to any supported language, and from any + * supported language to English. Therefore, specify either the source + * language code or the target language code as “en” (English). *

*

* If you set the Formality parameter, the request will fail if diff --git a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateAsync.java b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateAsync.java index 221de78cdc0..5daf28193e3 100644 --- a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateAsync.java +++ b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateAsync.java @@ -945,14 +945,11 @@ Future tagResourceAsync(TagResourceRequest tagResourceRequest /** *

* Translates the input document from the source language to the target - * language. This synchronous operation supports plain text or HTML for the - * input document. TranslateDocument supports translations from - * English to any supported language, and from any supported language to - * English. Therefore, specify either the source language code or the target - * language code as “en” (English). - *

- *

- * TranslateDocument does not support language auto-detection. + * language. This synchronous operation supports text, HTML, or Word + * documents as the input document. TranslateDocument supports + * translations from English to any supported language, and from any + * supported language to English. Therefore, specify either the source + * language code or the target language code as “en” (English). *

*

* If you set the Formality parameter, the request will fail if @@ -988,14 +985,11 @@ Future translateDocumentAsync( /** *

* Translates the input document from the source language to the target - * language. This synchronous operation supports plain text or HTML for the - * input document. TranslateDocument supports translations from - * English to any supported language, and from any supported language to - * English. Therefore, specify either the source language code or the target - * language code as “en” (English). - *

- *

- * TranslateDocument does not support language auto-detection. + * language. This synchronous operation supports text, HTML, or Word + * documents as the input document. TranslateDocument supports + * translations from English to any supported language, and from any + * supported language to English. Therefore, specify either the source + * language code or the target language code as “en” (English). *

*

* If you set the Formality parameter, the request will fail if diff --git a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateAsyncClient.java b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateAsyncClient.java index c420eea2ab0..a7d7912cd87 100644 --- a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateAsyncClient.java +++ b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateAsyncClient.java @@ -1420,14 +1420,11 @@ public TagResourceResult call() throws Exception { /** *

* Translates the input document from the source language to the target - * language. This synchronous operation supports plain text or HTML for the - * input document. TranslateDocument supports translations from - * English to any supported language, and from any supported language to - * English. Therefore, specify either the source language code or the target - * language code as “en” (English). - *

- *

- * TranslateDocument does not support language auto-detection. + * language. This synchronous operation supports text, HTML, or Word + * documents as the input document. TranslateDocument supports + * translations from English to any supported language, and from any + * supported language to English. Therefore, specify either the source + * language code or the target language code as “en” (English). *

*

* If you set the Formality parameter, the request will fail if @@ -1469,14 +1466,11 @@ public TranslateDocumentResult call() throws Exception { /** *

* Translates the input document from the source language to the target - * language. This synchronous operation supports plain text or HTML for the - * input document. TranslateDocument supports translations from - * English to any supported language, and from any supported language to - * English. Therefore, specify either the source language code or the target - * language code as “en” (English). - *

- *

- * TranslateDocument does not support language auto-detection. + * language. This synchronous operation supports text, HTML, or Word + * documents as the input document. TranslateDocument supports + * translations from English to any supported language, and from any + * supported language to English. Therefore, specify either the source + * language code or the target language code as “en” (English). *

*

* If you set the Formality parameter, the request will fail if diff --git a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateClient.java b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateClient.java index ec19aea4f37..b22672433c9 100644 --- a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateClient.java +++ b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateClient.java @@ -1168,14 +1168,11 @@ public TagResourceResult tagResource(TagResourceRequest tagResourceRequest) /** *

* Translates the input document from the source language to the target - * language. This synchronous operation supports plain text or HTML for the - * input document. TranslateDocument supports translations from - * English to any supported language, and from any supported language to - * English. Therefore, specify either the source language code or the target - * language code as “en” (English). - *

- *

- * TranslateDocument does not support language auto-detection. + * language. This synchronous operation supports text, HTML, or Word + * documents as the input document. TranslateDocument supports + * translations from English to any supported language, and from any + * supported language to English. Therefore, specify either the source + * language code or the target language code as “en” (English). *

*

* If you set the Formality parameter, the request will fail if diff --git a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/Brevity.java b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/Brevity.java new file mode 100644 index 00000000000..4b32017abb7 --- /dev/null +++ b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/Brevity.java @@ -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.translate.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * Brevity + */ +public enum Brevity { + + ON("ON"); + + private String value; + + private Brevity(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + + private static final Map enumMap; + static { + enumMap = new HashMap(); + enumMap.put("ON", ON); + } + + /** + * Use this in place of valueOf. + * + * @param value real value + * @return Brevity corresponding to the value + */ + public static Brevity 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!"); + } + } +} diff --git a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/Document.java b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/Document.java index 190d242c3b3..9c0f82ccab3 100644 --- a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/Document.java +++ b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/Document.java @@ -44,14 +44,20 @@ public class Document implements Serializable { *

@@ -145,14 +151,20 @@ public Document withContent(java.nio.ByteBuffer content) { * @@ -168,14 +180,20 @@ public Document withContent(java.nio.ByteBuffer content) { * @@ -192,14 +210,20 @@ public String getContentType() { * @@ -215,14 +239,22 @@ public String getContentType() { * @@ -239,14 +271,20 @@ public void setContentType(String contentType) { * @@ -265,14 +303,22 @@ public void setContentType(String contentType) { * diff --git a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/StartTextTranslationJobRequest.java b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/StartTextTranslationJobRequest.java index b7c8f826622..6742fb0a0fc 100644 --- a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/StartTextTranslationJobRequest.java +++ b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/StartTextTranslationJobRequest.java @@ -185,10 +185,26 @@ public class StartTextTranslationJobRequest extends AmazonWebServiceRequest impl /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: *

+ * */ private TranslationSettings settings; @@ -1259,16 +1275,49 @@ public StartTextTranslationJobRequest withClientToken(String clientToken) { /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: *

+ * * * @return

- * Settings to configure your translation output, including the - * option to set the formality level of the output text and the - * option to mask profane words and phrases. + * Settings to configure your translation output. You can configure + * the following options: + *

+ * */ public TranslationSettings getSettings() { return settings; @@ -1276,16 +1325,49 @@ public TranslationSettings getSettings() { /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: + *

+ * * * @param settings

- * Settings to configure your translation output, including the - * option to set the formality level of the output text and the - * option to mask profane words and phrases. + * Settings to configure your translation output. You can + * configure the following options: *

+ * */ public void setSettings(TranslationSettings settings) { this.settings = settings; @@ -1293,19 +1375,52 @@ public void setSettings(TranslationSettings settings) { /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: + *

+ * *

* Returns a reference to this object so that method calls can be chained * together. * * @param settings

- * Settings to configure your translation output, including the - * option to set the formality level of the output text and the - * option to mask profane words and phrases. + * Settings to configure your translation output. You can + * configure the following options: + *

+ * * @return A reference to this updated object so that method calls can be * chained together. */ diff --git a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslateDocumentRequest.java b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslateDocumentRequest.java index 106397d5288..64afc1837b2 100644 --- a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslateDocumentRequest.java +++ b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslateDocumentRequest.java @@ -22,16 +22,13 @@ /** *

* Translates the input document from the source language to the target - * language. This synchronous operation supports plain text or HTML for the - * input document. TranslateDocument supports translations from - * English to any supported language, and from any supported language to + * language. This synchronous operation supports text, HTML, or Word documents + * as the input document. TranslateDocument supports translations + * from English to any supported language, and from any supported language to * English. Therefore, specify either the source language code or the target * language code as “en” (English). *

*

- * TranslateDocument does not support language auto-detection. - *

- *

* If you set the Formality parameter, the request will fail if the * target language does not support formality. For a list of target languages * that support formality, see - * The language code for the language of the source text. Do not use - * auto, because TranslateDocument does not - * support language auto-detection. For a list of supported language codes, - * see Supported languages. *

*

+ * To have Amazon Translate determine the source language of your text, you + * can specify auto in the SourceLanguageCode + * field. If you specify auto, Amazon Translate will call Amazon Comprehend to determine the source language. + *

+ * + *

+ * If you specify auto, you must send the + * TranslateDocument request in a region that supports Amazon + * Comprehend. Otherwise, the request returns an error indicating that + * autodetect is not supported. + *

+ *
+ *

* Constraints:
* Length: 2 - 5
*/ @@ -97,10 +108,26 @@ public class TranslateDocumentRequest extends AmazonWebServiceRequest implements /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: + *

+ * */ private TranslationSettings settings; @@ -335,25 +362,53 @@ public TranslateDocumentRequest withTerminologyNames( /** *

- * The language code for the language of the source text. Do not use - * auto, because TranslateDocument does not - * support language auto-detection. For a list of supported language codes, - * see Supported languages. *

*

+ * To have Amazon Translate determine the source language of your text, you + * can specify auto in the SourceLanguageCode + * field. If you specify auto, Amazon Translate will call Amazon Comprehend to determine the source language. + *

+ * + *

+ * If you specify auto, you must send the + * TranslateDocument request in a region that supports Amazon + * Comprehend. Otherwise, the request returns an error indicating that + * autodetect is not supported. + *

+ *
+ *

* Constraints:
* Length: 2 - 5
* * @return

- * The language code for the language of the source text. Do not use - * auto, because TranslateDocument does - * not support language auto-detection. For a list of supported - * language codes, see Supported languages. *

+ *

+ * To have Amazon Translate determine the source language of your + * text, you can specify auto in the + * SourceLanguageCode field. If you specify + * auto, Amazon Translate will call Amazon Comprehend to determine the source language. + *

+ * + *

+ * If you specify auto, you must send the + * TranslateDocument request in a region that supports + * Amazon Comprehend. Otherwise, the request returns an error + * indicating that autodetect is not supported. + *

+ *
*/ public String getSourceLanguageCode() { return sourceLanguageCode; @@ -361,25 +416,53 @@ public String getSourceLanguageCode() { /** *

- * The language code for the language of the source text. Do not use - * auto, because TranslateDocument does not - * support language auto-detection. For a list of supported language codes, - * see Supported languages. *

*

+ * To have Amazon Translate determine the source language of your text, you + * can specify auto in the SourceLanguageCode + * field. If you specify auto, Amazon Translate will call Amazon Comprehend to determine the source language. + *

+ * + *

+ * If you specify auto, you must send the + * TranslateDocument request in a region that supports Amazon + * Comprehend. Otherwise, the request returns an error indicating that + * autodetect is not supported. + *

+ *
+ *

* Constraints:
* Length: 2 - 5
* * @param sourceLanguageCode

- * The language code for the language of the source text. Do not - * use auto, because TranslateDocument - * does not support language auto-detection. For a list of - * supported language codes, see Supported languages. *

+ *

+ * To have Amazon Translate determine the source language of your + * text, you can specify auto in the + * SourceLanguageCode field. If you specify + * auto, Amazon Translate will call Amazon Comprehend to determine the source language. + *

+ * + *

+ * If you specify auto, you must send the + * TranslateDocument request in a region that + * supports Amazon Comprehend. Otherwise, the request returns an + * error indicating that autodetect is not supported. + *

+ *
*/ public void setSourceLanguageCode(String sourceLanguageCode) { this.sourceLanguageCode = sourceLanguageCode; @@ -387,14 +470,28 @@ public void setSourceLanguageCode(String sourceLanguageCode) { /** *

- * The language code for the language of the source text. Do not use - * auto, because TranslateDocument does not - * support language auto-detection. For a list of supported language codes, - * see Supported languages. *

*

+ * To have Amazon Translate determine the source language of your text, you + * can specify auto in the SourceLanguageCode + * field. If you specify auto, Amazon Translate will call Amazon Comprehend to determine the source language. + *

+ * + *

+ * If you specify auto, you must send the + * TranslateDocument request in a region that supports Amazon + * Comprehend. Otherwise, the request returns an error indicating that + * autodetect is not supported. + *

+ *
+ *

* Returns a reference to this object so that method calls can be chained * together. *

@@ -402,13 +499,27 @@ public void setSourceLanguageCode(String sourceLanguageCode) { * Length: 2 - 5
* * @param sourceLanguageCode

- * The language code for the language of the source text. Do not - * use auto, because TranslateDocument - * does not support language auto-detection. For a list of - * supported language codes, see Supported languages. *

+ *

+ * To have Amazon Translate determine the source language of your + * text, you can specify auto in the + * SourceLanguageCode field. If you specify + * auto, Amazon Translate will call Amazon Comprehend to determine the source language. + *

+ * + *

+ * If you specify auto, you must send the + * TranslateDocument request in a region that + * supports Amazon Comprehend. Otherwise, the request returns an + * error indicating that autodetect is not supported. + *

+ *
* @return A reference to this updated object so that method calls can be * chained together. */ @@ -491,16 +602,49 @@ public TranslateDocumentRequest withTargetLanguageCode(String targetLanguageCode /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: + *

+ * * * @return

- * Settings to configure your translation output, including the - * option to set the formality level of the output text and the - * option to mask profane words and phrases. + * Settings to configure your translation output. You can configure + * the following options: + *

+ * */ public TranslationSettings getSettings() { return settings; @@ -508,16 +652,49 @@ public TranslationSettings getSettings() { /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: *

+ * * * @param settings

- * Settings to configure your translation output, including the - * option to set the formality level of the output text and the - * option to mask profane words and phrases. + * Settings to configure your translation output. You can + * configure the following options: + *

+ * */ public void setSettings(TranslationSettings settings) { this.settings = settings; @@ -525,19 +702,52 @@ public void setSettings(TranslationSettings settings) { /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: *

+ * *

* Returns a reference to this object so that method calls can be chained * together. * * @param settings

- * Settings to configure your translation output, including the - * option to set the formality level of the output text and the - * option to mask profane words and phrases. + * Settings to configure your translation output. You can + * configure the following options: + *

+ * * @return A reference to this updated object so that method calls can be * chained together. */ diff --git a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslateDocumentResult.java b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslateDocumentResult.java index 9024457bcf1..6cd929260f9 100644 --- a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslateDocumentResult.java +++ b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslateDocumentResult.java @@ -56,10 +56,27 @@ public class TranslateDocumentResult implements Serializable { /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: *

+ * */ private TranslationSettings appliedSettings; @@ -314,16 +331,51 @@ public TranslateDocumentResult withAppliedTerminologies( /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: + *

+ * * * @return

- * Settings to configure your translation output, including the - * option to set the formality level of the output text and the - * option to mask profane words and phrases. + * Settings to configure your translation output. You can configure + * the following options: + *

+ * */ public TranslationSettings getAppliedSettings() { return appliedSettings; @@ -331,16 +383,51 @@ public TranslationSettings getAppliedSettings() { /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: + *

+ * * * @param appliedSettings

- * Settings to configure your translation output, including the - * option to set the formality level of the output text and the - * option to mask profane words and phrases. + * Settings to configure your translation output. You can + * configure the following options: *

+ * */ public void setAppliedSettings(TranslationSettings appliedSettings) { this.appliedSettings = appliedSettings; @@ -348,19 +435,54 @@ public void setAppliedSettings(TranslationSettings appliedSettings) { /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: + *

+ * *

* Returns a reference to this object so that method calls can be chained * together. * * @param appliedSettings

- * Settings to configure your translation output, including the - * option to set the formality level of the output text and the - * option to mask profane words and phrases. + * Settings to configure your translation output. You can + * configure the following options: + *

+ * * @return A reference to this updated object so that method calls can be * chained together. */ diff --git a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslateTextRequest.java b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslateTextRequest.java index c81fc656b2a..67ed3a74d3f 100644 --- a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslateTextRequest.java +++ b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslateTextRequest.java @@ -104,10 +104,27 @@ public class TranslateTextRequest extends AmazonWebServiceRequest implements Ser /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: *

+ * */ private TranslationSettings settings; @@ -599,16 +616,51 @@ public TranslateTextRequest withTargetLanguageCode(String targetLanguageCode) { /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: *

+ * * * @return

- * Settings to configure your translation output, including the - * option to set the formality level of the output text and the - * option to mask profane words and phrases. + * Settings to configure your translation output. You can configure + * the following options: + *

+ * */ public TranslationSettings getSettings() { return settings; @@ -616,16 +668,51 @@ public TranslationSettings getSettings() { /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: + *

+ * * * @param settings

- * Settings to configure your translation output, including the - * option to set the formality level of the output text and the - * option to mask profane words and phrases. + * Settings to configure your translation output. You can + * configure the following options: *

+ * */ public void setSettings(TranslationSettings settings) { this.settings = settings; @@ -633,19 +720,54 @@ public void setSettings(TranslationSettings settings) { /** *

- * Settings to configure your translation output, including the option to - * set the formality level of the output text and the option to mask profane - * words and phrases. + * Settings to configure your translation output. You can configure the + * following options: + *

+ * *

* Returns a reference to this object so that method calls can be chained * together. * * @param settings

- * Settings to configure your translation output, including the - * option to set the formality level of the output text and the - * option to mask profane words and phrases. + * Settings to configure your translation output. You can + * configure the following options: + *

+ * * @return A reference to this updated object so that method calls can be * chained together. */ diff --git a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslationSettings.java b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslationSettings.java index 102f1878bb7..cbbb444b1a5 100644 --- a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslationSettings.java +++ b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/TranslationSettings.java @@ -19,17 +19,34 @@ /** *

- * Settings to configure your translation output, including the option to set - * the formality level of the output text and the option to mask profane words - * and phrases. + * Settings to configure your translation output. You can configure the + * following options: *

+ * */ public class TranslationSettings implements Serializable { /** *

- * You can optionally specify the desired level of formality for - * translations to supported target languages. The formality setting - * controls the level of formal language usage (also known as register) in the translation output. You can set the value to * informal or formal. If you don't specify a value for formality, or if the @@ -53,8 +70,8 @@ public class TranslationSettings implements Serializable { /** *

- * Enable the profanity setting if you want Amazon Translate to mask profane - * words and phrases in your translation output. + * You can enable the profanity setting if you want to mask profane words + * and phrases in your translation output. *

*

* To mask profane words and phrases, Amazon Translate replaces them with @@ -82,9 +99,31 @@ public class TranslationSettings implements Serializable { /** *

- * You can optionally specify the desired level of formality for - * translations to supported target languages. The formality setting - * controls the level of formal language usage (also known as + *

+ * If you turn on brevity for a translation request with an unsupported + * language pair, the translation proceeds with the brevity setting turned + * off. + *

+ *

+ * For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide. + *

+ *

+ * Constraints:
+ * Allowed Values: ON + */ + private String brevity; + + /** + *

+ * You can specify the desired level of formality for translations to + * supported target languages. The formality setting controls the level of + * formal language usage (also known as register) in the translation output. You can set the value to * informal or formal. If you don't specify a value for formality, or if the @@ -105,14 +144,14 @@ public class TranslationSettings implements Serializable { * Allowed Values: FORMAL, INFORMAL * * @return

- * You can optionally specify the desired level of formality for - * translations to supported target languages. The formality setting - * controls the level of formal language usage (also known as - * register) in the translation output. You can set the value to - * informal or formal. If you don't specify a value for formality, - * or if the target language doesn't support formality, the - * translation will ignore the formality setting. + * You can specify the desired level of formality for translations + * to supported target languages. The formality setting controls the + * level of formal language usage (also known as register) in the translation output. You can set the value + * to informal or formal. If you don't specify a value for + * formality, or if the target language doesn't support formality, + * the translation will ignore the formality setting. *

*

* If you specify multiple target languages for the job, translate @@ -133,9 +172,9 @@ public String getFormality() { /** *

- * You can optionally specify the desired level of formality for - * translations to supported target languages. The formality setting - * controls the level of formal language usage (also known as register) in the translation output. You can set the value to * informal or formal. If you don't specify a value for formality, or if the @@ -156,7 +195,7 @@ public String getFormality() { * Allowed Values: FORMAL, INFORMAL * * @param formality

- * You can optionally specify the desired level of formality for + * You can specify the desired level of formality for * translations to supported target languages. The formality * setting controls the level of formal language usage (also * known as - * You can optionally specify the desired level of formality for - * translations to supported target languages. The formality setting - * controls the level of formal language usage (also known as register) in the translation output. You can set the value to * informal or formal. If you don't specify a value for formality, or if the @@ -212,7 +251,7 @@ public void setFormality(String formality) { * Allowed Values: FORMAL, INFORMAL * * @param formality

- * You can optionally specify the desired level of formality for + * You can specify the desired level of formality for * translations to supported target languages. The formality * setting controls the level of formal language usage (also * known as - * You can optionally specify the desired level of formality for - * translations to supported target languages. The formality setting - * controls the level of formal language usage (also known as register) in the translation output. You can set the value to * informal or formal. If you don't specify a value for formality, or if the @@ -268,7 +307,7 @@ public TranslationSettings withFormality(String formality) { * Allowed Values: FORMAL, INFORMAL * * @param formality

- * You can optionally specify the desired level of formality for + * You can specify the desired level of formality for * translations to supported target languages. The formality * setting controls the level of formal language usage (also * known as - * You can optionally specify the desired level of formality for - * translations to supported target languages. The formality setting - * controls the level of formal language usage (also known as register) in the translation output. You can set the value to * informal or formal. If you don't specify a value for formality, or if the @@ -324,7 +363,7 @@ public void setFormality(Formality formality) { * Allowed Values: FORMAL, INFORMAL * * @param formality

- * You can optionally specify the desired level of formality for + * You can specify the desired level of formality for * translations to supported target languages. The formality * setting controls the level of formal language usage (also * known as - * Enable the profanity setting if you want Amazon Translate to mask profane - * words and phrases in your translation output. + * You can enable the profanity setting if you want to mask profane words + * and phrases in your translation output. *

*

* To mask profane words and phrases, Amazon Translate replaces them with @@ -383,8 +422,8 @@ public TranslationSettings withFormality(Formality formality) { * Allowed Values: MASK * * @return

- * Enable the profanity setting if you want Amazon Translate to mask - * profane words and phrases in your translation output. + * You can enable the profanity setting if you want to mask profane + * words and phrases in your translation output. *

*

* To mask profane words and phrases, Amazon Translate replaces them @@ -414,8 +453,8 @@ public String getProfanity() { /** *

- * Enable the profanity setting if you want Amazon Translate to mask profane - * words and phrases in your translation output. + * You can enable the profanity setting if you want to mask profane words + * and phrases in your translation output. *

*

* To mask profane words and phrases, Amazon Translate replaces them with @@ -440,8 +479,8 @@ public String getProfanity() { * Allowed Values: MASK * * @param profanity

- * Enable the profanity setting if you want Amazon Translate to - * mask profane words and phrases in your translation output. + * You can enable the profanity setting if you want to mask + * profane words and phrases in your translation output. *

*

* To mask profane words and phrases, Amazon Translate replaces @@ -471,8 +510,8 @@ public void setProfanity(String profanity) { /** *

- * Enable the profanity setting if you want Amazon Translate to mask profane - * words and phrases in your translation output. + * You can enable the profanity setting if you want to mask profane words + * and phrases in your translation output. *

*

* To mask profane words and phrases, Amazon Translate replaces them with @@ -500,8 +539,8 @@ public void setProfanity(String profanity) { * Allowed Values: MASK * * @param profanity

- * Enable the profanity setting if you want Amazon Translate to - * mask profane words and phrases in your translation output. + * You can enable the profanity setting if you want to mask + * profane words and phrases in your translation output. *

*

* To mask profane words and phrases, Amazon Translate replaces @@ -534,8 +573,8 @@ public TranslationSettings withProfanity(String profanity) { /** *

- * Enable the profanity setting if you want Amazon Translate to mask profane - * words and phrases in your translation output. + * You can enable the profanity setting if you want to mask profane words + * and phrases in your translation output. *

*

* To mask profane words and phrases, Amazon Translate replaces them with @@ -560,8 +599,8 @@ public TranslationSettings withProfanity(String profanity) { * Allowed Values: MASK * * @param profanity

- * Enable the profanity setting if you want Amazon Translate to - * mask profane words and phrases in your translation output. + * You can enable the profanity setting if you want to mask + * profane words and phrases in your translation output. *

*

* To mask profane words and phrases, Amazon Translate replaces @@ -591,8 +630,8 @@ public void setProfanity(Profanity profanity) { /** *

- * Enable the profanity setting if you want Amazon Translate to mask profane - * words and phrases in your translation output. + * You can enable the profanity setting if you want to mask profane words + * and phrases in your translation output. *

*

* To mask profane words and phrases, Amazon Translate replaces them with @@ -620,8 +659,8 @@ public void setProfanity(Profanity profanity) { * Allowed Values: MASK * * @param profanity

- * Enable the profanity setting if you want Amazon Translate to - * mask profane words and phrases in your translation output. + * You can enable the profanity setting if you want to mask + * profane words and phrases in your translation output. *

*

* To mask profane words and phrases, Amazon Translate replaces @@ -652,6 +691,228 @@ public TranslationSettings withProfanity(Profanity profanity) { return this; } + /** + *

+ * When you turn on brevity, Amazon Translate reduces the length of the + * translation output for most translations (when compared with the same + * translation with brevity turned off). By default, brevity is turned off. + *

+ *

+ * If you turn on brevity for a translation request with an unsupported + * language pair, the translation proceeds with the brevity setting turned + * off. + *

+ *

+ * For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide. + *

+ *

+ * Constraints:
+ * Allowed Values: ON + * + * @return

+ * When you turn on brevity, Amazon Translate reduces the length of + * the translation output for most translations (when compared with + * the same translation with brevity turned off). By default, + * brevity is turned off. + *

+ *

+ * If you turn on brevity for a translation request with an + * unsupported language pair, the translation proceeds with the + * brevity setting turned off. + *

+ *

+ * For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide. + *

+ * @see Brevity + */ + public String getBrevity() { + return brevity; + } + + /** + *

+ * When you turn on brevity, Amazon Translate reduces the length of the + * translation output for most translations (when compared with the same + * translation with brevity turned off). By default, brevity is turned off. + *

+ *

+ * If you turn on brevity for a translation request with an unsupported + * language pair, the translation proceeds with the brevity setting turned + * off. + *

+ *

+ * For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide. + *

+ *

+ * Constraints:
+ * Allowed Values: ON + * + * @param brevity

+ * When you turn on brevity, Amazon Translate reduces the length + * of the translation output for most translations (when compared + * with the same translation with brevity turned off). By + * default, brevity is turned off. + *

+ *

+ * If you turn on brevity for a translation request with an + * unsupported language pair, the translation proceeds with the + * brevity setting turned off. + *

+ *

+ * For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide. + *

+ * @see Brevity + */ + public void setBrevity(String brevity) { + this.brevity = brevity; + } + + /** + *

+ * When you turn on brevity, Amazon Translate reduces the length of the + * translation output for most translations (when compared with the same + * translation with brevity turned off). By default, brevity is turned off. + *

+ *

+ * If you turn on brevity for a translation request with an unsupported + * language pair, the translation proceeds with the brevity setting turned + * off. + *

+ *

+ * For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: ON + * + * @param brevity

+ * When you turn on brevity, Amazon Translate reduces the length + * of the translation output for most translations (when compared + * with the same translation with brevity turned off). By + * default, brevity is turned off. + *

+ *

+ * If you turn on brevity for a translation request with an + * unsupported language pair, the translation proceeds with the + * brevity setting turned off. + *

+ *

+ * For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see Brevity + */ + public TranslationSettings withBrevity(String brevity) { + this.brevity = brevity; + return this; + } + + /** + *

+ * When you turn on brevity, Amazon Translate reduces the length of the + * translation output for most translations (when compared with the same + * translation with brevity turned off). By default, brevity is turned off. + *

+ *

+ * If you turn on brevity for a translation request with an unsupported + * language pair, the translation proceeds with the brevity setting turned + * off. + *

+ *

+ * For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide. + *

+ *

+ * Constraints:
+ * Allowed Values: ON + * + * @param brevity

+ * When you turn on brevity, Amazon Translate reduces the length + * of the translation output for most translations (when compared + * with the same translation with brevity turned off). By + * default, brevity is turned off. + *

+ *

+ * If you turn on brevity for a translation request with an + * unsupported language pair, the translation proceeds with the + * brevity setting turned off. + *

+ *

+ * For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide. + *

+ * @see Brevity + */ + public void setBrevity(Brevity brevity) { + this.brevity = brevity.toString(); + } + + /** + *

+ * When you turn on brevity, Amazon Translate reduces the length of the + * translation output for most translations (when compared with the same + * translation with brevity turned off). By default, brevity is turned off. + *

+ *

+ * If you turn on brevity for a translation request with an unsupported + * language pair, the translation proceeds with the brevity setting turned + * off. + *

+ *

+ * For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: ON + * + * @param brevity

+ * When you turn on brevity, Amazon Translate reduces the length + * of the translation output for most translations (when compared + * with the same translation with brevity turned off). By + * default, brevity is turned off. + *

+ *

+ * If you turn on brevity for a translation request with an + * unsupported language pair, the translation proceeds with the + * brevity setting turned off. + *

+ *

+ * For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see Brevity + */ + public TranslationSettings withBrevity(Brevity brevity) { + this.brevity = brevity.toString(); + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -666,7 +927,9 @@ public String toString() { if (getFormality() != null) sb.append("Formality: " + getFormality() + ","); if (getProfanity() != null) - sb.append("Profanity: " + getProfanity()); + sb.append("Profanity: " + getProfanity() + ","); + if (getBrevity() != null) + sb.append("Brevity: " + getBrevity()); sb.append("}"); return sb.toString(); } @@ -678,6 +941,7 @@ public int hashCode() { hashCode = prime * hashCode + ((getFormality() == null) ? 0 : getFormality().hashCode()); hashCode = prime * hashCode + ((getProfanity() == null) ? 0 : getProfanity().hashCode()); + hashCode = prime * hashCode + ((getBrevity() == null) ? 0 : getBrevity().hashCode()); return hashCode; } @@ -702,6 +966,10 @@ public boolean equals(Object obj) { if (other.getProfanity() != null && other.getProfanity().equals(this.getProfanity()) == false) return false; + if (other.getBrevity() == null ^ this.getBrevity() == null) + return false; + if (other.getBrevity() != null && other.getBrevity().equals(this.getBrevity()) == false) + return false; return true; } } diff --git a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/transform/TranslationSettingsJsonMarshaller.java b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/transform/TranslationSettingsJsonMarshaller.java index ffe5494c855..c8b17c0eb22 100644 --- a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/transform/TranslationSettingsJsonMarshaller.java +++ b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/transform/TranslationSettingsJsonMarshaller.java @@ -37,6 +37,11 @@ public void marshall(TranslationSettings translationSettings, AwsJsonWriter json jsonWriter.name("Profanity"); jsonWriter.value(profanity); } + if (translationSettings.getBrevity() != null) { + String brevity = translationSettings.getBrevity(); + jsonWriter.name("Brevity"); + jsonWriter.value(brevity); + } jsonWriter.endObject(); } diff --git a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/transform/TranslationSettingsJsonUnmarshaller.java b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/transform/TranslationSettingsJsonUnmarshaller.java index 60b1463923e..f7e96145a02 100644 --- a/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/transform/TranslationSettingsJsonUnmarshaller.java +++ b/aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/model/transform/TranslationSettingsJsonUnmarshaller.java @@ -42,6 +42,9 @@ public TranslationSettings unmarshall(JsonUnmarshallerContext context) throws Ex } else if (name.equals("Profanity")) { translationSettings.setProfanity(StringJsonUnmarshaller.getInstance() .unmarshall(context)); + } else if (name.equals("Brevity")) { + translationSettings.setBrevity(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); } else { reader.skipValue(); }