Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 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.2
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.
*
* 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).
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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
*
* 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.
*
*
* 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.
*
* 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.
*
* 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.
*
* 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).
*
* 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).
*
* 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).
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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
*
* 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
*
* 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
*
* 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
*
* 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
*