
com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-cloud-translate-v3beta1 Show documentation
Show all versions of proto-google-cloud-translate-v3beta1 Show documentation
PROTO library for proto-google-cloud-translate-v3beta1
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License 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.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/translate/v3beta1/translation_service.proto
// Protobuf Java Version: 3.25.4
package com.google.cloud.translate.v3beta1;
/**
*
*
*
* The BatchTranslateDocument request.
*
*
* Protobuf type {@code google.cloud.translation.v3beta1.BatchTranslateDocumentRequest}
*/
public final class BatchTranslateDocumentRequest extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.translation.v3beta1.BatchTranslateDocumentRequest)
BatchTranslateDocumentRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use BatchTranslateDocumentRequest.newBuilder() to construct.
private BatchTranslateDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private BatchTranslateDocumentRequest() {
parent_ = "";
sourceLanguageCode_ = "";
targetLanguageCodes_ = com.google.protobuf.LazyStringArrayList.emptyList();
inputConfigs_ = java.util.Collections.emptyList();
customizedAttribution_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new BatchTranslateDocumentRequest();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.translate.v3beta1.TranslationServiceProto
.internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 6:
return internalGetModels();
case 7:
return internalGetGlossaries();
case 8:
return internalGetFormatConversions();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.translate.v3beta1.TranslationServiceProto
.internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.class,
com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.Builder.class);
}
private int bitField0_;
public static final int PARENT_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object parent_ = "";
/**
*
*
*
* Required. Location to make a regional call.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
*
* The `global` location is not supported for batch translation.
*
* Only AutoML Translation models or glossaries within the same region (have
* the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
* error is returned.
*
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
*
*
* @return The parent.
*/
@java.lang.Override
public java.lang.String getParent() {
java.lang.Object ref = parent_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
parent_ = s;
return s;
}
}
/**
*
*
*
* Required. Location to make a regional call.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
*
* The `global` location is not supported for batch translation.
*
* Only AutoML Translation models or glossaries within the same region (have
* the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
* error is returned.
*
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
*
*
* @return The bytes for parent.
*/
@java.lang.Override
public com.google.protobuf.ByteString getParentBytes() {
java.lang.Object ref = parent_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
parent_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SOURCE_LANGUAGE_CODE_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object sourceLanguageCode_ = "";
/**
*
*
*
* Required. The BCP-47 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* [Language Support](https://cloud.google.com/translate/docs/languages).
*
*
* string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return The sourceLanguageCode.
*/
@java.lang.Override
public java.lang.String getSourceLanguageCode() {
java.lang.Object ref = sourceLanguageCode_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
sourceLanguageCode_ = s;
return s;
}
}
/**
*
*
*
* Required. The BCP-47 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* [Language Support](https://cloud.google.com/translate/docs/languages).
*
*
* string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for sourceLanguageCode.
*/
@java.lang.Override
public com.google.protobuf.ByteString getSourceLanguageCodeBytes() {
java.lang.Object ref = sourceLanguageCode_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
sourceLanguageCode_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TARGET_LANGUAGE_CODES_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList targetLanguageCodes_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
*
*
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
*
* repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return A list containing the targetLanguageCodes.
*/
public com.google.protobuf.ProtocolStringList getTargetLanguageCodesList() {
return targetLanguageCodes_;
}
/**
*
*
*
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
*
* repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return The count of targetLanguageCodes.
*/
public int getTargetLanguageCodesCount() {
return targetLanguageCodes_.size();
}
/**
*
*
*
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
*
* repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param index The index of the element to return.
* @return The targetLanguageCodes at the given index.
*/
public java.lang.String getTargetLanguageCodes(int index) {
return targetLanguageCodes_.get(index);
}
/**
*
*
*
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
*
* repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param index The index of the value to return.
* @return The bytes of the targetLanguageCodes at the given index.
*/
public com.google.protobuf.ByteString getTargetLanguageCodesBytes(int index) {
return targetLanguageCodes_.getByteString(index);
}
public static final int INPUT_CONFIGS_FIELD_NUMBER = 4;
@SuppressWarnings("serial")
private java.util.List inputConfigs_;
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
@java.lang.Override
public java.util.List
getInputConfigsList() {
return inputConfigs_;
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
@java.lang.Override
public java.util.List<
? extends com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder>
getInputConfigsOrBuilderList() {
return inputConfigs_;
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
@java.lang.Override
public int getInputConfigsCount() {
return inputConfigs_.size();
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
@java.lang.Override
public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig getInputConfigs(int index) {
return inputConfigs_.get(index);
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
@java.lang.Override
public com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder
getInputConfigsOrBuilder(int index) {
return inputConfigs_.get(index);
}
public static final int OUTPUT_CONFIG_FIELD_NUMBER = 5;
private com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig outputConfig_;
/**
*
*
*
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*
*
*
* .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return Whether the outputConfig field is set.
*/
@java.lang.Override
public boolean hasOutputConfig() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*
*
*
* .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return The outputConfig.
*/
@java.lang.Override
public com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig getOutputConfig() {
return outputConfig_ == null
? com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.getDefaultInstance()
: outputConfig_;
}
/**
*
*
*
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*
*
*
* .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];
*
*/
@java.lang.Override
public com.google.cloud.translate.v3beta1.BatchDocumentOutputConfigOrBuilder
getOutputConfigOrBuilder() {
return outputConfig_ == null
? com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.getDefaultInstance()
: outputConfig_;
}
public static final int MODELS_FIELD_NUMBER = 6;
private static final class ModelsDefaultEntryHolder {
static final com.google.protobuf.MapEntry defaultEntry =
com.google.protobuf.MapEntry.newDefaultInstance(
com.google.cloud.translate.v3beta1.TranslationServiceProto
.internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_ModelsEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.STRING,
"");
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField models_;
private com.google.protobuf.MapField internalGetModels() {
if (models_ == null) {
return com.google.protobuf.MapField.emptyMapField(ModelsDefaultEntryHolder.defaultEntry);
}
return models_;
}
public int getModelsCount() {
return internalGetModels().getMap().size();
}
/**
*
*
*
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is not requested for a language
* pair, then default google model (nmt) is used.
*
*
* map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
@java.lang.Override
public boolean containsModels(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetModels().getMap().containsKey(key);
}
/** Use {@link #getModelsMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getModels() {
return getModelsMap();
}
/**
*
*
*
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is not requested for a language
* pair, then default google model (nmt) is used.
*
*
* map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
@java.lang.Override
public java.util.Map getModelsMap() {
return internalGetModels().getMap();
}
/**
*
*
*
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is not requested for a language
* pair, then default google model (nmt) is used.
*
*
* map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
@java.lang.Override
public /* nullable */ java.lang.String getModelsOrDefault(
java.lang.String key,
/* nullable */
java.lang.String defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetModels().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
*
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is not requested for a language
* pair, then default google model (nmt) is used.
*
*
* map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
@java.lang.Override
public java.lang.String getModelsOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetModels().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public static final int GLOSSARIES_FIELD_NUMBER = 7;
private static final class GlossariesDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
defaultEntry =
com.google.protobuf.MapEntry
.
newDefaultInstance(
com.google.cloud.translate.v3beta1.TranslationServiceProto
.internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_GlossariesEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.MESSAGE,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig
.getDefaultInstance());
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField<
java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
glossaries_;
private com.google.protobuf.MapField<
java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
internalGetGlossaries() {
if (glossaries_ == null) {
return com.google.protobuf.MapField.emptyMapField(GlossariesDefaultEntryHolder.defaultEntry);
}
return glossaries_;
}
public int getGlossariesCount() {
return internalGetGlossaries().getMap().size();
}
/**
*
*
*
* Optional. Glossaries to be applied. It's keyed by target language code.
*
*
*
* map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public boolean containsGlossaries(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetGlossaries().getMap().containsKey(key);
}
/** Use {@link #getGlossariesMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map<
java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
getGlossaries() {
return getGlossariesMap();
}
/**
*
*
*
* Optional. Glossaries to be applied. It's keyed by target language code.
*
*
*
* map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public java.util.Map<
java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
getGlossariesMap() {
return internalGetGlossaries().getMap();
}
/**
*
*
*
* Optional. Glossaries to be applied. It's keyed by target language code.
*
*
*
* map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public /* nullable */ com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig
getGlossariesOrDefault(
java.lang.String key,
/* nullable */
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map
map = internalGetGlossaries().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
*
* Optional. Glossaries to be applied. It's keyed by target language code.
*
*
*
* map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossariesOrThrow(
java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map
map = internalGetGlossaries().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public static final int FORMAT_CONVERSIONS_FIELD_NUMBER = 8;
private static final class FormatConversionsDefaultEntryHolder {
static final com.google.protobuf.MapEntry defaultEntry =
com.google.protobuf.MapEntry.newDefaultInstance(
com.google.cloud.translate.v3beta1.TranslationServiceProto
.internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_FormatConversionsEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.STRING,
"");
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField formatConversions_;
private com.google.protobuf.MapField
internalGetFormatConversions() {
if (formatConversions_ == null) {
return com.google.protobuf.MapField.emptyMapField(
FormatConversionsDefaultEntryHolder.defaultEntry);
}
return formatConversions_;
}
public int getFormatConversionsCount() {
return internalGetFormatConversions().getMap().size();
}
/**
*
*
*
* Optional. File format conversion map to be applied to all input files.
* Map's key is the original mime_type. Map's value is the target mime_type of
* translated documents.
*
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
*
* If nothing specified, output files will be in the same format as the
* original file.
*
*
*
* map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public boolean containsFormatConversions(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetFormatConversions().getMap().containsKey(key);
}
/** Use {@link #getFormatConversionsMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getFormatConversions() {
return getFormatConversionsMap();
}
/**
*
*
*
* Optional. File format conversion map to be applied to all input files.
* Map's key is the original mime_type. Map's value is the target mime_type of
* translated documents.
*
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
*
* If nothing specified, output files will be in the same format as the
* original file.
*
*
*
* map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public java.util.Map getFormatConversionsMap() {
return internalGetFormatConversions().getMap();
}
/**
*
*
*
* Optional. File format conversion map to be applied to all input files.
* Map's key is the original mime_type. Map's value is the target mime_type of
* translated documents.
*
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
*
* If nothing specified, output files will be in the same format as the
* original file.
*
*
*
* map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public /* nullable */ java.lang.String getFormatConversionsOrDefault(
java.lang.String key,
/* nullable */
java.lang.String defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetFormatConversions().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
*
* Optional. File format conversion map to be applied to all input files.
* Map's key is the original mime_type. Map's value is the target mime_type of
* translated documents.
*
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
*
* If nothing specified, output files will be in the same format as the
* original file.
*
*
*
* map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public java.lang.String getFormatConversionsOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetFormatConversions().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public static final int CUSTOMIZED_ATTRIBUTION_FIELD_NUMBER = 10;
@SuppressWarnings("serial")
private volatile java.lang.Object customizedAttribution_ = "";
/**
*
*
*
* Optional. This flag is to support user customized attribution.
* If not provided, the default is `Machine Translated by Google`.
* Customized attribution should follow rules in
* https://cloud.google.com/translate/attribution#attribution_and_logos
*
*
* string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The customizedAttribution.
*/
@java.lang.Override
public java.lang.String getCustomizedAttribution() {
java.lang.Object ref = customizedAttribution_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
customizedAttribution_ = s;
return s;
}
}
/**
*
*
*
* Optional. This flag is to support user customized attribution.
* If not provided, the default is `Machine Translated by Google`.
* Customized attribution should follow rules in
* https://cloud.google.com/translate/attribution#attribution_and_logos
*
*
* string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The bytes for customizedAttribution.
*/
@java.lang.Override
public com.google.protobuf.ByteString getCustomizedAttributionBytes() {
java.lang.Object ref = customizedAttribution_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
customizedAttribution_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ENABLE_SHADOW_REMOVAL_NATIVE_PDF_FIELD_NUMBER = 11;
private boolean enableShadowRemovalNativePdf_ = false;
/**
*
*
*
* Optional. If true, use the text removal server to remove the shadow text on
* background image for native pdf translation.
* Shadow removal feature can only be enabled when
* is_translate_native_pdf_only: false && pdf_native_only: false
*
*
* bool enable_shadow_removal_native_pdf = 11 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return The enableShadowRemovalNativePdf.
*/
@java.lang.Override
public boolean getEnableShadowRemovalNativePdf() {
return enableShadowRemovalNativePdf_;
}
public static final int ENABLE_ROTATION_CORRECTION_FIELD_NUMBER = 12;
private boolean enableRotationCorrection_ = false;
/**
*
*
*
* Optional. If true, enable auto rotation correction in DVS.
*
*
* bool enable_rotation_correction = 12 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The enableRotationCorrection.
*/
@java.lang.Override
public boolean getEnableRotationCorrection() {
return enableRotationCorrection_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceLanguageCode_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, sourceLanguageCode_);
}
for (int i = 0; i < targetLanguageCodes_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, targetLanguageCodes_.getRaw(i));
}
for (int i = 0; i < inputConfigs_.size(); i++) {
output.writeMessage(4, inputConfigs_.get(i));
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(5, getOutputConfig());
}
com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
output, internalGetModels(), ModelsDefaultEntryHolder.defaultEntry, 6);
com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
output, internalGetGlossaries(), GlossariesDefaultEntryHolder.defaultEntry, 7);
com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
output,
internalGetFormatConversions(),
FormatConversionsDefaultEntryHolder.defaultEntry,
8);
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customizedAttribution_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 10, customizedAttribution_);
}
if (enableShadowRemovalNativePdf_ != false) {
output.writeBool(11, enableShadowRemovalNativePdf_);
}
if (enableRotationCorrection_ != false) {
output.writeBool(12, enableRotationCorrection_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceLanguageCode_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, sourceLanguageCode_);
}
{
int dataSize = 0;
for (int i = 0; i < targetLanguageCodes_.size(); i++) {
dataSize += computeStringSizeNoTag(targetLanguageCodes_.getRaw(i));
}
size += dataSize;
size += 1 * getTargetLanguageCodesList().size();
}
for (int i = 0; i < inputConfigs_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, inputConfigs_.get(i));
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getOutputConfig());
}
for (java.util.Map.Entry entry :
internalGetModels().getMap().entrySet()) {
com.google.protobuf.MapEntry models__ =
ModelsDefaultEntryHolder.defaultEntry
.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, models__);
}
for (java.util.Map.Entry<
java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
entry : internalGetGlossaries().getMap().entrySet()) {
com.google.protobuf.MapEntry<
java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
glossaries__ =
GlossariesDefaultEntryHolder.defaultEntry
.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, glossaries__);
}
for (java.util.Map.Entry entry :
internalGetFormatConversions().getMap().entrySet()) {
com.google.protobuf.MapEntry formatConversions__ =
FormatConversionsDefaultEntryHolder.defaultEntry
.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, formatConversions__);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customizedAttribution_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, customizedAttribution_);
}
if (enableShadowRemovalNativePdf_ != false) {
size +=
com.google.protobuf.CodedOutputStream.computeBoolSize(11, enableShadowRemovalNativePdf_);
}
if (enableRotationCorrection_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, enableRotationCorrection_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest)) {
return super.equals(obj);
}
com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest other =
(com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest) obj;
if (!getParent().equals(other.getParent())) return false;
if (!getSourceLanguageCode().equals(other.getSourceLanguageCode())) return false;
if (!getTargetLanguageCodesList().equals(other.getTargetLanguageCodesList())) return false;
if (!getInputConfigsList().equals(other.getInputConfigsList())) return false;
if (hasOutputConfig() != other.hasOutputConfig()) return false;
if (hasOutputConfig()) {
if (!getOutputConfig().equals(other.getOutputConfig())) return false;
}
if (!internalGetModels().equals(other.internalGetModels())) return false;
if (!internalGetGlossaries().equals(other.internalGetGlossaries())) return false;
if (!internalGetFormatConversions().equals(other.internalGetFormatConversions())) return false;
if (!getCustomizedAttribution().equals(other.getCustomizedAttribution())) return false;
if (getEnableShadowRemovalNativePdf() != other.getEnableShadowRemovalNativePdf()) return false;
if (getEnableRotationCorrection() != other.getEnableRotationCorrection()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + PARENT_FIELD_NUMBER;
hash = (53 * hash) + getParent().hashCode();
hash = (37 * hash) + SOURCE_LANGUAGE_CODE_FIELD_NUMBER;
hash = (53 * hash) + getSourceLanguageCode().hashCode();
if (getTargetLanguageCodesCount() > 0) {
hash = (37 * hash) + TARGET_LANGUAGE_CODES_FIELD_NUMBER;
hash = (53 * hash) + getTargetLanguageCodesList().hashCode();
}
if (getInputConfigsCount() > 0) {
hash = (37 * hash) + INPUT_CONFIGS_FIELD_NUMBER;
hash = (53 * hash) + getInputConfigsList().hashCode();
}
if (hasOutputConfig()) {
hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER;
hash = (53 * hash) + getOutputConfig().hashCode();
}
if (!internalGetModels().getMap().isEmpty()) {
hash = (37 * hash) + MODELS_FIELD_NUMBER;
hash = (53 * hash) + internalGetModels().hashCode();
}
if (!internalGetGlossaries().getMap().isEmpty()) {
hash = (37 * hash) + GLOSSARIES_FIELD_NUMBER;
hash = (53 * hash) + internalGetGlossaries().hashCode();
}
if (!internalGetFormatConversions().getMap().isEmpty()) {
hash = (37 * hash) + FORMAT_CONVERSIONS_FIELD_NUMBER;
hash = (53 * hash) + internalGetFormatConversions().hashCode();
}
hash = (37 * hash) + CUSTOMIZED_ATTRIBUTION_FIELD_NUMBER;
hash = (53 * hash) + getCustomizedAttribution().hashCode();
hash = (37 * hash) + ENABLE_SHADOW_REMOVAL_NATIVE_PDF_FIELD_NUMBER;
hash =
(53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableShadowRemovalNativePdf());
hash = (37 * hash) + ENABLE_ROTATION_CORRECTION_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableRotationCorrection());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom(
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(
com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* The BatchTranslateDocument request.
*
*
* Protobuf type {@code google.cloud.translation.v3beta1.BatchTranslateDocumentRequest}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.translation.v3beta1.BatchTranslateDocumentRequest)
com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.translate.v3beta1.TranslationServiceProto
.internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 6:
return internalGetModels();
case 7:
return internalGetGlossaries();
case 8:
return internalGetFormatConversions();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
int number) {
switch (number) {
case 6:
return internalGetMutableModels();
case 7:
return internalGetMutableGlossaries();
case 8:
return internalGetMutableFormatConversions();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.translate.v3beta1.TranslationServiceProto
.internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.class,
com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.Builder.class);
}
// Construct using com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getInputConfigsFieldBuilder();
getOutputConfigFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
parent_ = "";
sourceLanguageCode_ = "";
targetLanguageCodes_ = com.google.protobuf.LazyStringArrayList.emptyList();
if (inputConfigsBuilder_ == null) {
inputConfigs_ = java.util.Collections.emptyList();
} else {
inputConfigs_ = null;
inputConfigsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000008);
outputConfig_ = null;
if (outputConfigBuilder_ != null) {
outputConfigBuilder_.dispose();
outputConfigBuilder_ = null;
}
internalGetMutableModels().clear();
internalGetMutableGlossaries().clear();
internalGetMutableFormatConversions().clear();
customizedAttribution_ = "";
enableShadowRemovalNativePdf_ = false;
enableRotationCorrection_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.translate.v3beta1.TranslationServiceProto
.internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_descriptor;
}
@java.lang.Override
public com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest
getDefaultInstanceForType() {
return com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest build() {
com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest buildPartial() {
com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest result =
new com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(
com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest result) {
if (inputConfigsBuilder_ == null) {
if (((bitField0_ & 0x00000008) != 0)) {
inputConfigs_ = java.util.Collections.unmodifiableList(inputConfigs_);
bitField0_ = (bitField0_ & ~0x00000008);
}
result.inputConfigs_ = inputConfigs_;
} else {
result.inputConfigs_ = inputConfigsBuilder_.build();
}
}
private void buildPartial0(
com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.parent_ = parent_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.sourceLanguageCode_ = sourceLanguageCode_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
targetLanguageCodes_.makeImmutable();
result.targetLanguageCodes_ = targetLanguageCodes_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000010) != 0)) {
result.outputConfig_ =
outputConfigBuilder_ == null ? outputConfig_ : outputConfigBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.models_ = internalGetModels();
result.models_.makeImmutable();
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.glossaries_ =
internalGetGlossaries().build(GlossariesDefaultEntryHolder.defaultEntry);
}
if (((from_bitField0_ & 0x00000080) != 0)) {
result.formatConversions_ = internalGetFormatConversions();
result.formatConversions_.makeImmutable();
}
if (((from_bitField0_ & 0x00000100) != 0)) {
result.customizedAttribution_ = customizedAttribution_;
}
if (((from_bitField0_ & 0x00000200) != 0)) {
result.enableShadowRemovalNativePdf_ = enableShadowRemovalNativePdf_;
}
if (((from_bitField0_ & 0x00000400) != 0)) {
result.enableRotationCorrection_ = enableRotationCorrection_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest) {
return mergeFrom((com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest other) {
if (other
== com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.getDefaultInstance())
return this;
if (!other.getParent().isEmpty()) {
parent_ = other.parent_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getSourceLanguageCode().isEmpty()) {
sourceLanguageCode_ = other.sourceLanguageCode_;
bitField0_ |= 0x00000002;
onChanged();
}
if (!other.targetLanguageCodes_.isEmpty()) {
if (targetLanguageCodes_.isEmpty()) {
targetLanguageCodes_ = other.targetLanguageCodes_;
bitField0_ |= 0x00000004;
} else {
ensureTargetLanguageCodesIsMutable();
targetLanguageCodes_.addAll(other.targetLanguageCodes_);
}
onChanged();
}
if (inputConfigsBuilder_ == null) {
if (!other.inputConfigs_.isEmpty()) {
if (inputConfigs_.isEmpty()) {
inputConfigs_ = other.inputConfigs_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureInputConfigsIsMutable();
inputConfigs_.addAll(other.inputConfigs_);
}
onChanged();
}
} else {
if (!other.inputConfigs_.isEmpty()) {
if (inputConfigsBuilder_.isEmpty()) {
inputConfigsBuilder_.dispose();
inputConfigsBuilder_ = null;
inputConfigs_ = other.inputConfigs_;
bitField0_ = (bitField0_ & ~0x00000008);
inputConfigsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getInputConfigsFieldBuilder()
: null;
} else {
inputConfigsBuilder_.addAllMessages(other.inputConfigs_);
}
}
}
if (other.hasOutputConfig()) {
mergeOutputConfig(other.getOutputConfig());
}
internalGetMutableModels().mergeFrom(other.internalGetModels());
bitField0_ |= 0x00000020;
internalGetMutableGlossaries().mergeFrom(other.internalGetGlossaries());
bitField0_ |= 0x00000040;
internalGetMutableFormatConversions().mergeFrom(other.internalGetFormatConversions());
bitField0_ |= 0x00000080;
if (!other.getCustomizedAttribution().isEmpty()) {
customizedAttribution_ = other.customizedAttribution_;
bitField0_ |= 0x00000100;
onChanged();
}
if (other.getEnableShadowRemovalNativePdf() != false) {
setEnableShadowRemovalNativePdf(other.getEnableShadowRemovalNativePdf());
}
if (other.getEnableRotationCorrection() != false) {
setEnableRotationCorrection(other.getEnableRotationCorrection());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
parent_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
sourceLanguageCode_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 26:
{
java.lang.String s = input.readStringRequireUtf8();
ensureTargetLanguageCodesIsMutable();
targetLanguageCodes_.add(s);
break;
} // case 26
case 34:
{
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig m =
input.readMessage(
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.parser(),
extensionRegistry);
if (inputConfigsBuilder_ == null) {
ensureInputConfigsIsMutable();
inputConfigs_.add(m);
} else {
inputConfigsBuilder_.addMessage(m);
}
break;
} // case 34
case 42:
{
input.readMessage(getOutputConfigFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000010;
break;
} // case 42
case 50:
{
com.google.protobuf.MapEntry models__ =
input.readMessage(
ModelsDefaultEntryHolder.defaultEntry.getParserForType(),
extensionRegistry);
internalGetMutableModels()
.getMutableMap()
.put(models__.getKey(), models__.getValue());
bitField0_ |= 0x00000020;
break;
} // case 50
case 58:
{
com.google.protobuf.MapEntry<
java.lang.String,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
glossaries__ =
input.readMessage(
GlossariesDefaultEntryHolder.defaultEntry.getParserForType(),
extensionRegistry);
internalGetMutableGlossaries()
.ensureBuilderMap()
.put(glossaries__.getKey(), glossaries__.getValue());
bitField0_ |= 0x00000040;
break;
} // case 58
case 66:
{
com.google.protobuf.MapEntry
formatConversions__ =
input.readMessage(
FormatConversionsDefaultEntryHolder.defaultEntry.getParserForType(),
extensionRegistry);
internalGetMutableFormatConversions()
.getMutableMap()
.put(formatConversions__.getKey(), formatConversions__.getValue());
bitField0_ |= 0x00000080;
break;
} // case 66
case 82:
{
customizedAttribution_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000100;
break;
} // case 82
case 88:
{
enableShadowRemovalNativePdf_ = input.readBool();
bitField0_ |= 0x00000200;
break;
} // case 88
case 96:
{
enableRotationCorrection_ = input.readBool();
bitField0_ |= 0x00000400;
break;
} // case 96
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object parent_ = "";
/**
*
*
*
* Required. Location to make a regional call.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
*
* The `global` location is not supported for batch translation.
*
* Only AutoML Translation models or glossaries within the same region (have
* the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
* error is returned.
*
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
*
*
* @return The parent.
*/
public java.lang.String getParent() {
java.lang.Object ref = parent_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
parent_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Required. Location to make a regional call.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
*
* The `global` location is not supported for batch translation.
*
* Only AutoML Translation models or glossaries within the same region (have
* the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
* error is returned.
*
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
*
*
* @return The bytes for parent.
*/
public com.google.protobuf.ByteString getParentBytes() {
java.lang.Object ref = parent_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
parent_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. Location to make a regional call.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
*
* The `global` location is not supported for batch translation.
*
* Only AutoML Translation models or glossaries within the same region (have
* the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
* error is returned.
*
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
*
*
* @param value The parent to set.
* @return This builder for chaining.
*/
public Builder setParent(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
parent_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* Required. Location to make a regional call.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
*
* The `global` location is not supported for batch translation.
*
* Only AutoML Translation models or glossaries within the same region (have
* the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
* error is returned.
*
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
*
*
* @return This builder for chaining.
*/
public Builder clearParent() {
parent_ = getDefaultInstance().getParent();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* Required. Location to make a regional call.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
*
* The `global` location is not supported for batch translation.
*
* Only AutoML Translation models or glossaries within the same region (have
* the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
* error is returned.
*
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
*
*
* @param value The bytes for parent to set.
* @return This builder for chaining.
*/
public Builder setParentBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
parent_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object sourceLanguageCode_ = "";
/**
*
*
*
* Required. The BCP-47 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* [Language Support](https://cloud.google.com/translate/docs/languages).
*
*
* string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return The sourceLanguageCode.
*/
public java.lang.String getSourceLanguageCode() {
java.lang.Object ref = sourceLanguageCode_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
sourceLanguageCode_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Required. The BCP-47 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* [Language Support](https://cloud.google.com/translate/docs/languages).
*
*
* string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for sourceLanguageCode.
*/
public com.google.protobuf.ByteString getSourceLanguageCodeBytes() {
java.lang.Object ref = sourceLanguageCode_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
sourceLanguageCode_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. The BCP-47 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* [Language Support](https://cloud.google.com/translate/docs/languages).
*
*
* string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The sourceLanguageCode to set.
* @return This builder for chaining.
*/
public Builder setSourceLanguageCode(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
sourceLanguageCode_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* Required. The BCP-47 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* [Language Support](https://cloud.google.com/translate/docs/languages).
*
*
* string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return This builder for chaining.
*/
public Builder clearSourceLanguageCode() {
sourceLanguageCode_ = getDefaultInstance().getSourceLanguageCode();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
*
*
* Required. The BCP-47 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* [Language Support](https://cloud.google.com/translate/docs/languages).
*
*
* string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The bytes for sourceLanguageCode to set.
* @return This builder for chaining.
*/
public Builder setSourceLanguageCodeBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
sourceLanguageCode_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private com.google.protobuf.LazyStringArrayList targetLanguageCodes_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureTargetLanguageCodesIsMutable() {
if (!targetLanguageCodes_.isModifiable()) {
targetLanguageCodes_ = new com.google.protobuf.LazyStringArrayList(targetLanguageCodes_);
}
bitField0_ |= 0x00000004;
}
/**
*
*
*
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
*
* repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return A list containing the targetLanguageCodes.
*/
public com.google.protobuf.ProtocolStringList getTargetLanguageCodesList() {
targetLanguageCodes_.makeImmutable();
return targetLanguageCodes_;
}
/**
*
*
*
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
*
* repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return The count of targetLanguageCodes.
*/
public int getTargetLanguageCodesCount() {
return targetLanguageCodes_.size();
}
/**
*
*
*
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
*
* repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param index The index of the element to return.
* @return The targetLanguageCodes at the given index.
*/
public java.lang.String getTargetLanguageCodes(int index) {
return targetLanguageCodes_.get(index);
}
/**
*
*
*
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
*
* repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param index The index of the value to return.
* @return The bytes of the targetLanguageCodes at the given index.
*/
public com.google.protobuf.ByteString getTargetLanguageCodesBytes(int index) {
return targetLanguageCodes_.getByteString(index);
}
/**
*
*
*
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
*
* repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param index The index to set the value at.
* @param value The targetLanguageCodes to set.
* @return This builder for chaining.
*/
public Builder setTargetLanguageCodes(int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureTargetLanguageCodesIsMutable();
targetLanguageCodes_.set(index, value);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
*
* repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param value The targetLanguageCodes to add.
* @return This builder for chaining.
*/
public Builder addTargetLanguageCodes(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureTargetLanguageCodesIsMutable();
targetLanguageCodes_.add(value);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
*
* repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param values The targetLanguageCodes to add.
* @return This builder for chaining.
*/
public Builder addAllTargetLanguageCodes(java.lang.Iterable values) {
ensureTargetLanguageCodesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, targetLanguageCodes_);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
*
* repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return This builder for chaining.
*/
public Builder clearTargetLanguageCodes() {
targetLanguageCodes_ = com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
;
onChanged();
return this;
}
/**
*
*
*
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
*
* repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];
*
*
* @param value The bytes of the targetLanguageCodes to add.
* @return This builder for chaining.
*/
public Builder addTargetLanguageCodesBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureTargetLanguageCodesIsMutable();
targetLanguageCodes_.add(value);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
private java.util.List
inputConfigs_ = java.util.Collections.emptyList();
private void ensureInputConfigsIsMutable() {
if (!((bitField0_ & 0x00000008) != 0)) {
inputConfigs_ =
new java.util.ArrayList(
inputConfigs_);
bitField0_ |= 0x00000008;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig,
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder,
com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder>
inputConfigsBuilder_;
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public java.util.List
getInputConfigsList() {
if (inputConfigsBuilder_ == null) {
return java.util.Collections.unmodifiableList(inputConfigs_);
} else {
return inputConfigsBuilder_.getMessageList();
}
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public int getInputConfigsCount() {
if (inputConfigsBuilder_ == null) {
return inputConfigs_.size();
} else {
return inputConfigsBuilder_.getCount();
}
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig getInputConfigs(int index) {
if (inputConfigsBuilder_ == null) {
return inputConfigs_.get(index);
} else {
return inputConfigsBuilder_.getMessage(index);
}
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder setInputConfigs(
int index, com.google.cloud.translate.v3beta1.BatchDocumentInputConfig value) {
if (inputConfigsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureInputConfigsIsMutable();
inputConfigs_.set(index, value);
onChanged();
} else {
inputConfigsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder setInputConfigs(
int index,
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder builderForValue) {
if (inputConfigsBuilder_ == null) {
ensureInputConfigsIsMutable();
inputConfigs_.set(index, builderForValue.build());
onChanged();
} else {
inputConfigsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder addInputConfigs(
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig value) {
if (inputConfigsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureInputConfigsIsMutable();
inputConfigs_.add(value);
onChanged();
} else {
inputConfigsBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder addInputConfigs(
int index, com.google.cloud.translate.v3beta1.BatchDocumentInputConfig value) {
if (inputConfigsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureInputConfigsIsMutable();
inputConfigs_.add(index, value);
onChanged();
} else {
inputConfigsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder addInputConfigs(
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder builderForValue) {
if (inputConfigsBuilder_ == null) {
ensureInputConfigsIsMutable();
inputConfigs_.add(builderForValue.build());
onChanged();
} else {
inputConfigsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder addInputConfigs(
int index,
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder builderForValue) {
if (inputConfigsBuilder_ == null) {
ensureInputConfigsIsMutable();
inputConfigs_.add(index, builderForValue.build());
onChanged();
} else {
inputConfigsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder addAllInputConfigs(
java.lang.Iterable extends com.google.cloud.translate.v3beta1.BatchDocumentInputConfig>
values) {
if (inputConfigsBuilder_ == null) {
ensureInputConfigsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, inputConfigs_);
onChanged();
} else {
inputConfigsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder clearInputConfigs() {
if (inputConfigsBuilder_ == null) {
inputConfigs_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
} else {
inputConfigsBuilder_.clear();
}
return this;
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder removeInputConfigs(int index) {
if (inputConfigsBuilder_ == null) {
ensureInputConfigsIsMutable();
inputConfigs_.remove(index);
onChanged();
} else {
inputConfigsBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder
getInputConfigsBuilder(int index) {
return getInputConfigsFieldBuilder().getBuilder(index);
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder
getInputConfigsOrBuilder(int index) {
if (inputConfigsBuilder_ == null) {
return inputConfigs_.get(index);
} else {
return inputConfigsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public java.util.List<
? extends com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder>
getInputConfigsOrBuilderList() {
if (inputConfigsBuilder_ != null) {
return inputConfigsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(inputConfigs_);
}
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder
addInputConfigsBuilder() {
return getInputConfigsFieldBuilder()
.addBuilder(
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.getDefaultInstance());
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder
addInputConfigsBuilder(int index) {
return getInputConfigsFieldBuilder()
.addBuilder(
index,
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.getDefaultInstance());
}
/**
*
*
*
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*
*
*
* repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];
*
*/
public java.util.List
getInputConfigsBuilderList() {
return getInputConfigsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig,
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder,
com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder>
getInputConfigsFieldBuilder() {
if (inputConfigsBuilder_ == null) {
inputConfigsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig,
com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder,
com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder>(
inputConfigs_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean());
inputConfigs_ = null;
}
return inputConfigsBuilder_;
}
private com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig outputConfig_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig,
com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.Builder,
com.google.cloud.translate.v3beta1.BatchDocumentOutputConfigOrBuilder>
outputConfigBuilder_;
/**
*
*
*
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*
*
*
* .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return Whether the outputConfig field is set.
*/
public boolean hasOutputConfig() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
*
*
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*
*
*
* .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return The outputConfig.
*/
public com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig getOutputConfig() {
if (outputConfigBuilder_ == null) {
return outputConfig_ == null
? com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.getDefaultInstance()
: outputConfig_;
} else {
return outputConfigBuilder_.getMessage();
}
}
/**
*
*
*
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*
*
*
* .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder setOutputConfig(
com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig value) {
if (outputConfigBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
outputConfig_ = value;
} else {
outputConfigBuilder_.setMessage(value);
}
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*
*
*
* .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder setOutputConfig(
com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.Builder builderForValue) {
if (outputConfigBuilder_ == null) {
outputConfig_ = builderForValue.build();
} else {
outputConfigBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*
*
*
* .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder mergeOutputConfig(
com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig value) {
if (outputConfigBuilder_ == null) {
if (((bitField0_ & 0x00000010) != 0)
&& outputConfig_ != null
&& outputConfig_
!= com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig
.getDefaultInstance()) {
getOutputConfigBuilder().mergeFrom(value);
} else {
outputConfig_ = value;
}
} else {
outputConfigBuilder_.mergeFrom(value);
}
if (outputConfig_ != null) {
bitField0_ |= 0x00000010;
onChanged();
}
return this;
}
/**
*
*
*
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*
*
*
* .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder clearOutputConfig() {
bitField0_ = (bitField0_ & ~0x00000010);
outputConfig_ = null;
if (outputConfigBuilder_ != null) {
outputConfigBuilder_.dispose();
outputConfigBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*
*
*
* .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.Builder
getOutputConfigBuilder() {
bitField0_ |= 0x00000010;
onChanged();
return getOutputConfigFieldBuilder().getBuilder();
}
/**
*
*
*
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*
*
*
* .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.cloud.translate.v3beta1.BatchDocumentOutputConfigOrBuilder
getOutputConfigOrBuilder() {
if (outputConfigBuilder_ != null) {
return outputConfigBuilder_.getMessageOrBuilder();
} else {
return outputConfig_ == null
? com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.getDefaultInstance()
: outputConfig_;
}
}
/**
*
*
*
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*
*
*
* .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];
*
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig,
com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.Builder,
com.google.cloud.translate.v3beta1.BatchDocumentOutputConfigOrBuilder>
getOutputConfigFieldBuilder() {
if (outputConfigBuilder_ == null) {
outputConfigBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig,
com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.Builder,
com.google.cloud.translate.v3beta1.BatchDocumentOutputConfigOrBuilder>(
getOutputConfig(), getParentForChildren(), isClean());
outputConfig_ = null;
}
return outputConfigBuilder_;
}
private com.google.protobuf.MapField models_;
private com.google.protobuf.MapField internalGetModels() {
if (models_ == null) {
return com.google.protobuf.MapField.emptyMapField(ModelsDefaultEntryHolder.defaultEntry);
}
return models_;
}
private com.google.protobuf.MapField
internalGetMutableModels() {
if (models_ == null) {
models_ = com.google.protobuf.MapField.newMapField(ModelsDefaultEntryHolder.defaultEntry);
}
if (!models_.isMutable()) {
models_ = models_.copy();
}
bitField0_ |= 0x00000020;
onChanged();
return models_;
}
public int getModelsCount() {
return internalGetModels().getMap().size();
}
/**
*
*
*
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is not requested for a language
* pair, then default google model (nmt) is used.
*
*
* map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
@java.lang.Override
public boolean containsModels(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetModels().getMap().containsKey(key);
}
/** Use {@link #getModelsMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getModels() {
return getModelsMap();
}
/**
*
*
*
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is not requested for a language
* pair, then default google model (nmt) is used.
*
*
* map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
@java.lang.Override
public java.util.Map getModelsMap() {
return internalGetModels().getMap();
}
/**
*
*
*
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is not requested for a language
* pair, then default google model (nmt) is used.
*
*
* map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
@java.lang.Override
public /* nullable */ java.lang.String getModelsOrDefault(
java.lang.String key,
/* nullable */
java.lang.String defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetModels().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
*
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is not requested for a language
* pair, then default google model (nmt) is used.
*
*
* map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
@java.lang.Override
public java.lang.String getModelsOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetModels().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public Builder clearModels() {
bitField0_ = (bitField0_ & ~0x00000020);
internalGetMutableModels().getMutableMap().clear();
return this;
}
/**
*
*
*
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is not requested for a language
* pair, then default google model (nmt) is used.
*
*
* map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
public Builder removeModels(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
internalGetMutableModels().getMutableMap().remove(key);
return this;
}
/** Use alternate mutation accessors instead. */
@java.lang.Deprecated
public java.util.Map getMutableModels() {
bitField0_ |= 0x00000020;
return internalGetMutableModels().getMutableMap();
}
/**
*
*
*
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is not requested for a language
* pair, then default google model (nmt) is used.
*
*
* map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
public Builder putModels(java.lang.String key, java.lang.String value) {
if (key == null) {
throw new NullPointerException("map key");
}
if (value == null) {
throw new NullPointerException("map value");
}
internalGetMutableModels().getMutableMap().put(key, value);
bitField0_ |= 0x00000020;
return this;
}
/**
*
*
*
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is not requested for a language
* pair, then default google model (nmt) is used.
*
*
* map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
public Builder putAllModels(java.util.Map values) {
internalGetMutableModels().getMutableMap().putAll(values);
bitField0_ |= 0x00000020;
return this;
}
private static final class GlossariesConverter
implements com.google.protobuf.MapFieldBuilder.Converter<
java.lang.String,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig> {
@java.lang.Override
public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig build(
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder val) {
if (val instanceof com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig) {
return (com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig) val;
}
return ((com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder) val)
.build();
}
@java.lang.Override
public com.google.protobuf.MapEntry<
java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
defaultEntry() {
return GlossariesDefaultEntryHolder.defaultEntry;
}
};
private static final GlossariesConverter glossariesConverter = new GlossariesConverter();
private com.google.protobuf.MapFieldBuilder<
java.lang.String,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder>
glossaries_;
private com.google.protobuf.MapFieldBuilder<
java.lang.String,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder>
internalGetGlossaries() {
if (glossaries_ == null) {
return new com.google.protobuf.MapFieldBuilder<>(glossariesConverter);
}
return glossaries_;
}
private com.google.protobuf.MapFieldBuilder<
java.lang.String,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder>
internalGetMutableGlossaries() {
if (glossaries_ == null) {
glossaries_ = new com.google.protobuf.MapFieldBuilder<>(glossariesConverter);
}
bitField0_ |= 0x00000040;
onChanged();
return glossaries_;
}
public int getGlossariesCount() {
return internalGetGlossaries().ensureBuilderMap().size();
}
/**
*
*
*
* Optional. Glossaries to be applied. It's keyed by target language code.
*
*
*
* map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public boolean containsGlossaries(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetGlossaries().ensureBuilderMap().containsKey(key);
}
/** Use {@link #getGlossariesMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map<
java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
getGlossaries() {
return getGlossariesMap();
}
/**
*
*
*
* Optional. Glossaries to be applied. It's keyed by target language code.
*
*
*
* map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public java.util.Map<
java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
getGlossariesMap() {
return internalGetGlossaries().getImmutableMap();
}
/**
*
*
*
* Optional. Glossaries to be applied. It's keyed by target language code.
*
*
*
* map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public /* nullable */ com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig
getGlossariesOrDefault(
java.lang.String key,
/* nullable */
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map<
java.lang.String,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder>
map = internalGetMutableGlossaries().ensureBuilderMap();
return map.containsKey(key) ? glossariesConverter.build(map.get(key)) : defaultValue;
}
/**
*
*
*
* Optional. Glossaries to be applied. It's keyed by target language code.
*
*
*
* map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossariesOrThrow(
java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map<
java.lang.String,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder>
map = internalGetMutableGlossaries().ensureBuilderMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return glossariesConverter.build(map.get(key));
}
public Builder clearGlossaries() {
bitField0_ = (bitField0_ & ~0x00000040);
internalGetMutableGlossaries().clear();
return this;
}
/**
*
*
*
* Optional. Glossaries to be applied. It's keyed by target language code.
*
*
*
* map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public Builder removeGlossaries(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
internalGetMutableGlossaries().ensureBuilderMap().remove(key);
return this;
}
/** Use alternate mutation accessors instead. */
@java.lang.Deprecated
public java.util.Map<
java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
getMutableGlossaries() {
bitField0_ |= 0x00000040;
return internalGetMutableGlossaries().ensureMessageMap();
}
/**
*
*
*
* Optional. Glossaries to be applied. It's keyed by target language code.
*
*
*
* map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public Builder putGlossaries(
java.lang.String key,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig value) {
if (key == null) {
throw new NullPointerException("map key");
}
if (value == null) {
throw new NullPointerException("map value");
}
internalGetMutableGlossaries().ensureBuilderMap().put(key, value);
bitField0_ |= 0x00000040;
return this;
}
/**
*
*
*
* Optional. Glossaries to be applied. It's keyed by target language code.
*
*
*
* map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public Builder putAllGlossaries(
java.util.Map<
java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
values) {
for (java.util.Map.Entry<
java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig>
e : values.entrySet()) {
if (e.getKey() == null || e.getValue() == null) {
throw new NullPointerException();
}
}
internalGetMutableGlossaries().ensureBuilderMap().putAll(values);
bitField0_ |= 0x00000040;
return this;
}
/**
*
*
*
* Optional. Glossaries to be applied. It's keyed by target language code.
*
*
*
* map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder
putGlossariesBuilderIfAbsent(java.lang.String key) {
java.util.Map<
java.lang.String,
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder>
builderMap = internalGetMutableGlossaries().ensureBuilderMap();
com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder entry =
builderMap.get(key);
if (entry == null) {
entry = com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.newBuilder();
builderMap.put(key, entry);
}
if (entry instanceof com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig) {
entry =
((com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig) entry).toBuilder();
builderMap.put(key, entry);
}
return (com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder) entry;
}
private com.google.protobuf.MapField formatConversions_;
private com.google.protobuf.MapField
internalGetFormatConversions() {
if (formatConversions_ == null) {
return com.google.protobuf.MapField.emptyMapField(
FormatConversionsDefaultEntryHolder.defaultEntry);
}
return formatConversions_;
}
private com.google.protobuf.MapField
internalGetMutableFormatConversions() {
if (formatConversions_ == null) {
formatConversions_ =
com.google.protobuf.MapField.newMapField(
FormatConversionsDefaultEntryHolder.defaultEntry);
}
if (!formatConversions_.isMutable()) {
formatConversions_ = formatConversions_.copy();
}
bitField0_ |= 0x00000080;
onChanged();
return formatConversions_;
}
public int getFormatConversionsCount() {
return internalGetFormatConversions().getMap().size();
}
/**
*
*
*
* Optional. File format conversion map to be applied to all input files.
* Map's key is the original mime_type. Map's value is the target mime_type of
* translated documents.
*
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
*
* If nothing specified, output files will be in the same format as the
* original file.
*
*
*
* map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public boolean containsFormatConversions(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetFormatConversions().getMap().containsKey(key);
}
/** Use {@link #getFormatConversionsMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getFormatConversions() {
return getFormatConversionsMap();
}
/**
*
*
*
* Optional. File format conversion map to be applied to all input files.
* Map's key is the original mime_type. Map's value is the target mime_type of
* translated documents.
*
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
*
* If nothing specified, output files will be in the same format as the
* original file.
*
*
*
* map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public java.util.Map getFormatConversionsMap() {
return internalGetFormatConversions().getMap();
}
/**
*
*
*
* Optional. File format conversion map to be applied to all input files.
* Map's key is the original mime_type. Map's value is the target mime_type of
* translated documents.
*
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
*
* If nothing specified, output files will be in the same format as the
* original file.
*
*
*
* map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public /* nullable */ java.lang.String getFormatConversionsOrDefault(
java.lang.String key,
/* nullable */
java.lang.String defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map =
internalGetFormatConversions().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
*
* Optional. File format conversion map to be applied to all input files.
* Map's key is the original mime_type. Map's value is the target mime_type of
* translated documents.
*
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
*
* If nothing specified, output files will be in the same format as the
* original file.
*
*
*
* map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public java.lang.String getFormatConversionsOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map =
internalGetFormatConversions().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public Builder clearFormatConversions() {
bitField0_ = (bitField0_ & ~0x00000080);
internalGetMutableFormatConversions().getMutableMap().clear();
return this;
}
/**
*
*
*
* Optional. File format conversion map to be applied to all input files.
* Map's key is the original mime_type. Map's value is the target mime_type of
* translated documents.
*
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
*
* If nothing specified, output files will be in the same format as the
* original file.
*
*
*
* map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public Builder removeFormatConversions(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
internalGetMutableFormatConversions().getMutableMap().remove(key);
return this;
}
/** Use alternate mutation accessors instead. */
@java.lang.Deprecated
public java.util.Map getMutableFormatConversions() {
bitField0_ |= 0x00000080;
return internalGetMutableFormatConversions().getMutableMap();
}
/**
*
*
*
* Optional. File format conversion map to be applied to all input files.
* Map's key is the original mime_type. Map's value is the target mime_type of
* translated documents.
*
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
*
* If nothing specified, output files will be in the same format as the
* original file.
*
*
*
* map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public Builder putFormatConversions(java.lang.String key, java.lang.String value) {
if (key == null) {
throw new NullPointerException("map key");
}
if (value == null) {
throw new NullPointerException("map value");
}
internalGetMutableFormatConversions().getMutableMap().put(key, value);
bitField0_ |= 0x00000080;
return this;
}
/**
*
*
*
* Optional. File format conversion map to be applied to all input files.
* Map's key is the original mime_type. Map's value is the target mime_type of
* translated documents.
*
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
*
* If nothing specified, output files will be in the same format as the
* original file.
*
*
*
* map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public Builder putAllFormatConversions(
java.util.Map values) {
internalGetMutableFormatConversions().getMutableMap().putAll(values);
bitField0_ |= 0x00000080;
return this;
}
private java.lang.Object customizedAttribution_ = "";
/**
*
*
*
* Optional. This flag is to support user customized attribution.
* If not provided, the default is `Machine Translated by Google`.
* Customized attribution should follow rules in
* https://cloud.google.com/translate/attribution#attribution_and_logos
*
*
* string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The customizedAttribution.
*/
public java.lang.String getCustomizedAttribution() {
java.lang.Object ref = customizedAttribution_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
customizedAttribution_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Optional. This flag is to support user customized attribution.
* If not provided, the default is `Machine Translated by Google`.
* Customized attribution should follow rules in
* https://cloud.google.com/translate/attribution#attribution_and_logos
*
*
* string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The bytes for customizedAttribution.
*/
public com.google.protobuf.ByteString getCustomizedAttributionBytes() {
java.lang.Object ref = customizedAttribution_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
customizedAttribution_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Optional. This flag is to support user customized attribution.
* If not provided, the default is `Machine Translated by Google`.
* Customized attribution should follow rules in
* https://cloud.google.com/translate/attribution#attribution_and_logos
*
*
* string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The customizedAttribution to set.
* @return This builder for chaining.
*/
public Builder setCustomizedAttribution(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
customizedAttribution_ = value;
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
*
*
* Optional. This flag is to support user customized attribution.
* If not provided, the default is `Machine Translated by Google`.
* Customized attribution should follow rules in
* https://cloud.google.com/translate/attribution#attribution_and_logos
*
*
* string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];
*
* @return This builder for chaining.
*/
public Builder clearCustomizedAttribution() {
customizedAttribution_ = getDefaultInstance().getCustomizedAttribution();
bitField0_ = (bitField0_ & ~0x00000100);
onChanged();
return this;
}
/**
*
*
*
* Optional. This flag is to support user customized attribution.
* If not provided, the default is `Machine Translated by Google`.
* Customized attribution should follow rules in
* https://cloud.google.com/translate/attribution#attribution_and_logos
*
*
* string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The bytes for customizedAttribution to set.
* @return This builder for chaining.
*/
public Builder setCustomizedAttributionBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
customizedAttribution_ = value;
bitField0_ |= 0x00000100;
onChanged();
return this;
}
private boolean enableShadowRemovalNativePdf_;
/**
*
*
*
* Optional. If true, use the text removal server to remove the shadow text on
* background image for native pdf translation.
* Shadow removal feature can only be enabled when
* is_translate_native_pdf_only: false && pdf_native_only: false
*
*
* bool enable_shadow_removal_native_pdf = 11 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return The enableShadowRemovalNativePdf.
*/
@java.lang.Override
public boolean getEnableShadowRemovalNativePdf() {
return enableShadowRemovalNativePdf_;
}
/**
*
*
*
* Optional. If true, use the text removal server to remove the shadow text on
* background image for native pdf translation.
* Shadow removal feature can only be enabled when
* is_translate_native_pdf_only: false && pdf_native_only: false
*
*
* bool enable_shadow_removal_native_pdf = 11 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @param value The enableShadowRemovalNativePdf to set.
* @return This builder for chaining.
*/
public Builder setEnableShadowRemovalNativePdf(boolean value) {
enableShadowRemovalNativePdf_ = value;
bitField0_ |= 0x00000200;
onChanged();
return this;
}
/**
*
*
*
* Optional. If true, use the text removal server to remove the shadow text on
* background image for native pdf translation.
* Shadow removal feature can only be enabled when
* is_translate_native_pdf_only: false && pdf_native_only: false
*
*
* bool enable_shadow_removal_native_pdf = 11 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return This builder for chaining.
*/
public Builder clearEnableShadowRemovalNativePdf() {
bitField0_ = (bitField0_ & ~0x00000200);
enableShadowRemovalNativePdf_ = false;
onChanged();
return this;
}
private boolean enableRotationCorrection_;
/**
*
*
*
* Optional. If true, enable auto rotation correction in DVS.
*
*
* bool enable_rotation_correction = 12 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The enableRotationCorrection.
*/
@java.lang.Override
public boolean getEnableRotationCorrection() {
return enableRotationCorrection_;
}
/**
*
*
*
* Optional. If true, enable auto rotation correction in DVS.
*
*
* bool enable_rotation_correction = 12 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The enableRotationCorrection to set.
* @return This builder for chaining.
*/
public Builder setEnableRotationCorrection(boolean value) {
enableRotationCorrection_ = value;
bitField0_ |= 0x00000400;
onChanged();
return this;
}
/**
*
*
*
* Optional. If true, enable auto rotation correction in DVS.
*
*
* bool enable_rotation_correction = 12 [(.google.api.field_behavior) = OPTIONAL];
*
* @return This builder for chaining.
*/
public Builder clearEnableRotationCorrection() {
bitField0_ = (bitField0_ & ~0x00000400);
enableRotationCorrection_ = false;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.translation.v3beta1.BatchTranslateDocumentRequest)
}
// @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchTranslateDocumentRequest)
private static final com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest();
}
public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public BatchTranslateDocumentRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy