diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/TranslationServiceClient.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/TranslationServiceClient.java index bcf8cf95..81e5f3db 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/TranslationServiceClient.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/TranslationServiceClient.java @@ -194,7 +194,8 @@ public final OperationsClient getOperationsClient() { * @param targetLanguageCode Required. The BCP-47 language code to use for translation of the * input text, set to one of the language codes listed in Language Support. * @param contents Required. The content of the input in string format. We recommend the total - * content be less than 30k codepoints. Use BatchTranslateText for larger text. + * content be less than 30k codepoints. The max length of this field is 1024. Use + * BatchTranslateText for larger text. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TranslateTextResponse translateText( @@ -235,7 +236,8 @@ public final TranslateTextResponse translateText( * @param targetLanguageCode Required. The BCP-47 language code to use for translation of the * input text, set to one of the language codes listed in Language Support. * @param contents Required. The content of the input in string format. We recommend the total - * content be less than 30k codepoints. Use BatchTranslateText for larger text. + * content be less than 30k codepoints. The max length of this field is 1024. Use + * BatchTranslateText for larger text. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TranslateTextResponse translateText( @@ -283,10 +285,9 @@ public final TranslateTextResponse translateText( * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` *

For global (non-regionalized) requests, use `location-id` `global`. For example, * `projects/{project-number-or-id}/locations/global/models/general/nmt`. - *

If missing, the system decides which google base model to use. + *

If not provided, the default Google model (NMT) will be used. * @param mimeType Optional. The format of the source text, for example, "text/html", * "text/plain". If left blank, the MIME type defaults to "text/html". * @param sourceLanguageCode Optional. The BCP-47 language code of the input text if known, for @@ -296,7 +297,8 @@ public final TranslateTextResponse translateText( * @param targetLanguageCode Required. The BCP-47 language code to use for translation of the * input text, set to one of the language codes listed in Language Support. * @param contents Required. The content of the input in string format. We recommend the total - * content be less than 30k codepoints. Use BatchTranslateText for larger text. + * content be less than 30k codepoints. The max length of this field is 1024. Use + * BatchTranslateText for larger text. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TranslateTextResponse translateText( @@ -352,10 +354,9 @@ public final TranslateTextResponse translateText( * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` *

For global (non-regionalized) requests, use `location-id` `global`. For example, * `projects/{project-number-or-id}/locations/global/models/general/nmt`. - *

If missing, the system decides which google base model to use. + *

If not provided, the default Google model (NMT) will be used. * @param mimeType Optional. The format of the source text, for example, "text/html", * "text/plain". If left blank, the MIME type defaults to "text/html". * @param sourceLanguageCode Optional. The BCP-47 language code of the input text if known, for @@ -365,7 +366,8 @@ public final TranslateTextResponse translateText( * @param targetLanguageCode Required. The BCP-47 language code to use for translation of the * input text, set to one of the language codes listed in Language Support. * @param contents Required. The content of the input in string format. We recommend the total - * content be less than 30k codepoints. Use BatchTranslateText for larger text. + * content be less than 30k codepoints. The max length of this field is 1024. Use + * BatchTranslateText for larger text. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TranslateTextResponse translateText( @@ -624,9 +626,8 @@ public final DetectLanguageResponse detectLanguage(DetectLanguageRequest request * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` *

Returns languages supported by the specified model. If missing, we get supported - * languages of Google general base (PBMT) model. + * languages of Google general NMT model. * @param displayLanguageCode Optional. The language to use to return localized, human readable * names of supported languages. If missing, then display names are not returned in a * response. @@ -673,9 +674,8 @@ public final SupportedLanguages getSupportedLanguages( * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` *

Returns languages supported by the specified model. If missing, we get supported - * languages of Google general base (PBMT) model. + * languages of Google general NMT model. * @param displayLanguageCode Optional. The language to use to return localized, human readable * names of supported languages. If missing, then display names are not returned in a * response. @@ -743,6 +743,67 @@ public final SupportedLanguages getSupportedLanguages(GetSupportedLanguagesReque return stub.getSupportedLanguagesCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Translates documents in synchronous mode. + * + *

Sample code: + * + *

{@code
+   * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+   *   TranslateDocumentRequest request =
+   *       TranslateDocumentRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setSourceLanguageCode("sourceLanguageCode1645917472")
+   *           .setTargetLanguageCode("targetLanguageCode-106414698")
+   *           .setDocumentInputConfig(DocumentInputConfig.newBuilder().build())
+   *           .setDocumentOutputConfig(DocumentOutputConfig.newBuilder().build())
+   *           .setModel("model104069929")
+   *           .setGlossaryConfig(TranslateTextGlossaryConfig.newBuilder().build())
+   *           .putAllLabels(new HashMap())
+   *           .build();
+   *   TranslateDocumentResponse response = translationServiceClient.translateDocument(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TranslateDocumentResponse translateDocument(TranslateDocumentRequest request) { + return translateDocumentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Translates documents in synchronous mode. + * + *

Sample code: + * + *

{@code
+   * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+   *   TranslateDocumentRequest request =
+   *       TranslateDocumentRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setSourceLanguageCode("sourceLanguageCode1645917472")
+   *           .setTargetLanguageCode("targetLanguageCode-106414698")
+   *           .setDocumentInputConfig(DocumentInputConfig.newBuilder().build())
+   *           .setDocumentOutputConfig(DocumentOutputConfig.newBuilder().build())
+   *           .setModel("model104069929")
+   *           .setGlossaryConfig(TranslateTextGlossaryConfig.newBuilder().build())
+   *           .putAllLabels(new HashMap())
+   *           .build();
+   *   ApiFuture future =
+   *       translationServiceClient.translateDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   TranslateDocumentResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + translateDocumentCallable() { + return stub.translateDocumentCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Translates a large volume of text in asynchronous batch mode. This function provides real-time @@ -852,6 +913,121 @@ public final UnaryCallable batchTranslateT return stub.batchTranslateTextCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Translates a large volume of document in asynchronous batch mode. This function provides + * real-time output as the inputs are being processed. If caller cancels a request, the partial + * results (for an input file, it's all or nothing) may still be available on the specified output + * location. + * + *

This call returns immediately and you can use google.longrunning.Operation.name to poll the + * status of the call. + * + *

Sample code: + * + *

{@code
+   * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+   *   BatchTranslateDocumentRequest request =
+   *       BatchTranslateDocumentRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setSourceLanguageCode("sourceLanguageCode1645917472")
+   *           .addAllTargetLanguageCodes(new ArrayList())
+   *           .addAllInputConfigs(new ArrayList())
+   *           .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build())
+   *           .putAllModels(new HashMap())
+   *           .putAllGlossaries(new HashMap())
+   *           .putAllFormatConversions(new HashMap())
+   *           .build();
+   *   BatchTranslateDocumentResponse response =
+   *       translationServiceClient.batchTranslateDocumentAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + batchTranslateDocumentAsync(BatchTranslateDocumentRequest request) { + return batchTranslateDocumentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Translates a large volume of document in asynchronous batch mode. This function provides + * real-time output as the inputs are being processed. If caller cancels a request, the partial + * results (for an input file, it's all or nothing) may still be available on the specified output + * location. + * + *

This call returns immediately and you can use google.longrunning.Operation.name to poll the + * status of the call. + * + *

Sample code: + * + *

{@code
+   * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+   *   BatchTranslateDocumentRequest request =
+   *       BatchTranslateDocumentRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setSourceLanguageCode("sourceLanguageCode1645917472")
+   *           .addAllTargetLanguageCodes(new ArrayList())
+   *           .addAllInputConfigs(new ArrayList())
+   *           .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build())
+   *           .putAllModels(new HashMap())
+   *           .putAllGlossaries(new HashMap())
+   *           .putAllFormatConversions(new HashMap())
+   *           .build();
+   *   OperationFuture future =
+   *       translationServiceClient.batchTranslateDocumentOperationCallable().futureCall(request);
+   *   // Do something.
+   *   BatchTranslateDocumentResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + BatchTranslateDocumentRequest, + BatchTranslateDocumentResponse, + BatchTranslateDocumentMetadata> + batchTranslateDocumentOperationCallable() { + return stub.batchTranslateDocumentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Translates a large volume of document in asynchronous batch mode. This function provides + * real-time output as the inputs are being processed. If caller cancels a request, the partial + * results (for an input file, it's all or nothing) may still be available on the specified output + * location. + * + *

This call returns immediately and you can use google.longrunning.Operation.name to poll the + * status of the call. + * + *

Sample code: + * + *

{@code
+   * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+   *   BatchTranslateDocumentRequest request =
+   *       BatchTranslateDocumentRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setSourceLanguageCode("sourceLanguageCode1645917472")
+   *           .addAllTargetLanguageCodes(new ArrayList())
+   *           .addAllInputConfigs(new ArrayList())
+   *           .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build())
+   *           .putAllModels(new HashMap())
+   *           .putAllGlossaries(new HashMap())
+   *           .putAllFormatConversions(new HashMap())
+   *           .build();
+   *   ApiFuture future =
+   *       translationServiceClient.batchTranslateDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + batchTranslateDocumentCallable() { + return stub.batchTranslateDocumentCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/TranslationServiceSettings.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/TranslationServiceSettings.java index cc16e89b..982f0e8f 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/TranslationServiceSettings.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/TranslationServiceSettings.java @@ -88,6 +88,12 @@ public UnaryCallSettings detectLa return ((TranslationServiceStubSettings) getStubSettings()).getSupportedLanguagesSettings(); } + /** Returns the object with the settings used for calls to translateDocument. */ + public UnaryCallSettings + translateDocumentSettings() { + return ((TranslationServiceStubSettings) getStubSettings()).translateDocumentSettings(); + } + /** Returns the object with the settings used for calls to batchTranslateText. */ public UnaryCallSettings batchTranslateTextSettings() { return ((TranslationServiceStubSettings) getStubSettings()).batchTranslateTextSettings(); @@ -101,6 +107,22 @@ public UnaryCallSettings batchTranslateTex .batchTranslateTextOperationSettings(); } + /** Returns the object with the settings used for calls to batchTranslateDocument. */ + public UnaryCallSettings + batchTranslateDocumentSettings() { + return ((TranslationServiceStubSettings) getStubSettings()).batchTranslateDocumentSettings(); + } + + /** Returns the object with the settings used for calls to batchTranslateDocument. */ + public OperationCallSettings< + BatchTranslateDocumentRequest, + BatchTranslateDocumentResponse, + BatchTranslateDocumentMetadata> + batchTranslateDocumentOperationSettings() { + return ((TranslationServiceStubSettings) getStubSettings()) + .batchTranslateDocumentOperationSettings(); + } + /** Returns the object with the settings used for calls to createGlossary. */ public UnaryCallSettings createGlossarySettings() { return ((TranslationServiceStubSettings) getStubSettings()).createGlossarySettings(); @@ -251,6 +273,12 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().getSupportedLanguagesSettings(); } + /** Returns the builder for the settings used for calls to translateDocument. */ + public UnaryCallSettings.Builder + translateDocumentSettings() { + return getStubSettingsBuilder().translateDocumentSettings(); + } + /** Returns the builder for the settings used for calls to batchTranslateText. */ public UnaryCallSettings.Builder batchTranslateTextSettings() { @@ -264,6 +292,21 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().batchTranslateTextOperationSettings(); } + /** Returns the builder for the settings used for calls to batchTranslateDocument. */ + public UnaryCallSettings.Builder + batchTranslateDocumentSettings() { + return getStubSettingsBuilder().batchTranslateDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to batchTranslateDocument. */ + public OperationCallSettings.Builder< + BatchTranslateDocumentRequest, + BatchTranslateDocumentResponse, + BatchTranslateDocumentMetadata> + batchTranslateDocumentOperationSettings() { + return getStubSettingsBuilder().batchTranslateDocumentOperationSettings(); + } + /** Returns the builder for the settings used for calls to createGlossary. */ public UnaryCallSettings.Builder createGlossarySettings() { return getStubSettingsBuilder().createGlossarySettings(); diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/gapic_metadata.json b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/gapic_metadata.json index 0a8fc1c4..0088a1f0 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/gapic_metadata.json +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/gapic_metadata.json @@ -10,6 +10,9 @@ "grpc": { "libraryClient": "TranslationServiceClient", "rpcs": { + "BatchTranslateDocument": { + "methods": ["batchTranslateDocumentAsync", "batchTranslateDocumentOperationCallable", "batchTranslateDocumentCallable"] + }, "BatchTranslateText": { "methods": ["batchTranslateTextAsync", "batchTranslateTextOperationCallable", "batchTranslateTextCallable"] }, @@ -31,6 +34,9 @@ "ListGlossaries": { "methods": ["listGlossaries", "listGlossaries", "listGlossaries", "listGlossariesPagedCallable", "listGlossariesCallable"] }, + "TranslateDocument": { + "methods": ["translateDocument", "translateDocumentCallable"] + }, "TranslateText": { "methods": ["translateText", "translateText", "translateText", "translateText", "translateText", "translateTextCallable"] } diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/package-info.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/package-info.java index d7e846a4..cfa8e6b1 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/package-info.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Cloud Translation API + * + *

The interfaces provided are listed below, along with usage samples. * *

======================= TranslationServiceClient ======================= * diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/GrpcTranslationServiceStub.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/GrpcTranslationServiceStub.java index caf3bf31..6ab9785c 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/GrpcTranslationServiceStub.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/GrpcTranslationServiceStub.java @@ -25,6 +25,9 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.translate.v3.BatchTranslateDocumentMetadata; +import com.google.cloud.translate.v3.BatchTranslateDocumentRequest; +import com.google.cloud.translate.v3.BatchTranslateDocumentResponse; import com.google.cloud.translate.v3.BatchTranslateMetadata; import com.google.cloud.translate.v3.BatchTranslateResponse; import com.google.cloud.translate.v3.BatchTranslateTextRequest; @@ -41,6 +44,8 @@ import com.google.cloud.translate.v3.ListGlossariesRequest; import com.google.cloud.translate.v3.ListGlossariesResponse; import com.google.cloud.translate.v3.SupportedLanguages; +import com.google.cloud.translate.v3.TranslateDocumentRequest; +import com.google.cloud.translate.v3.TranslateDocumentResponse; import com.google.cloud.translate.v3.TranslateTextRequest; import com.google.cloud.translate.v3.TranslateTextResponse; import com.google.common.collect.ImmutableMap; @@ -93,6 +98,17 @@ public class GrpcTranslationServiceStub extends TranslationServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(SupportedLanguages.getDefaultInstance())) .build(); + private static final MethodDescriptor + translateDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.translation.v3.TranslationService/TranslateDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(TranslateDocumentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TranslateDocumentResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor batchTranslateTextMethodDescriptor = MethodDescriptor.newBuilder() @@ -104,6 +120,17 @@ public class GrpcTranslationServiceStub extends TranslationServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + batchTranslateDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.translation.v3.TranslationService/BatchTranslateDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchTranslateDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor createGlossaryMethodDescriptor = MethodDescriptor.newBuilder() @@ -147,10 +174,19 @@ public class GrpcTranslationServiceStub extends TranslationServiceStub { private final UnaryCallable detectLanguageCallable; private final UnaryCallable getSupportedLanguagesCallable; + private final UnaryCallable + translateDocumentCallable; private final UnaryCallable batchTranslateTextCallable; private final OperationCallable< BatchTranslateTextRequest, BatchTranslateResponse, BatchTranslateMetadata> batchTranslateTextOperationCallable; + private final UnaryCallable + batchTranslateDocumentCallable; + private final OperationCallable< + BatchTranslateDocumentRequest, + BatchTranslateDocumentResponse, + BatchTranslateDocumentMetadata> + batchTranslateDocumentOperationCallable; private final UnaryCallable createGlossaryCallable; private final OperationCallable createGlossaryOperationCallable; @@ -239,6 +275,17 @@ protected GrpcTranslationServiceStub( return params.build(); }) .build(); + GrpcCallSettings + translateDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(translateDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); GrpcCallSettings batchTranslateTextTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(batchTranslateTextMethodDescriptor) @@ -249,6 +296,17 @@ protected GrpcTranslationServiceStub( return params.build(); }) .build(); + GrpcCallSettings + batchTranslateDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchTranslateDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); GrpcCallSettings createGlossaryTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createGlossaryMethodDescriptor) @@ -302,6 +360,11 @@ protected GrpcTranslationServiceStub( getSupportedLanguagesTransportSettings, settings.getSupportedLanguagesSettings(), clientContext); + this.translateDocumentCallable = + callableFactory.createUnaryCallable( + translateDocumentTransportSettings, + settings.translateDocumentSettings(), + clientContext); this.batchTranslateTextCallable = callableFactory.createUnaryCallable( batchTranslateTextTransportSettings, @@ -313,6 +376,17 @@ protected GrpcTranslationServiceStub( settings.batchTranslateTextOperationSettings(), clientContext, operationsStub); + this.batchTranslateDocumentCallable = + callableFactory.createUnaryCallable( + batchTranslateDocumentTransportSettings, + settings.batchTranslateDocumentSettings(), + clientContext); + this.batchTranslateDocumentOperationCallable = + callableFactory.createOperationCallable( + batchTranslateDocumentTransportSettings, + settings.batchTranslateDocumentOperationSettings(), + clientContext, + operationsStub); this.createGlossaryCallable = callableFactory.createUnaryCallable( createGlossaryTransportSettings, settings.createGlossarySettings(), clientContext); @@ -365,6 +439,12 @@ public UnaryCallable detectLangua return getSupportedLanguagesCallable; } + @Override + public UnaryCallable + translateDocumentCallable() { + return translateDocumentCallable; + } + @Override public UnaryCallable batchTranslateTextCallable() { return batchTranslateTextCallable; @@ -377,6 +457,20 @@ public UnaryCallable batchTranslateTextCal return batchTranslateTextOperationCallable; } + @Override + public UnaryCallable batchTranslateDocumentCallable() { + return batchTranslateDocumentCallable; + } + + @Override + public OperationCallable< + BatchTranslateDocumentRequest, + BatchTranslateDocumentResponse, + BatchTranslateDocumentMetadata> + batchTranslateDocumentOperationCallable() { + return batchTranslateDocumentOperationCallable; + } + @Override public UnaryCallable createGlossaryCallable() { return createGlossaryCallable; diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/TranslationServiceStub.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/TranslationServiceStub.java index 8e0d60b3..aab58b67 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/TranslationServiceStub.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/TranslationServiceStub.java @@ -21,6 +21,9 @@ import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.translate.v3.BatchTranslateDocumentMetadata; +import com.google.cloud.translate.v3.BatchTranslateDocumentRequest; +import com.google.cloud.translate.v3.BatchTranslateDocumentResponse; import com.google.cloud.translate.v3.BatchTranslateMetadata; import com.google.cloud.translate.v3.BatchTranslateResponse; import com.google.cloud.translate.v3.BatchTranslateTextRequest; @@ -37,6 +40,8 @@ import com.google.cloud.translate.v3.ListGlossariesRequest; import com.google.cloud.translate.v3.ListGlossariesResponse; import com.google.cloud.translate.v3.SupportedLanguages; +import com.google.cloud.translate.v3.TranslateDocumentRequest; +import com.google.cloud.translate.v3.TranslateDocumentResponse; import com.google.cloud.translate.v3.TranslateTextRequest; import com.google.cloud.translate.v3.TranslateTextResponse; import com.google.longrunning.Operation; @@ -69,6 +74,11 @@ public UnaryCallable detectLangua throw new UnsupportedOperationException("Not implemented: getSupportedLanguagesCallable()"); } + public UnaryCallable + translateDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: translateDocumentCallable()"); + } + public OperationCallable< BatchTranslateTextRequest, BatchTranslateResponse, BatchTranslateMetadata> batchTranslateTextOperationCallable() { @@ -80,6 +90,19 @@ public UnaryCallable batchTranslateTextCal throw new UnsupportedOperationException("Not implemented: batchTranslateTextCallable()"); } + public OperationCallable< + BatchTranslateDocumentRequest, + BatchTranslateDocumentResponse, + BatchTranslateDocumentMetadata> + batchTranslateDocumentOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: batchTranslateDocumentOperationCallable()"); + } + + public UnaryCallable batchTranslateDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: batchTranslateDocumentCallable()"); + } + public OperationCallable createGlossaryOperationCallable() { throw new UnsupportedOperationException("Not implemented: createGlossaryOperationCallable()"); diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/TranslationServiceStubSettings.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/TranslationServiceStubSettings.java index 5fd3a791..b80b2d5d 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/TranslationServiceStubSettings.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/TranslationServiceStubSettings.java @@ -44,6 +44,9 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.translate.v3.BatchTranslateDocumentMetadata; +import com.google.cloud.translate.v3.BatchTranslateDocumentRequest; +import com.google.cloud.translate.v3.BatchTranslateDocumentResponse; import com.google.cloud.translate.v3.BatchTranslateMetadata; import com.google.cloud.translate.v3.BatchTranslateResponse; import com.google.cloud.translate.v3.BatchTranslateTextRequest; @@ -60,6 +63,8 @@ import com.google.cloud.translate.v3.ListGlossariesRequest; import com.google.cloud.translate.v3.ListGlossariesResponse; import com.google.cloud.translate.v3.SupportedLanguages; +import com.google.cloud.translate.v3.TranslateDocumentRequest; +import com.google.cloud.translate.v3.TranslateDocumentResponse; import com.google.cloud.translate.v3.TranslateTextRequest; import com.google.cloud.translate.v3.TranslateTextResponse; import com.google.common.collect.ImmutableList; @@ -120,10 +125,19 @@ public class TranslationServiceStubSettings extends StubSettings getSupportedLanguagesSettings; + private final UnaryCallSettings + translateDocumentSettings; private final UnaryCallSettings batchTranslateTextSettings; private final OperationCallSettings< BatchTranslateTextRequest, BatchTranslateResponse, BatchTranslateMetadata> batchTranslateTextOperationSettings; + private final UnaryCallSettings + batchTranslateDocumentSettings; + private final OperationCallSettings< + BatchTranslateDocumentRequest, + BatchTranslateDocumentResponse, + BatchTranslateDocumentMetadata> + batchTranslateDocumentOperationSettings; private final UnaryCallSettings createGlossarySettings; private final OperationCallSettings createGlossaryOperationSettings; @@ -206,6 +220,12 @@ public UnaryCallSettings detectLa return getSupportedLanguagesSettings; } + /** Returns the object with the settings used for calls to translateDocument. */ + public UnaryCallSettings + translateDocumentSettings() { + return translateDocumentSettings; + } + /** Returns the object with the settings used for calls to batchTranslateText. */ public UnaryCallSettings batchTranslateTextSettings() { return batchTranslateTextSettings; @@ -218,6 +238,21 @@ public UnaryCallSettings batchTranslateTex return batchTranslateTextOperationSettings; } + /** Returns the object with the settings used for calls to batchTranslateDocument. */ + public UnaryCallSettings + batchTranslateDocumentSettings() { + return batchTranslateDocumentSettings; + } + + /** Returns the object with the settings used for calls to batchTranslateDocument. */ + public OperationCallSettings< + BatchTranslateDocumentRequest, + BatchTranslateDocumentResponse, + BatchTranslateDocumentMetadata> + batchTranslateDocumentOperationSettings() { + return batchTranslateDocumentOperationSettings; + } + /** Returns the object with the settings used for calls to createGlossary. */ public UnaryCallSettings createGlossarySettings() { return createGlossarySettings; @@ -332,9 +367,13 @@ protected TranslationServiceStubSettings(Builder settingsBuilder) throws IOExcep translateTextSettings = settingsBuilder.translateTextSettings().build(); detectLanguageSettings = settingsBuilder.detectLanguageSettings().build(); getSupportedLanguagesSettings = settingsBuilder.getSupportedLanguagesSettings().build(); + translateDocumentSettings = settingsBuilder.translateDocumentSettings().build(); batchTranslateTextSettings = settingsBuilder.batchTranslateTextSettings().build(); batchTranslateTextOperationSettings = settingsBuilder.batchTranslateTextOperationSettings().build(); + batchTranslateDocumentSettings = settingsBuilder.batchTranslateDocumentSettings().build(); + batchTranslateDocumentOperationSettings = + settingsBuilder.batchTranslateDocumentOperationSettings().build(); createGlossarySettings = settingsBuilder.createGlossarySettings().build(); createGlossaryOperationSettings = settingsBuilder.createGlossaryOperationSettings().build(); listGlossariesSettings = settingsBuilder.listGlossariesSettings().build(); @@ -353,11 +392,20 @@ public static class Builder detectLanguageSettings; private final UnaryCallSettings.Builder getSupportedLanguagesSettings; + private final UnaryCallSettings.Builder + translateDocumentSettings; private final UnaryCallSettings.Builder batchTranslateTextSettings; private final OperationCallSettings.Builder< BatchTranslateTextRequest, BatchTranslateResponse, BatchTranslateMetadata> batchTranslateTextOperationSettings; + private final UnaryCallSettings.Builder + batchTranslateDocumentSettings; + private final OperationCallSettings.Builder< + BatchTranslateDocumentRequest, + BatchTranslateDocumentResponse, + BatchTranslateDocumentMetadata> + batchTranslateDocumentOperationSettings; private final UnaryCallSettings.Builder createGlossarySettings; private final OperationCallSettings.Builder< @@ -425,8 +473,11 @@ protected Builder(ClientContext clientContext) { translateTextSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); detectLanguageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getSupportedLanguagesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + translateDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); batchTranslateTextSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); batchTranslateTextOperationSettings = OperationCallSettings.newBuilder(); + batchTranslateDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + batchTranslateDocumentOperationSettings = OperationCallSettings.newBuilder(); createGlossarySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createGlossaryOperationSettings = OperationCallSettings.newBuilder(); listGlossariesSettings = PagedCallSettings.newBuilder(LIST_GLOSSARIES_PAGE_STR_FACT); @@ -439,7 +490,9 @@ protected Builder(ClientContext clientContext) { translateTextSettings, detectLanguageSettings, getSupportedLanguagesSettings, + translateDocumentSettings, batchTranslateTextSettings, + batchTranslateDocumentSettings, createGlossarySettings, listGlossariesSettings, getGlossarySettings, @@ -453,9 +506,13 @@ protected Builder(TranslationServiceStubSettings settings) { translateTextSettings = settings.translateTextSettings.toBuilder(); detectLanguageSettings = settings.detectLanguageSettings.toBuilder(); getSupportedLanguagesSettings = settings.getSupportedLanguagesSettings.toBuilder(); + translateDocumentSettings = settings.translateDocumentSettings.toBuilder(); batchTranslateTextSettings = settings.batchTranslateTextSettings.toBuilder(); batchTranslateTextOperationSettings = settings.batchTranslateTextOperationSettings.toBuilder(); + batchTranslateDocumentSettings = settings.batchTranslateDocumentSettings.toBuilder(); + batchTranslateDocumentOperationSettings = + settings.batchTranslateDocumentOperationSettings.toBuilder(); createGlossarySettings = settings.createGlossarySettings.toBuilder(); createGlossaryOperationSettings = settings.createGlossaryOperationSettings.toBuilder(); listGlossariesSettings = settings.listGlossariesSettings.toBuilder(); @@ -468,7 +525,9 @@ protected Builder(TranslationServiceStubSettings settings) { translateTextSettings, detectLanguageSettings, getSupportedLanguagesSettings, + translateDocumentSettings, batchTranslateTextSettings, + batchTranslateDocumentSettings, createGlossarySettings, listGlossariesSettings, getGlossarySettings, @@ -504,11 +563,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .translateDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder .batchTranslateTextSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder + .batchTranslateDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + builder .createGlossarySettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) @@ -553,6 +622,32 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .batchTranslateDocumentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + BatchTranslateDocumentResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + BatchTranslateDocumentMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder .createGlossaryOperationSettings() .setInitialCallSettings( @@ -637,6 +732,12 @@ public Builder applyToAllUnaryMethods( return getSupportedLanguagesSettings; } + /** Returns the builder for the settings used for calls to translateDocument. */ + public UnaryCallSettings.Builder + translateDocumentSettings() { + return translateDocumentSettings; + } + /** Returns the builder for the settings used for calls to batchTranslateText. */ public UnaryCallSettings.Builder batchTranslateTextSettings() { @@ -652,6 +753,23 @@ public Builder applyToAllUnaryMethods( return batchTranslateTextOperationSettings; } + /** Returns the builder for the settings used for calls to batchTranslateDocument. */ + public UnaryCallSettings.Builder + batchTranslateDocumentSettings() { + return batchTranslateDocumentSettings; + } + + /** Returns the builder for the settings used for calls to batchTranslateDocument. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + BatchTranslateDocumentRequest, + BatchTranslateDocumentResponse, + BatchTranslateDocumentMetadata> + batchTranslateDocumentOperationSettings() { + return batchTranslateDocumentOperationSettings; + } + /** Returns the builder for the settings used for calls to createGlossary. */ public UnaryCallSettings.Builder createGlossarySettings() { return createGlossarySettings; diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceClient.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceClient.java index 2cdc88fd..6aa588e2 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceClient.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceClient.java @@ -715,6 +715,7 @@ public final UnaryCallable batchTranslateT * .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build()) * .putAllModels(new HashMap()) * .putAllGlossaries(new HashMap()) + * .putAllFormatConversions(new HashMap()) * .build(); * BatchTranslateDocumentResponse response = * translationServiceClient.batchTranslateDocumentAsync(request).get(); @@ -752,6 +753,7 @@ public final UnaryCallable batchTranslateT * .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build()) * .putAllModels(new HashMap()) * .putAllGlossaries(new HashMap()) + * .putAllFormatConversions(new HashMap()) * .build(); * OperationFuture future = * translationServiceClient.batchTranslateDocumentOperationCallable().futureCall(request); @@ -791,6 +793,7 @@ public final UnaryCallable batchTranslateT * .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build()) * .putAllModels(new HashMap()) * .putAllGlossaries(new HashMap()) + * .putAllFormatConversions(new HashMap()) * .build(); * ApiFuture future = * translationServiceClient.batchTranslateDocumentCallable().futureCall(request); diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/package-info.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/package-info.java index 55fb546e..0ad0dca6 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/package-info.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Cloud Translation API + * + *

The interfaces provided are listed below, along with usage samples. * *

======================= TranslationServiceClient ======================= * diff --git a/google-cloud-translate/src/test/java/com/google/cloud/translate/v3/MockTranslationServiceImpl.java b/google-cloud-translate/src/test/java/com/google/cloud/translate/v3/MockTranslationServiceImpl.java index c3fa20d7..12d19540 100644 --- a/google-cloud-translate/src/test/java/com/google/cloud/translate/v3/MockTranslationServiceImpl.java +++ b/google-cloud-translate/src/test/java/com/google/cloud/translate/v3/MockTranslationServiceImpl.java @@ -122,6 +122,28 @@ public void getSupportedLanguages( } } + @Override + public void translateDocument( + TranslateDocumentRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TranslateDocumentResponse) { + requests.add(request); + responseObserver.onNext(((TranslateDocumentResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TranslateDocument, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TranslateDocumentResponse.class.getName(), + Exception.class.getName()))); + } + } + @Override public void batchTranslateText( BatchTranslateTextRequest request, StreamObserver responseObserver) { @@ -143,6 +165,27 @@ public void batchTranslateText( } } + @Override + public void batchTranslateDocument( + BatchTranslateDocumentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method BatchTranslateDocument, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void createGlossary( CreateGlossaryRequest request, StreamObserver responseObserver) { diff --git a/google-cloud-translate/src/test/java/com/google/cloud/translate/v3/TranslationServiceClientTest.java b/google-cloud-translate/src/test/java/com/google/cloud/translate/v3/TranslationServiceClientTest.java index 3a93a1ea..65a201ce 100644 --- a/google-cloud-translate/src/test/java/com/google/cloud/translate/v3/TranslationServiceClientTest.java +++ b/google-cloud-translate/src/test/java/com/google/cloud/translate/v3/TranslationServiceClientTest.java @@ -473,6 +473,74 @@ public void getSupportedLanguagesExceptionTest2() throws Exception { } } + @Test + public void translateDocumentTest() throws Exception { + TranslateDocumentResponse expectedResponse = + TranslateDocumentResponse.newBuilder() + .setDocumentTranslation(DocumentTranslation.newBuilder().build()) + .setGlossaryDocumentTranslation(DocumentTranslation.newBuilder().build()) + .setModel("model104069929") + .setGlossaryConfig(TranslateTextGlossaryConfig.newBuilder().build()) + .build(); + mockTranslationService.addResponse(expectedResponse); + + TranslateDocumentRequest request = + TranslateDocumentRequest.newBuilder() + .setParent("parent-995424086") + .setSourceLanguageCode("sourceLanguageCode1645917472") + .setTargetLanguageCode("targetLanguageCode-106414698") + .setDocumentInputConfig(DocumentInputConfig.newBuilder().build()) + .setDocumentOutputConfig(DocumentOutputConfig.newBuilder().build()) + .setModel("model104069929") + .setGlossaryConfig(TranslateTextGlossaryConfig.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + + TranslateDocumentResponse actualResponse = client.translateDocument(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTranslationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TranslateDocumentRequest actualRequest = ((TranslateDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getSourceLanguageCode(), actualRequest.getSourceLanguageCode()); + Assert.assertEquals(request.getTargetLanguageCode(), actualRequest.getTargetLanguageCode()); + Assert.assertEquals(request.getDocumentInputConfig(), actualRequest.getDocumentInputConfig()); + Assert.assertEquals(request.getDocumentOutputConfig(), actualRequest.getDocumentOutputConfig()); + Assert.assertEquals(request.getModel(), actualRequest.getModel()); + Assert.assertEquals(request.getGlossaryConfig(), actualRequest.getGlossaryConfig()); + Assert.assertEquals(request.getLabelsMap(), actualRequest.getLabelsMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void translateDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTranslationService.addException(exception); + + try { + TranslateDocumentRequest request = + TranslateDocumentRequest.newBuilder() + .setParent("parent-995424086") + .setSourceLanguageCode("sourceLanguageCode1645917472") + .setTargetLanguageCode("targetLanguageCode-106414698") + .setDocumentInputConfig(DocumentInputConfig.newBuilder().build()) + .setDocumentOutputConfig(DocumentOutputConfig.newBuilder().build()) + .setModel("model104069929") + .setGlossaryConfig(TranslateTextGlossaryConfig.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + client.translateDocument(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void batchTranslateTextTest() throws Exception { BatchTranslateResponse expectedResponse = @@ -551,6 +619,91 @@ public void batchTranslateTextExceptionTest() throws Exception { } } + @Test + public void batchTranslateDocumentTest() throws Exception { + BatchTranslateDocumentResponse expectedResponse = + BatchTranslateDocumentResponse.newBuilder() + .setTotalPages(-396186871) + .setTranslatedPages(-1652747493) + .setFailedPages(-2002254526) + .setTotalBillablePages(1292117569) + .setTotalCharacters(-1368640955) + .setTranslatedCharacters(-1337326221) + .setFailedCharacters(1723028396) + .setTotalBillableCharacters(1242495501) + .setSubmitTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchTranslateDocumentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTranslationService.addResponse(resultOperation); + + BatchTranslateDocumentRequest request = + BatchTranslateDocumentRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setSourceLanguageCode("sourceLanguageCode1645917472") + .addAllTargetLanguageCodes(new ArrayList()) + .addAllInputConfigs(new ArrayList()) + .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build()) + .putAllModels(new HashMap()) + .putAllGlossaries(new HashMap()) + .putAllFormatConversions(new HashMap()) + .build(); + + BatchTranslateDocumentResponse actualResponse = + client.batchTranslateDocumentAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTranslationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchTranslateDocumentRequest actualRequest = + ((BatchTranslateDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getSourceLanguageCode(), actualRequest.getSourceLanguageCode()); + Assert.assertEquals( + request.getTargetLanguageCodesList(), actualRequest.getTargetLanguageCodesList()); + Assert.assertEquals(request.getInputConfigsList(), actualRequest.getInputConfigsList()); + Assert.assertEquals(request.getOutputConfig(), actualRequest.getOutputConfig()); + Assert.assertEquals(request.getModelsMap(), actualRequest.getModelsMap()); + Assert.assertEquals(request.getGlossariesMap(), actualRequest.getGlossariesMap()); + Assert.assertEquals(request.getFormatConversionsMap(), actualRequest.getFormatConversionsMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void batchTranslateDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTranslationService.addException(exception); + + try { + BatchTranslateDocumentRequest request = + BatchTranslateDocumentRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setSourceLanguageCode("sourceLanguageCode1645917472") + .addAllTargetLanguageCodes(new ArrayList()) + .addAllInputConfigs(new ArrayList()) + .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build()) + .putAllModels(new HashMap()) + .putAllGlossaries(new HashMap()) + .putAllFormatConversions(new HashMap()) + .build(); + client.batchTranslateDocumentAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void createGlossaryTest() throws Exception { Glossary expectedResponse = diff --git a/google-cloud-translate/src/test/java/com/google/cloud/translate/v3beta1/TranslationServiceClientTest.java b/google-cloud-translate/src/test/java/com/google/cloud/translate/v3beta1/TranslationServiceClientTest.java index 6801b3db..c68eaa0e 100644 --- a/google-cloud-translate/src/test/java/com/google/cloud/translate/v3beta1/TranslationServiceClientTest.java +++ b/google-cloud-translate/src/test/java/com/google/cloud/translate/v3beta1/TranslationServiceClientTest.java @@ -505,6 +505,7 @@ public void batchTranslateDocumentTest() throws Exception { .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build()) .putAllModels(new HashMap()) .putAllGlossaries(new HashMap()) + .putAllFormatConversions(new HashMap()) .build(); BatchTranslateDocumentResponse actualResponse = @@ -524,6 +525,7 @@ public void batchTranslateDocumentTest() throws Exception { Assert.assertEquals(request.getOutputConfig(), actualRequest.getOutputConfig()); Assert.assertEquals(request.getModelsMap(), actualRequest.getModelsMap()); Assert.assertEquals(request.getGlossariesMap(), actualRequest.getGlossariesMap()); + Assert.assertEquals(request.getFormatConversionsMap(), actualRequest.getFormatConversionsMap()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -545,6 +547,7 @@ public void batchTranslateDocumentExceptionTest() throws Exception { .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build()) .putAllModels(new HashMap()) .putAllGlossaries(new HashMap()) + .putAllFormatConversions(new HashMap()) .build(); client.batchTranslateDocumentAsync(request).get(); Assert.fail("No exception raised"); diff --git a/grpc-google-cloud-translate-v3/src/main/java/com/google/cloud/location/LocationsGrpc.java b/grpc-google-cloud-translate-v3/src/main/java/com/google/cloud/location/LocationsGrpc.java new file mode 100644 index 00000000..16f28b5c --- /dev/null +++ b/grpc-google-cloud-translate-v3/src/main/java/com/google/cloud/location/LocationsGrpc.java @@ -0,0 +1,476 @@ +/* + * Copyright 2020 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. + */ +package com.google.cloud.location; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *

+ * An abstract interface that provides location-related information for
+ * a service. Service-specific metadata is provided through the
+ * [Location.metadata][google.cloud.location.Location.metadata] field.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/location/locations.proto") +public final class LocationsGrpc { + + private LocationsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.location.Locations"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.location.ListLocationsRequest, + com.google.cloud.location.ListLocationsResponse> + getListLocationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListLocations", + requestType = com.google.cloud.location.ListLocationsRequest.class, + responseType = com.google.cloud.location.ListLocationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.location.ListLocationsRequest, + com.google.cloud.location.ListLocationsResponse> + getListLocationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.location.ListLocationsRequest, + com.google.cloud.location.ListLocationsResponse> + getListLocationsMethod; + if ((getListLocationsMethod = LocationsGrpc.getListLocationsMethod) == null) { + synchronized (LocationsGrpc.class) { + if ((getListLocationsMethod = LocationsGrpc.getListLocationsMethod) == null) { + LocationsGrpc.getListLocationsMethod = + getListLocationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListLocations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.location.ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.location.ListLocationsResponse.getDefaultInstance())) + .setSchemaDescriptor(new LocationsMethodDescriptorSupplier("ListLocations")) + .build(); + } + } + } + return getListLocationsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.location.GetLocationRequest, com.google.cloud.location.Location> + getGetLocationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetLocation", + requestType = com.google.cloud.location.GetLocationRequest.class, + responseType = com.google.cloud.location.Location.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.location.GetLocationRequest, com.google.cloud.location.Location> + getGetLocationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.location.GetLocationRequest, com.google.cloud.location.Location> + getGetLocationMethod; + if ((getGetLocationMethod = LocationsGrpc.getGetLocationMethod) == null) { + synchronized (LocationsGrpc.class) { + if ((getGetLocationMethod = LocationsGrpc.getGetLocationMethod) == null) { + LocationsGrpc.getGetLocationMethod = + getGetLocationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetLocation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.location.GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.location.Location.getDefaultInstance())) + .setSchemaDescriptor(new LocationsMethodDescriptorSupplier("GetLocation")) + .build(); + } + } + } + return getGetLocationMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static LocationsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LocationsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsStub(channel, callOptions); + } + }; + return LocationsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static LocationsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LocationsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsBlockingStub(channel, callOptions); + } + }; + return LocationsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static LocationsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LocationsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsFutureStub(channel, callOptions); + } + }; + return LocationsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * An abstract interface that provides location-related information for
+   * a service. Service-specific metadata is provided through the
+   * [Location.metadata][google.cloud.location.Location.metadata] field.
+   * 
+ */ + public abstract static class LocationsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists information about the supported locations for this service.
+     * 
+ */ + public void listLocations( + com.google.cloud.location.ListLocationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListLocationsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets information about a location.
+     * 
+ */ + public void getLocation( + com.google.cloud.location.GetLocationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetLocationMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListLocationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.location.ListLocationsRequest, + com.google.cloud.location.ListLocationsResponse>( + this, METHODID_LIST_LOCATIONS))) + .addMethod( + getGetLocationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.location.GetLocationRequest, + com.google.cloud.location.Location>(this, METHODID_GET_LOCATION))) + .build(); + } + } + + /** + * + * + *
+   * An abstract interface that provides location-related information for
+   * a service. Service-specific metadata is provided through the
+   * [Location.metadata][google.cloud.location.Location.metadata] field.
+   * 
+ */ + public static final class LocationsStub extends io.grpc.stub.AbstractAsyncStub { + private LocationsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LocationsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists information about the supported locations for this service.
+     * 
+ */ + public void listLocations( + com.google.cloud.location.ListLocationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListLocationsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets information about a location.
+     * 
+ */ + public void getLocation( + com.google.cloud.location.GetLocationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetLocationMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * An abstract interface that provides location-related information for
+   * a service. Service-specific metadata is provided through the
+   * [Location.metadata][google.cloud.location.Location.metadata] field.
+   * 
+ */ + public static final class LocationsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private LocationsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LocationsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists information about the supported locations for this service.
+     * 
+ */ + public com.google.cloud.location.ListLocationsResponse listLocations( + com.google.cloud.location.ListLocationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListLocationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about a location.
+     * 
+ */ + public com.google.cloud.location.Location getLocation( + com.google.cloud.location.GetLocationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetLocationMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * An abstract interface that provides location-related information for
+   * a service. Service-specific metadata is provided through the
+   * [Location.metadata][google.cloud.location.Location.metadata] field.
+   * 
+ */ + public static final class LocationsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private LocationsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LocationsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists information about the supported locations for this service.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.location.ListLocationsResponse> + listLocations(com.google.cloud.location.ListLocationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListLocationsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets information about a location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getLocation(com.google.cloud.location.GetLocationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetLocationMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_LOCATIONS = 0; + private static final int METHODID_GET_LOCATION = 1; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final LocationsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(LocationsImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_LOCATIONS: + serviceImpl.listLocations( + (com.google.cloud.location.ListLocationsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_LOCATION: + serviceImpl.getLocation( + (com.google.cloud.location.GetLocationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class LocationsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + LocationsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.location.LocationsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Locations"); + } + } + + private static final class LocationsFileDescriptorSupplier + extends LocationsBaseDescriptorSupplier { + LocationsFileDescriptorSupplier() {} + } + + private static final class LocationsMethodDescriptorSupplier + extends LocationsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + LocationsMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (LocationsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new LocationsFileDescriptorSupplier()) + .addMethod(getListLocationsMethod()) + .addMethod(getGetLocationMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationServiceGrpc.java b/grpc-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationServiceGrpc.java index ff420a4f..9b50dc9d 100644 --- a/grpc-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationServiceGrpc.java +++ b/grpc-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationServiceGrpc.java @@ -178,6 +178,54 @@ private TranslationServiceGrpc() {} return getGetSupportedLanguagesMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.translate.v3.TranslateDocumentRequest, + com.google.cloud.translate.v3.TranslateDocumentResponse> + getTranslateDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TranslateDocument", + requestType = com.google.cloud.translate.v3.TranslateDocumentRequest.class, + responseType = com.google.cloud.translate.v3.TranslateDocumentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.translate.v3.TranslateDocumentRequest, + com.google.cloud.translate.v3.TranslateDocumentResponse> + getTranslateDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.translate.v3.TranslateDocumentRequest, + com.google.cloud.translate.v3.TranslateDocumentResponse> + getTranslateDocumentMethod; + if ((getTranslateDocumentMethod = TranslationServiceGrpc.getTranslateDocumentMethod) == null) { + synchronized (TranslationServiceGrpc.class) { + if ((getTranslateDocumentMethod = TranslationServiceGrpc.getTranslateDocumentMethod) + == null) { + TranslationServiceGrpc.getTranslateDocumentMethod = + getTranslateDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TranslateDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.translate.v3.TranslateDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.translate.v3.TranslateDocumentResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new TranslationServiceMethodDescriptorSupplier("TranslateDocument")) + .build(); + } + } + } + return getTranslateDocumentMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.translate.v3.BatchTranslateTextRequest, com.google.longrunning.Operation> getBatchTranslateTextMethod; @@ -224,6 +272,56 @@ private TranslationServiceGrpc() {} return getBatchTranslateTextMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.translate.v3.BatchTranslateDocumentRequest, + com.google.longrunning.Operation> + getBatchTranslateDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchTranslateDocument", + requestType = com.google.cloud.translate.v3.BatchTranslateDocumentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.translate.v3.BatchTranslateDocumentRequest, + com.google.longrunning.Operation> + getBatchTranslateDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.translate.v3.BatchTranslateDocumentRequest, + com.google.longrunning.Operation> + getBatchTranslateDocumentMethod; + if ((getBatchTranslateDocumentMethod = TranslationServiceGrpc.getBatchTranslateDocumentMethod) + == null) { + synchronized (TranslationServiceGrpc.class) { + if ((getBatchTranslateDocumentMethod = + TranslationServiceGrpc.getBatchTranslateDocumentMethod) + == null) { + TranslationServiceGrpc.getBatchTranslateDocumentMethod = + getBatchTranslateDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "BatchTranslateDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.translate.v3.BatchTranslateDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new TranslationServiceMethodDescriptorSupplier("BatchTranslateDocument")) + .build(); + } + } + } + return getBatchTranslateDocumentMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.translate.v3.CreateGlossaryRequest, com.google.longrunning.Operation> getCreateGlossaryMethod; @@ -496,6 +594,21 @@ public void getSupportedLanguages( getGetSupportedLanguagesMethod(), responseObserver); } + /** + * + * + *
+     * Translates documents in synchronous mode.
+     * 
+ */ + public void translateDocument( + com.google.cloud.translate.v3.TranslateDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTranslateDocumentMethod(), responseObserver); + } + /** * * @@ -515,6 +628,25 @@ public void batchTranslateText( getBatchTranslateTextMethod(), responseObserver); } + /** + * + * + *
+     * Translates a large volume of document in asynchronous batch mode.
+     * This function provides real-time output as the inputs are being processed.
+     * If caller cancels a request, the partial results (for an input file, it's
+     * all or nothing) may still be available on the specified output location.
+     * This call returns immediately and you can use
+     * google.longrunning.Operation.name to poll the status of the call.
+     * 
+ */ + public void batchTranslateDocument( + com.google.cloud.translate.v3.BatchTranslateDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchTranslateDocumentMethod(), responseObserver); + } + /** * * @@ -601,12 +733,25 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.translate.v3.GetSupportedLanguagesRequest, com.google.cloud.translate.v3.SupportedLanguages>( this, METHODID_GET_SUPPORTED_LANGUAGES))) + .addMethod( + getTranslateDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.translate.v3.TranslateDocumentRequest, + com.google.cloud.translate.v3.TranslateDocumentResponse>( + this, METHODID_TRANSLATE_DOCUMENT))) .addMethod( getBatchTranslateTextMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< com.google.cloud.translate.v3.BatchTranslateTextRequest, com.google.longrunning.Operation>(this, METHODID_BATCH_TRANSLATE_TEXT))) + .addMethod( + getBatchTranslateDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.translate.v3.BatchTranslateDocumentRequest, + com.google.longrunning.Operation>(this, METHODID_BATCH_TRANSLATE_DOCUMENT))) .addMethod( getCreateGlossaryMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -706,6 +851,23 @@ public void getSupportedLanguages( responseObserver); } + /** + * + * + *
+     * Translates documents in synchronous mode.
+     * 
+ */ + public void translateDocument( + com.google.cloud.translate.v3.TranslateDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTranslateDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -727,6 +889,27 @@ public void batchTranslateText( responseObserver); } + /** + * + * + *
+     * Translates a large volume of document in asynchronous batch mode.
+     * This function provides real-time output as the inputs are being processed.
+     * If caller cancels a request, the partial results (for an input file, it's
+     * all or nothing) may still be available on the specified output location.
+     * This call returns immediately and you can use
+     * google.longrunning.Operation.name to poll the status of the call.
+     * 
+ */ + public void batchTranslateDocument( + com.google.cloud.translate.v3.BatchTranslateDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchTranslateDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -857,6 +1040,19 @@ public com.google.cloud.translate.v3.SupportedLanguages getSupportedLanguages( getChannel(), getGetSupportedLanguagesMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Translates documents in synchronous mode.
+     * 
+ */ + public com.google.cloud.translate.v3.TranslateDocumentResponse translateDocument( + com.google.cloud.translate.v3.TranslateDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTranslateDocumentMethod(), getCallOptions(), request); + } + /** * * @@ -875,6 +1071,24 @@ public com.google.longrunning.Operation batchTranslateText( getChannel(), getBatchTranslateTextMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Translates a large volume of document in asynchronous batch mode.
+     * This function provides real-time output as the inputs are being processed.
+     * If caller cancels a request, the partial results (for an input file, it's
+     * all or nothing) may still be available on the specified output location.
+     * This call returns immediately and you can use
+     * google.longrunning.Operation.name to poll the status of the call.
+     * 
+ */ + public com.google.longrunning.Operation batchTranslateDocument( + com.google.cloud.translate.v3.BatchTranslateDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchTranslateDocumentMethod(), getCallOptions(), request); + } + /** * * @@ -994,6 +1208,20 @@ protected TranslationServiceFutureStub build( getChannel().newCall(getGetSupportedLanguagesMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Translates documents in synchronous mode.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.translate.v3.TranslateDocumentResponse> + translateDocument(com.google.cloud.translate.v3.TranslateDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTranslateDocumentMethod(), getCallOptions()), request); + } + /** * * @@ -1012,6 +1240,25 @@ protected TranslationServiceFutureStub build( getChannel().newCall(getBatchTranslateTextMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Translates a large volume of document in asynchronous batch mode.
+     * This function provides real-time output as the inputs are being processed.
+     * If caller cancels a request, the partial results (for an input file, it's
+     * all or nothing) may still be available on the specified output location.
+     * This call returns immediately and you can use
+     * google.longrunning.Operation.name to poll the status of the call.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + batchTranslateDocument( + com.google.cloud.translate.v3.BatchTranslateDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBatchTranslateDocumentMethod(), getCallOptions()), request); + } + /** * * @@ -1075,11 +1322,13 @@ protected TranslationServiceFutureStub build( private static final int METHODID_TRANSLATE_TEXT = 0; private static final int METHODID_DETECT_LANGUAGE = 1; private static final int METHODID_GET_SUPPORTED_LANGUAGES = 2; - private static final int METHODID_BATCH_TRANSLATE_TEXT = 3; - private static final int METHODID_CREATE_GLOSSARY = 4; - private static final int METHODID_LIST_GLOSSARIES = 5; - private static final int METHODID_GET_GLOSSARY = 6; - private static final int METHODID_DELETE_GLOSSARY = 7; + private static final int METHODID_TRANSLATE_DOCUMENT = 3; + private static final int METHODID_BATCH_TRANSLATE_TEXT = 4; + private static final int METHODID_BATCH_TRANSLATE_DOCUMENT = 5; + private static final int METHODID_CREATE_GLOSSARY = 6; + private static final int METHODID_LIST_GLOSSARIES = 7; + private static final int METHODID_GET_GLOSSARY = 8; + private static final int METHODID_DELETE_GLOSSARY = 9; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1116,11 +1365,22 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_TRANSLATE_DOCUMENT: + serviceImpl.translateDocument( + (com.google.cloud.translate.v3.TranslateDocumentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; case METHODID_BATCH_TRANSLATE_TEXT: serviceImpl.batchTranslateText( (com.google.cloud.translate.v3.BatchTranslateTextRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_BATCH_TRANSLATE_DOCUMENT: + serviceImpl.batchTranslateDocument( + (com.google.cloud.translate.v3.BatchTranslateDocumentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_CREATE_GLOSSARY: serviceImpl.createGlossary( (com.google.cloud.translate.v3.CreateGlossaryRequest) request, @@ -1210,7 +1470,9 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getTranslateTextMethod()) .addMethod(getDetectLanguageMethod()) .addMethod(getGetSupportedLanguagesMethod()) + .addMethod(getTranslateDocumentMethod()) .addMethod(getBatchTranslateTextMethod()) + .addMethod(getBatchTranslateDocumentMethod()) .addMethod(getCreateGlossaryMethod()) .addMethod(getListGlossariesMethod()) .addMethod(getGetGlossaryMethod()) diff --git a/grpc-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/LocationsGrpc.java b/grpc-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/LocationsGrpc.java new file mode 100644 index 00000000..16f28b5c --- /dev/null +++ b/grpc-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/LocationsGrpc.java @@ -0,0 +1,476 @@ +/* + * Copyright 2020 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. + */ +package com.google.cloud.location; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * An abstract interface that provides location-related information for
+ * a service. Service-specific metadata is provided through the
+ * [Location.metadata][google.cloud.location.Location.metadata] field.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/location/locations.proto") +public final class LocationsGrpc { + + private LocationsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.location.Locations"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.location.ListLocationsRequest, + com.google.cloud.location.ListLocationsResponse> + getListLocationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListLocations", + requestType = com.google.cloud.location.ListLocationsRequest.class, + responseType = com.google.cloud.location.ListLocationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.location.ListLocationsRequest, + com.google.cloud.location.ListLocationsResponse> + getListLocationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.location.ListLocationsRequest, + com.google.cloud.location.ListLocationsResponse> + getListLocationsMethod; + if ((getListLocationsMethod = LocationsGrpc.getListLocationsMethod) == null) { + synchronized (LocationsGrpc.class) { + if ((getListLocationsMethod = LocationsGrpc.getListLocationsMethod) == null) { + LocationsGrpc.getListLocationsMethod = + getListLocationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListLocations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.location.ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.location.ListLocationsResponse.getDefaultInstance())) + .setSchemaDescriptor(new LocationsMethodDescriptorSupplier("ListLocations")) + .build(); + } + } + } + return getListLocationsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.location.GetLocationRequest, com.google.cloud.location.Location> + getGetLocationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetLocation", + requestType = com.google.cloud.location.GetLocationRequest.class, + responseType = com.google.cloud.location.Location.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.location.GetLocationRequest, com.google.cloud.location.Location> + getGetLocationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.location.GetLocationRequest, com.google.cloud.location.Location> + getGetLocationMethod; + if ((getGetLocationMethod = LocationsGrpc.getGetLocationMethod) == null) { + synchronized (LocationsGrpc.class) { + if ((getGetLocationMethod = LocationsGrpc.getGetLocationMethod) == null) { + LocationsGrpc.getGetLocationMethod = + getGetLocationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetLocation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.location.GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.location.Location.getDefaultInstance())) + .setSchemaDescriptor(new LocationsMethodDescriptorSupplier("GetLocation")) + .build(); + } + } + } + return getGetLocationMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static LocationsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LocationsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsStub(channel, callOptions); + } + }; + return LocationsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static LocationsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LocationsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsBlockingStub(channel, callOptions); + } + }; + return LocationsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static LocationsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LocationsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsFutureStub(channel, callOptions); + } + }; + return LocationsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * An abstract interface that provides location-related information for
+   * a service. Service-specific metadata is provided through the
+   * [Location.metadata][google.cloud.location.Location.metadata] field.
+   * 
+ */ + public abstract static class LocationsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists information about the supported locations for this service.
+     * 
+ */ + public void listLocations( + com.google.cloud.location.ListLocationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListLocationsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets information about a location.
+     * 
+ */ + public void getLocation( + com.google.cloud.location.GetLocationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetLocationMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListLocationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.location.ListLocationsRequest, + com.google.cloud.location.ListLocationsResponse>( + this, METHODID_LIST_LOCATIONS))) + .addMethod( + getGetLocationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.location.GetLocationRequest, + com.google.cloud.location.Location>(this, METHODID_GET_LOCATION))) + .build(); + } + } + + /** + * + * + *
+   * An abstract interface that provides location-related information for
+   * a service. Service-specific metadata is provided through the
+   * [Location.metadata][google.cloud.location.Location.metadata] field.
+   * 
+ */ + public static final class LocationsStub extends io.grpc.stub.AbstractAsyncStub { + private LocationsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LocationsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists information about the supported locations for this service.
+     * 
+ */ + public void listLocations( + com.google.cloud.location.ListLocationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListLocationsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets information about a location.
+     * 
+ */ + public void getLocation( + com.google.cloud.location.GetLocationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetLocationMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * An abstract interface that provides location-related information for
+   * a service. Service-specific metadata is provided through the
+   * [Location.metadata][google.cloud.location.Location.metadata] field.
+   * 
+ */ + public static final class LocationsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private LocationsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LocationsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists information about the supported locations for this service.
+     * 
+ */ + public com.google.cloud.location.ListLocationsResponse listLocations( + com.google.cloud.location.ListLocationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListLocationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about a location.
+     * 
+ */ + public com.google.cloud.location.Location getLocation( + com.google.cloud.location.GetLocationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetLocationMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * An abstract interface that provides location-related information for
+   * a service. Service-specific metadata is provided through the
+   * [Location.metadata][google.cloud.location.Location.metadata] field.
+   * 
+ */ + public static final class LocationsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private LocationsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LocationsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists information about the supported locations for this service.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.location.ListLocationsResponse> + listLocations(com.google.cloud.location.ListLocationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListLocationsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets information about a location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getLocation(com.google.cloud.location.GetLocationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetLocationMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_LOCATIONS = 0; + private static final int METHODID_GET_LOCATION = 1; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final LocationsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(LocationsImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_LOCATIONS: + serviceImpl.listLocations( + (com.google.cloud.location.ListLocationsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_LOCATION: + serviceImpl.getLocation( + (com.google.cloud.location.GetLocationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class LocationsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + LocationsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.location.LocationsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Locations"); + } + } + + private static final class LocationsFileDescriptorSupplier + extends LocationsBaseDescriptorSupplier { + LocationsFileDescriptorSupplier() {} + } + + private static final class LocationsMethodDescriptorSupplier + extends LocationsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + LocationsMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (LocationsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new LocationsFileDescriptorSupplier()) + .addMethod(getListLocationsMethod()) + .addMethod(getGetLocationMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/GetLocationRequest.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/GetLocationRequest.java new file mode 100644 index 00000000..6b7c7e0a --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/GetLocationRequest.java @@ -0,0 +1,634 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +/** + * + * + *
+ * The request message for [Locations.GetLocation][google.cloud.location.Locations.GetLocation].
+ * 
+ * + * Protobuf type {@code google.cloud.location.GetLocationRequest} + */ +public final class GetLocationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.location.GetLocationRequest) + GetLocationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetLocationRequest.newBuilder() to construct. + private GetLocationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetLocationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetLocationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetLocationRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_GetLocationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_GetLocationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.GetLocationRequest.class, + com.google.cloud.location.GetLocationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name for the location.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name for the location.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.location.GetLocationRequest)) { + return super.equals(obj); + } + com.google.cloud.location.GetLocationRequest other = + (com.google.cloud.location.GetLocationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.location.GetLocationRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.GetLocationRequest 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.location.GetLocationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.GetLocationRequest 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.location.GetLocationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.GetLocationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.location.GetLocationRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.GetLocationRequest 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.location.GetLocationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.location.GetLocationRequest 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.location.GetLocationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.GetLocationRequest 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.location.GetLocationRequest 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 request message for [Locations.GetLocation][google.cloud.location.Locations.GetLocation].
+   * 
+ * + * Protobuf type {@code google.cloud.location.GetLocationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.location.GetLocationRequest) + com.google.cloud.location.GetLocationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_GetLocationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_GetLocationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.GetLocationRequest.class, + com.google.cloud.location.GetLocationRequest.Builder.class); + } + + // Construct using com.google.cloud.location.GetLocationRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_GetLocationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.location.GetLocationRequest getDefaultInstanceForType() { + return com.google.cloud.location.GetLocationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.location.GetLocationRequest build() { + com.google.cloud.location.GetLocationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.location.GetLocationRequest buildPartial() { + com.google.cloud.location.GetLocationRequest result = + new com.google.cloud.location.GetLocationRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @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.location.GetLocationRequest) { + return mergeFrom((com.google.cloud.location.GetLocationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.location.GetLocationRequest other) { + if (other == com.google.cloud.location.GetLocationRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.location.GetLocationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.location.GetLocationRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name for the location.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name for the location.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name for the location.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for the location.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for the location.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + 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.location.GetLocationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.location.GetLocationRequest) + private static final com.google.cloud.location.GetLocationRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.location.GetLocationRequest(); + } + + public static com.google.cloud.location.GetLocationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetLocationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetLocationRequest(input, extensionRegistry); + } + }; + + 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.location.GetLocationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/GetLocationRequestOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/GetLocationRequestOrBuilder.java new file mode 100644 index 00000000..a8f3d0f9 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/GetLocationRequestOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +public interface GetLocationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.location.GetLocationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name for the location.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name for the location.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/ListLocationsRequest.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/ListLocationsRequest.java new file mode 100644 index 00000000..e1b3af7f --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/ListLocationsRequest.java @@ -0,0 +1,1082 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +/** + * + * + *
+ * The request message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
+ * 
+ * + * Protobuf type {@code google.cloud.location.ListLocationsRequest} + */ +public final class ListLocationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.location.ListLocationsRequest) + ListLocationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListLocationsRequest.newBuilder() to construct. + private ListLocationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLocationsRequest() { + name_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLocationsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListLocationsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.ListLocationsRequest.class, + com.google.cloud.location.ListLocationsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource that owns the locations collection, if applicable.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource that owns the locations collection, if applicable.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The standard list filter.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The standard list filter.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The standard list page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The standard list page token.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The standard list page token.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.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.location.ListLocationsRequest)) { + return super.equals(obj); + } + com.google.cloud.location.ListLocationsRequest other = + (com.google.cloud.location.ListLocationsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.location.ListLocationsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.ListLocationsRequest 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.location.ListLocationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.ListLocationsRequest 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.location.ListLocationsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.ListLocationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.location.ListLocationsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.ListLocationsRequest 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.location.ListLocationsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.location.ListLocationsRequest 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.location.ListLocationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.ListLocationsRequest 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.location.ListLocationsRequest 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 request message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
+   * 
+ * + * Protobuf type {@code google.cloud.location.ListLocationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.location.ListLocationsRequest) + com.google.cloud.location.ListLocationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.ListLocationsRequest.class, + com.google.cloud.location.ListLocationsRequest.Builder.class); + } + + // Construct using com.google.cloud.location.ListLocationsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.location.ListLocationsRequest getDefaultInstanceForType() { + return com.google.cloud.location.ListLocationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.location.ListLocationsRequest build() { + com.google.cloud.location.ListLocationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.location.ListLocationsRequest buildPartial() { + com.google.cloud.location.ListLocationsRequest result = + new com.google.cloud.location.ListLocationsRequest(this); + result.name_ = name_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @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.location.ListLocationsRequest) { + return mergeFrom((com.google.cloud.location.ListLocationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.location.ListLocationsRequest other) { + if (other == com.google.cloud.location.ListLocationsRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.location.ListLocationsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.location.ListLocationsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource that owns the locations collection, if applicable.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource that owns the locations collection, if applicable.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource that owns the locations collection, if applicable.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource that owns the locations collection, if applicable.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource that owns the locations collection, if applicable.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The standard list filter.
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The standard list filter.
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The standard list filter.
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The standard list filter.
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard list filter.
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The standard list page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The standard list page size.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The standard list page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The standard list page token.
+     * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The standard list page token.
+     * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The standard list page token.
+     * 
+ * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The standard list page token.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard list page token.
+     * 
+ * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + 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.location.ListLocationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.location.ListLocationsRequest) + private static final com.google.cloud.location.ListLocationsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.location.ListLocationsRequest(); + } + + public static com.google.cloud.location.ListLocationsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLocationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListLocationsRequest(input, extensionRegistry); + } + }; + + 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.location.ListLocationsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/ListLocationsRequestOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/ListLocationsRequestOrBuilder.java new file mode 100644 index 00000000..3a3f39a7 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/ListLocationsRequestOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +public interface ListLocationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.location.ListLocationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource that owns the locations collection, if applicable.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource that owns the locations collection, if applicable.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The standard list filter.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The standard list filter.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The standard list page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The standard list page token.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The standard list page token.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/ListLocationsResponse.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/ListLocationsResponse.java new file mode 100644 index 00000000..8e7553c0 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/ListLocationsResponse.java @@ -0,0 +1,1126 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +/** + * + * + *
+ * The response message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
+ * 
+ * + * Protobuf type {@code google.cloud.location.ListLocationsResponse} + */ +public final class ListLocationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.location.ListLocationsResponse) + ListLocationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListLocationsResponse.newBuilder() to construct. + private ListLocationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLocationsResponse() { + locations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLocationsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListLocationsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + locations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + locations_.add( + input.readMessage( + com.google.cloud.location.Location.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + locations_ = java.util.Collections.unmodifiableList(locations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.ListLocationsResponse.class, + com.google.cloud.location.ListLocationsResponse.Builder.class); + } + + public static final int LOCATIONS_FIELD_NUMBER = 1; + private java.util.List locations_; + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + @java.lang.Override + public java.util.List getLocationsList() { + return locations_; + } + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + @java.lang.Override + public java.util.List + getLocationsOrBuilderList() { + return locations_; + } + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + @java.lang.Override + public int getLocationsCount() { + return locations_.size(); + } + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + @java.lang.Override + public com.google.cloud.location.Location getLocations(int index) { + return locations_.get(index); + } + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + @java.lang.Override + public com.google.cloud.location.LocationOrBuilder getLocationsOrBuilder(int index) { + return locations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The standard List next-page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The standard List next-page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 { + for (int i = 0; i < locations_.size(); i++) { + output.writeMessage(1, locations_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < locations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, locations_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.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.location.ListLocationsResponse)) { + return super.equals(obj); + } + com.google.cloud.location.ListLocationsResponse other = + (com.google.cloud.location.ListLocationsResponse) obj; + + if (!getLocationsList().equals(other.getLocationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLocationsCount() > 0) { + hash = (37 * hash) + LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getLocationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.location.ListLocationsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.ListLocationsResponse 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.location.ListLocationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.ListLocationsResponse 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.location.ListLocationsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.ListLocationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.location.ListLocationsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.ListLocationsResponse 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.location.ListLocationsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.location.ListLocationsResponse 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.location.ListLocationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.ListLocationsResponse 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.location.ListLocationsResponse 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 response message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
+   * 
+ * + * Protobuf type {@code google.cloud.location.ListLocationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.location.ListLocationsResponse) + com.google.cloud.location.ListLocationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.ListLocationsResponse.class, + com.google.cloud.location.ListLocationsResponse.Builder.class); + } + + // Construct using com.google.cloud.location.ListLocationsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getLocationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (locationsBuilder_ == null) { + locations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + locationsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.location.ListLocationsResponse getDefaultInstanceForType() { + return com.google.cloud.location.ListLocationsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.location.ListLocationsResponse build() { + com.google.cloud.location.ListLocationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.location.ListLocationsResponse buildPartial() { + com.google.cloud.location.ListLocationsResponse result = + new com.google.cloud.location.ListLocationsResponse(this); + int from_bitField0_ = bitField0_; + if (locationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + locations_ = java.util.Collections.unmodifiableList(locations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.locations_ = locations_; + } else { + result.locations_ = locationsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @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.location.ListLocationsResponse) { + return mergeFrom((com.google.cloud.location.ListLocationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.location.ListLocationsResponse other) { + if (other == com.google.cloud.location.ListLocationsResponse.getDefaultInstance()) + return this; + if (locationsBuilder_ == null) { + if (!other.locations_.isEmpty()) { + if (locations_.isEmpty()) { + locations_ = other.locations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLocationsIsMutable(); + locations_.addAll(other.locations_); + } + onChanged(); + } + } else { + if (!other.locations_.isEmpty()) { + if (locationsBuilder_.isEmpty()) { + locationsBuilder_.dispose(); + locationsBuilder_ = null; + locations_ = other.locations_; + bitField0_ = (bitField0_ & ~0x00000001); + locationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLocationsFieldBuilder() + : null; + } else { + locationsBuilder_.addAllMessages(other.locations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.location.ListLocationsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.location.ListLocationsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List locations_ = + java.util.Collections.emptyList(); + + private void ensureLocationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + locations_ = new java.util.ArrayList(locations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.location.Location, + com.google.cloud.location.Location.Builder, + com.google.cloud.location.LocationOrBuilder> + locationsBuilder_; + + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public java.util.List getLocationsList() { + if (locationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(locations_); + } else { + return locationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public int getLocationsCount() { + if (locationsBuilder_ == null) { + return locations_.size(); + } else { + return locationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public com.google.cloud.location.Location getLocations(int index) { + if (locationsBuilder_ == null) { + return locations_.get(index); + } else { + return locationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder setLocations(int index, com.google.cloud.location.Location value) { + if (locationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationsIsMutable(); + locations_.set(index, value); + onChanged(); + } else { + locationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder setLocations( + int index, com.google.cloud.location.Location.Builder builderForValue) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + locations_.set(index, builderForValue.build()); + onChanged(); + } else { + locationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder addLocations(com.google.cloud.location.Location value) { + if (locationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationsIsMutable(); + locations_.add(value); + onChanged(); + } else { + locationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder addLocations(int index, com.google.cloud.location.Location value) { + if (locationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationsIsMutable(); + locations_.add(index, value); + onChanged(); + } else { + locationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder addLocations(com.google.cloud.location.Location.Builder builderForValue) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + locations_.add(builderForValue.build()); + onChanged(); + } else { + locationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder addLocations( + int index, com.google.cloud.location.Location.Builder builderForValue) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + locations_.add(index, builderForValue.build()); + onChanged(); + } else { + locationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder addAllLocations( + java.lang.Iterable values) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, locations_); + onChanged(); + } else { + locationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder clearLocations() { + if (locationsBuilder_ == null) { + locations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + locationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder removeLocations(int index) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + locations_.remove(index); + onChanged(); + } else { + locationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public com.google.cloud.location.Location.Builder getLocationsBuilder(int index) { + return getLocationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public com.google.cloud.location.LocationOrBuilder getLocationsOrBuilder(int index) { + if (locationsBuilder_ == null) { + return locations_.get(index); + } else { + return locationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public java.util.List + getLocationsOrBuilderList() { + if (locationsBuilder_ != null) { + return locationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(locations_); + } + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public com.google.cloud.location.Location.Builder addLocationsBuilder() { + return getLocationsFieldBuilder() + .addBuilder(com.google.cloud.location.Location.getDefaultInstance()); + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public com.google.cloud.location.Location.Builder addLocationsBuilder(int index) { + return getLocationsFieldBuilder() + .addBuilder(index, com.google.cloud.location.Location.getDefaultInstance()); + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public java.util.List getLocationsBuilderList() { + return getLocationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.location.Location, + com.google.cloud.location.Location.Builder, + com.google.cloud.location.LocationOrBuilder> + getLocationsFieldBuilder() { + if (locationsBuilder_ == null) { + locationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.location.Location, + com.google.cloud.location.Location.Builder, + com.google.cloud.location.LocationOrBuilder>( + locations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + locations_ = null; + } + return locationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + 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.location.ListLocationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.location.ListLocationsResponse) + private static final com.google.cloud.location.ListLocationsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.location.ListLocationsResponse(); + } + + public static com.google.cloud.location.ListLocationsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLocationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListLocationsResponse(input, extensionRegistry); + } + }; + + 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.location.ListLocationsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/ListLocationsResponseOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/ListLocationsResponseOrBuilder.java new file mode 100644 index 00000000..704771cc --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/ListLocationsResponseOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +public interface ListLocationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.location.ListLocationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + java.util.List getLocationsList(); + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + com.google.cloud.location.Location getLocations(int index); + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + int getLocationsCount(); + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + java.util.List getLocationsOrBuilderList(); + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + com.google.cloud.location.LocationOrBuilder getLocationsOrBuilder(int index); + + /** + * + * + *
+   * The standard List next-page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The standard List next-page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/Location.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/Location.java new file mode 100644 index 00000000..7b7bfc86 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/Location.java @@ -0,0 +1,1615 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +/** + * + * + *
+ * A resource that represents Google Cloud Platform location.
+ * 
+ * + * Protobuf type {@code google.cloud.location.Location} + */ +public final class Location extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.location.Location) + LocationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Location.newBuilder() to construct. + private Location(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Location() { + name_ = ""; + locationId_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Location(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Location( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 26: + { + com.google.protobuf.Any.Builder subBuilder = null; + if (metadata_ != null) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + locationId_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_Location_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.Location.class, + com.google.cloud.location.Location.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name for the location, which may vary between implementations.
+   * For example: `"projects/example-project/locations/us-east1"`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name for the location, which may vary between implementations.
+   * For example: `"projects/example-project/locations/us-east1"`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object locationId_; + /** + * + * + *
+   * The canonical id for this location. For example: `"us-east1"`.
+   * 
+ * + * string location_id = 4; + * + * @return The locationId. + */ + @java.lang.Override + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + 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(); + locationId_ = s; + return s; + } + } + /** + * + * + *
+   * The canonical id for this location. For example: `"us-east1"`.
+   * 
+ * + * string location_id = 4; + * + * @return The bytes for locationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * The friendly name for this location, typically a nearby city name.
+   * For example, "Tokyo".
+   * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The friendly name for this location, typically a nearby city name.
+   * For example, "Tokyo".
+   * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 2; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_Location_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int METADATA_FIELD_NUMBER = 3; + private com.google.protobuf.Any metadata_; + /** + * + * + *
+   * Service-specific metadata. For example the available capacity at the given
+   * location.
+   * 
+ * + * .google.protobuf.Any metadata = 3; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+   * Service-specific metadata. For example the available capacity at the given
+   * location.
+   * 
+ * + * .google.protobuf.Any metadata = 3; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.Any getMetadata() { + return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; + } + /** + * + * + *
+   * Service-specific metadata. For example the available capacity at the given
+   * location.
+   * 
+ * + * .google.protobuf.Any metadata = 3; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 2); + if (metadata_ != null) { + output.writeMessage(3, getMetadata()); + } + if (!getLocationIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, locationId_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, labels__); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMetadata()); + } + if (!getLocationIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, locationId_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_); + } + size += unknownFields.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.location.Location)) { + return super.equals(obj); + } + com.google.cloud.location.Location other = (com.google.cloud.location.Location) obj; + + if (!getName().equals(other.getName())) return false; + if (!getLocationId().equals(other.getLocationId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + LOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getLocationId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.location.Location parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.Location 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.location.Location parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.Location 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.location.Location parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.Location parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.location.Location parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.Location 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.location.Location parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.location.Location 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.location.Location parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.Location 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.location.Location 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; + } + /** + * + * + *
+   * A resource that represents Google Cloud Platform location.
+   * 
+ * + * Protobuf type {@code google.cloud.location.Location} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.location.Location) + com.google.cloud.location.LocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_Location_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.Location.class, + com.google.cloud.location.Location.Builder.class); + } + + // Construct using com.google.cloud.location.Location.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + locationId_ = ""; + + displayName_ = ""; + + internalGetMutableLabels().clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_Location_descriptor; + } + + @java.lang.Override + public com.google.cloud.location.Location getDefaultInstanceForType() { + return com.google.cloud.location.Location.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.location.Location build() { + com.google.cloud.location.Location result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.location.Location buildPartial() { + com.google.cloud.location.Location result = new com.google.cloud.location.Location(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.locationId_ = locationId_; + result.displayName_ = displayName_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.location.Location) { + return mergeFrom((com.google.cloud.location.Location) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.location.Location other) { + if (other == com.google.cloud.location.Location.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getLocationId().isEmpty()) { + locationId_ = other.locationId_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.location.Location parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.location.Location) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name for the location, which may vary between implementations.
+     * For example: `"projects/example-project/locations/us-east1"`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name for the location, which may vary between implementations.
+     * For example: `"projects/example-project/locations/us-east1"`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name for the location, which may vary between implementations.
+     * For example: `"projects/example-project/locations/us-east1"`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for the location, which may vary between implementations.
+     * For example: `"projects/example-project/locations/us-east1"`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for the location, which may vary between implementations.
+     * For example: `"projects/example-project/locations/us-east1"`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object locationId_ = ""; + /** + * + * + *
+     * The canonical id for this location. For example: `"us-east1"`.
+     * 
+ * + * string location_id = 4; + * + * @return The locationId. + */ + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The canonical id for this location. For example: `"us-east1"`.
+     * 
+ * + * string location_id = 4; + * + * @return The bytes for locationId. + */ + public com.google.protobuf.ByteString getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The canonical id for this location. For example: `"us-east1"`.
+     * 
+ * + * string location_id = 4; + * + * @param value The locationId to set. + * @return This builder for chaining. + */ + public Builder setLocationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + locationId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The canonical id for this location. For example: `"us-east1"`.
+     * 
+ * + * string location_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearLocationId() { + + locationId_ = getDefaultInstance().getLocationId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The canonical id for this location. For example: `"us-east1"`.
+     * 
+ * + * string location_id = 4; + * + * @param value The bytes for locationId to set. + * @return This builder for chaining. + */ + public Builder setLocationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + locationId_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The friendly name for this location, typically a nearby city name.
+     * For example, "Tokyo".
+     * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The friendly name for this location, typically a nearby city name.
+     * For example, "Tokyo".
+     * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The friendly name for this location, typically a nearby city name.
+     * For example, "Tokyo".
+     * 
+ * + * string display_name = 5; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The friendly name for this location, typically a nearby city name.
+     * For example, "Tokyo".
+     * 
+ * + * string display_name = 5; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The friendly name for this location, typically a nearby city name.
+     * For example, "Tokyo".
+     * 
+ * + * string display_name = 5; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.Any metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + metadataBuilder_; + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + * + * @return The metadata. + */ + public com.google.protobuf.Any getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + public Builder setMetadata(com.google.protobuf.Any value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + public Builder setMetadata(com.google.protobuf.Any.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + public Builder mergeMetadata(com.google.protobuf.Any value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = com.google.protobuf.Any.newBuilder(metadata_).mergeFrom(value).buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + public com.google.protobuf.Any.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; + } + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>(getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @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.location.Location) + } + + // @@protoc_insertion_point(class_scope:google.cloud.location.Location) + private static final com.google.cloud.location.Location DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.location.Location(); + } + + public static com.google.cloud.location.Location getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Location parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Location(input, extensionRegistry); + } + }; + + 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.location.Location getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/LocationOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/LocationOrBuilder.java new file mode 100644 index 00000000..98ab25de --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/LocationOrBuilder.java @@ -0,0 +1,201 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +public interface LocationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.location.Location) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name for the location, which may vary between implementations.
+   * For example: `"projects/example-project/locations/us-east1"`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name for the location, which may vary between implementations.
+   * For example: `"projects/example-project/locations/us-east1"`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The canonical id for this location. For example: `"us-east1"`.
+   * 
+ * + * string location_id = 4; + * + * @return The locationId. + */ + java.lang.String getLocationId(); + /** + * + * + *
+   * The canonical id for this location. For example: `"us-east1"`.
+   * 
+ * + * string location_id = 4; + * + * @return The bytes for locationId. + */ + com.google.protobuf.ByteString getLocationIdBytes(); + + /** + * + * + *
+   * The friendly name for this location, typically a nearby city name.
+   * For example, "Tokyo".
+   * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The friendly name for this location, typically a nearby city name.
+   * For example, "Tokyo".
+   * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + int getLabelsCount(); + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Service-specific metadata. For example the available capacity at the given
+   * location.
+   * 
+ * + * .google.protobuf.Any metadata = 3; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+   * Service-specific metadata. For example the available capacity at the given
+   * location.
+   * 
+ * + * .google.protobuf.Any metadata = 3; + * + * @return The metadata. + */ + com.google.protobuf.Any getMetadata(); + /** + * + * + *
+   * Service-specific metadata. For example the available capacity at the given
+   * location.
+   * 
+ * + * .google.protobuf.Any metadata = 3; + */ + com.google.protobuf.AnyOrBuilder getMetadataOrBuilder(); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/LocationsProto.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/LocationsProto.java new file mode 100644 index 00000000..d2b6da30 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/location/LocationsProto.java @@ -0,0 +1,150 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +public final class LocationsProto { + private LocationsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_location_ListLocationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_location_ListLocationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_location_ListLocationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_location_ListLocationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_location_GetLocationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_location_GetLocationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_location_Location_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_location_Location_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_location_Location_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_location_Location_LabelsEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n%google/cloud/location/locations.proto\022" + + "\025google.cloud.location\032\034google/api/annot" + + "ations.proto\032\031google/protobuf/any.proto\032" + + "\027google/api/client.proto\"[\n\024ListLocation" + + "sRequest\022\014\n\004name\030\001 \001(\t\022\016\n\006filter\030\002 \001(\t\022\021" + + "\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"d\n" + + "\025ListLocationsResponse\0222\n\tlocations\030\001 \003(" + + "\0132\037.google.cloud.location.Location\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\"\"\n\022GetLocationReques" + + "t\022\014\n\004name\030\001 \001(\t\"\327\001\n\010Location\022\014\n\004name\030\001 \001" + + "(\t\022\023\n\013location_id\030\004 \001(\t\022\024\n\014display_name\030" + + "\005 \001(\t\022;\n\006labels\030\002 \003(\0132+.google.cloud.loc" + + "ation.Location.LabelsEntry\022&\n\010metadata\030\003" + + " \001(\0132\024.google.protobuf.Any\032-\n\013LabelsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\0012\244\003\n\tLo" + + "cations\022\253\001\n\rListLocations\022+.google.cloud" + + ".location.ListLocationsRequest\032,.google." + + "cloud.location.ListLocationsResponse\"?\202\323" + + "\344\223\0029\022\024/v1/{name=locations}Z!\022\037/v1/{name=" + + "projects/*}/locations\022\236\001\n\013GetLocation\022)." + + "google.cloud.location.GetLocationRequest" + + "\032\037.google.cloud.location.Location\"C\202\323\344\223\002" + + "=\022\026/v1/{name=locations/*}Z#\022!/v1/{name=p" + + "rojects/*/locations/*}\032H\312A\024cloud.googlea" + + "pis.com\322A.https://www.googleapis.com/aut" + + "h/cloud-platformBo\n\031com.google.cloud.loc" + + "ationB\016LocationsProtoP\001Z=google.golang.o" + + "rg/genproto/googleapis/cloud/location;lo" + + "cation\370\001\001b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_cloud_location_ListLocationsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_location_ListLocationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_location_ListLocationsRequest_descriptor, + new java.lang.String[] { + "Name", "Filter", "PageSize", "PageToken", + }); + internal_static_google_cloud_location_ListLocationsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_location_ListLocationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_location_ListLocationsResponse_descriptor, + new java.lang.String[] { + "Locations", "NextPageToken", + }); + internal_static_google_cloud_location_GetLocationRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_location_GetLocationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_location_GetLocationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_location_Location_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_location_Location_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_location_Location_descriptor, + new java.lang.String[] { + "Name", "LocationId", "DisplayName", "Labels", "Metadata", + }); + internal_static_google_cloud_location_Location_LabelsEntry_descriptor = + internal_static_google_cloud_location_Location_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_location_Location_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_location_Location_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchDocumentInputConfig.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchDocumentInputConfig.java new file mode 100644 index 00000000..652d1a1d --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchDocumentInputConfig.java @@ -0,0 +1,1027 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +/** + * + * + *
+ * Input configuration for BatchTranslateDocument request.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3.BatchDocumentInputConfig} + */ +public final class BatchDocumentInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3.BatchDocumentInputConfig) + BatchDocumentInputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchDocumentInputConfig.newBuilder() to construct. + private BatchDocumentInputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchDocumentInputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchDocumentInputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchDocumentInputConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.translate.v3.GcsSource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = ((com.google.cloud.translate.v3.GcsSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.translate.v3.GcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.translate.v3.GcsSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchDocumentInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchDocumentInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.BatchDocumentInputConfig.class, + com.google.cloud.translate.v3.BatchDocumentInputConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_SOURCE(1), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return GCS_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * Google Cloud Storage location for the source input.
+   * This can be a single file (for example,
+   * `gs://translation-test/input.docx`) or a wildcard (for example,
+   * `gs://translation-test/*`).
+   * File mime type is determined based on extension. Supported mime type
+   * includes:
+   * - `pdf`, application/pdf
+   * - `docx`,
+   * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - `pptx`,
+   * application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - `xlsx`,
+   * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+   * The max file size to support for `.pdf` is 1GB and the max page limit is
+   * 1000 pages.
+   * The max file size to support for all input documents is 1GB.
+   * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * Google Cloud Storage location for the source input.
+   * This can be a single file (for example,
+   * `gs://translation-test/input.docx`) or a wildcard (for example,
+   * `gs://translation-test/*`).
+   * File mime type is determined based on extension. Supported mime type
+   * includes:
+   * - `pdf`, application/pdf
+   * - `docx`,
+   * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - `pptx`,
+   * application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - `xlsx`,
+   * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+   * The max file size to support for `.pdf` is 1GB and the max page limit is
+   * 1000 pages.
+   * The max file size to support for all input documents is 1GB.
+   * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsSource getGcsSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.translate.v3.GcsSource) source_; + } + return com.google.cloud.translate.v3.GcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * Google Cloud Storage location for the source input.
+   * This can be a single file (for example,
+   * `gs://translation-test/input.docx`) or a wildcard (for example,
+   * `gs://translation-test/*`).
+   * File mime type is determined based on extension. Supported mime type
+   * includes:
+   * - `pdf`, application/pdf
+   * - `docx`,
+   * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - `pptx`,
+   * application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - `xlsx`,
+   * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+   * The max file size to support for `.pdf` is 1GB and the max page limit is
+   * 1000 pages.
+   * The max file size to support for all input documents is 1GB.
+   * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.translate.v3.GcsSource) source_; + } + return com.google.cloud.translate.v3.GcsSource.getDefaultInstance(); + } + + 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 (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.translate.v3.GcsSource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.translate.v3.GcsSource) source_); + } + size += unknownFields.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.v3.BatchDocumentInputConfig)) { + return super.equals(obj); + } + com.google.cloud.translate.v3.BatchDocumentInputConfig other = + (com.google.cloud.translate.v3.BatchDocumentInputConfig) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getGcsSource().equals(other.getGcsSource())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.translate.v3.BatchDocumentInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.BatchDocumentInputConfig 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.v3.BatchDocumentInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.BatchDocumentInputConfig 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.v3.BatchDocumentInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.BatchDocumentInputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.translate.v3.BatchDocumentInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.BatchDocumentInputConfig 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.v3.BatchDocumentInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.BatchDocumentInputConfig 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.v3.BatchDocumentInputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.BatchDocumentInputConfig 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.v3.BatchDocumentInputConfig 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; + } + /** + * + * + *
+   * Input configuration for BatchTranslateDocument request.
+   * 
+ * + * Protobuf type {@code google.cloud.translation.v3.BatchDocumentInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3.BatchDocumentInputConfig) + com.google.cloud.translate.v3.BatchDocumentInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchDocumentInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchDocumentInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.BatchDocumentInputConfig.class, + com.google.cloud.translate.v3.BatchDocumentInputConfig.Builder.class); + } + + // Construct using com.google.cloud.translate.v3.BatchDocumentInputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchDocumentInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchDocumentInputConfig getDefaultInstanceForType() { + return com.google.cloud.translate.v3.BatchDocumentInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchDocumentInputConfig build() { + com.google.cloud.translate.v3.BatchDocumentInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchDocumentInputConfig buildPartial() { + com.google.cloud.translate.v3.BatchDocumentInputConfig result = + new com.google.cloud.translate.v3.BatchDocumentInputConfig(this); + if (sourceCase_ == 1) { + if (gcsSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = gcsSourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + @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.v3.BatchDocumentInputConfig) { + return mergeFrom((com.google.cloud.translate.v3.BatchDocumentInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3.BatchDocumentInputConfig other) { + if (other == com.google.cloud.translate.v3.BatchDocumentInputConfig.getDefaultInstance()) + return this; + switch (other.getSourceCase()) { + case GCS_SOURCE: + { + mergeGcsSource(other.getGcsSource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.translate.v3.BatchDocumentInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3.BatchDocumentInputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.GcsSource, + com.google.cloud.translate.v3.GcsSource.Builder, + com.google.cloud.translate.v3.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Google Cloud Storage location for the source input.
+     * This can be a single file (for example,
+     * `gs://translation-test/input.docx`) or a wildcard (for example,
+     * `gs://translation-test/*`).
+     * File mime type is determined based on extension. Supported mime type
+     * includes:
+     * - `pdf`, application/pdf
+     * - `docx`,
+     * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - `pptx`,
+     * application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - `xlsx`,
+     * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size to support for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size to support for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * Google Cloud Storage location for the source input.
+     * This can be a single file (for example,
+     * `gs://translation-test/input.docx`) or a wildcard (for example,
+     * `gs://translation-test/*`).
+     * File mime type is determined based on extension. Supported mime type
+     * includes:
+     * - `pdf`, application/pdf
+     * - `docx`,
+     * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - `pptx`,
+     * application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - `xlsx`,
+     * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size to support for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size to support for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.translate.v3.GcsSource) source_; + } + return com.google.cloud.translate.v3.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.translate.v3.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage location for the source input.
+     * This can be a single file (for example,
+     * `gs://translation-test/input.docx`) or a wildcard (for example,
+     * `gs://translation-test/*`).
+     * File mime type is determined based on extension. Supported mime type
+     * includes:
+     * - `pdf`, application/pdf
+     * - `docx`,
+     * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - `pptx`,
+     * application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - `xlsx`,
+     * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size to support for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size to support for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + */ + public Builder setGcsSource(com.google.cloud.translate.v3.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the source input.
+     * This can be a single file (for example,
+     * `gs://translation-test/input.docx`) or a wildcard (for example,
+     * `gs://translation-test/*`).
+     * File mime type is determined based on extension. Supported mime type
+     * includes:
+     * - `pdf`, application/pdf
+     * - `docx`,
+     * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - `pptx`,
+     * application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - `xlsx`,
+     * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size to support for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size to support for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + */ + public Builder setGcsSource(com.google.cloud.translate.v3.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the source input.
+     * This can be a single file (for example,
+     * `gs://translation-test/input.docx`) or a wildcard (for example,
+     * `gs://translation-test/*`).
+     * File mime type is determined based on extension. Supported mime type
+     * includes:
+     * - `pdf`, application/pdf
+     * - `docx`,
+     * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - `pptx`,
+     * application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - `xlsx`,
+     * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size to support for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size to support for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + */ + public Builder mergeGcsSource(com.google.cloud.translate.v3.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ != com.google.cloud.translate.v3.GcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.translate.v3.GcsSource.newBuilder( + (com.google.cloud.translate.v3.GcsSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + gcsSourceBuilder_.mergeFrom(value); + } + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the source input.
+     * This can be a single file (for example,
+     * `gs://translation-test/input.docx`) or a wildcard (for example,
+     * `gs://translation-test/*`).
+     * File mime type is determined based on extension. Supported mime type
+     * includes:
+     * - `pdf`, application/pdf
+     * - `docx`,
+     * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - `pptx`,
+     * application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - `xlsx`,
+     * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size to support for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size to support for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + gcsSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Google Cloud Storage location for the source input.
+     * This can be a single file (for example,
+     * `gs://translation-test/input.docx`) or a wildcard (for example,
+     * `gs://translation-test/*`).
+     * File mime type is determined based on extension. Supported mime type
+     * includes:
+     * - `pdf`, application/pdf
+     * - `docx`,
+     * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - `pptx`,
+     * application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - `xlsx`,
+     * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size to support for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size to support for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + */ + public com.google.cloud.translate.v3.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Google Cloud Storage location for the source input.
+     * This can be a single file (for example,
+     * `gs://translation-test/input.docx`) or a wildcard (for example,
+     * `gs://translation-test/*`).
+     * File mime type is determined based on extension. Supported mime type
+     * includes:
+     * - `pdf`, application/pdf
+     * - `docx`,
+     * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - `pptx`,
+     * application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - `xlsx`,
+     * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size to support for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size to support for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 1) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.translate.v3.GcsSource) source_; + } + return com.google.cloud.translate.v3.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage location for the source input.
+     * This can be a single file (for example,
+     * `gs://translation-test/input.docx`) or a wildcard (for example,
+     * `gs://translation-test/*`).
+     * File mime type is determined based on extension. Supported mime type
+     * includes:
+     * - `pdf`, application/pdf
+     * - `docx`,
+     * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - `pptx`,
+     * application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - `xlsx`,
+     * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size to support for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size to support for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.GcsSource, + com.google.cloud.translate.v3.GcsSource.Builder, + com.google.cloud.translate.v3.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.translate.v3.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.GcsSource, + com.google.cloud.translate.v3.GcsSource.Builder, + com.google.cloud.translate.v3.GcsSourceOrBuilder>( + (com.google.cloud.translate.v3.GcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return gcsSourceBuilder_; + } + + @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.v3.BatchDocumentInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3.BatchDocumentInputConfig) + private static final com.google.cloud.translate.v3.BatchDocumentInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3.BatchDocumentInputConfig(); + } + + public static com.google.cloud.translate.v3.BatchDocumentInputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchDocumentInputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchDocumentInputConfig(input, extensionRegistry); + } + }; + + 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.v3.BatchDocumentInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchDocumentInputConfigOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchDocumentInputConfigOrBuilder.java new file mode 100644 index 00000000..806139bc --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchDocumentInputConfigOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +public interface BatchDocumentInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3.BatchDocumentInputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Google Cloud Storage location for the source input.
+   * This can be a single file (for example,
+   * `gs://translation-test/input.docx`) or a wildcard (for example,
+   * `gs://translation-test/*`).
+   * File mime type is determined based on extension. Supported mime type
+   * includes:
+   * - `pdf`, application/pdf
+   * - `docx`,
+   * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - `pptx`,
+   * application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - `xlsx`,
+   * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+   * The max file size to support for `.pdf` is 1GB and the max page limit is
+   * 1000 pages.
+   * The max file size to support for all input documents is 1GB.
+   * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * Google Cloud Storage location for the source input.
+   * This can be a single file (for example,
+   * `gs://translation-test/input.docx`) or a wildcard (for example,
+   * `gs://translation-test/*`).
+   * File mime type is determined based on extension. Supported mime type
+   * includes:
+   * - `pdf`, application/pdf
+   * - `docx`,
+   * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - `pptx`,
+   * application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - `xlsx`,
+   * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+   * The max file size to support for `.pdf` is 1GB and the max page limit is
+   * 1000 pages.
+   * The max file size to support for all input documents is 1GB.
+   * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + * + * @return The gcsSource. + */ + com.google.cloud.translate.v3.GcsSource getGcsSource(); + /** + * + * + *
+   * Google Cloud Storage location for the source input.
+   * This can be a single file (for example,
+   * `gs://translation-test/input.docx`) or a wildcard (for example,
+   * `gs://translation-test/*`).
+   * File mime type is determined based on extension. Supported mime type
+   * includes:
+   * - `pdf`, application/pdf
+   * - `docx`,
+   * application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - `pptx`,
+   * application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - `xlsx`,
+   * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB.
+   * The max file size to support for `.pdf` is 1GB and the max page limit is
+   * 1000 pages.
+   * The max file size to support for all input documents is 1GB.
+   * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 1; + */ + com.google.cloud.translate.v3.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + public com.google.cloud.translate.v3.BatchDocumentInputConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchDocumentOutputConfig.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchDocumentOutputConfig.java new file mode 100644 index 00000000..b96860b3 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchDocumentOutputConfig.java @@ -0,0 +1,1281 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +/** + * + * + *
+ * Output configuration for BatchTranslateDocument request.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3.BatchDocumentOutputConfig} + */ +public final class BatchDocumentOutputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3.BatchDocumentOutputConfig) + BatchDocumentOutputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchDocumentOutputConfig.newBuilder() to construct. + private BatchDocumentOutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchDocumentOutputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchDocumentOutputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchDocumentOutputConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.translate.v3.GcsDestination.Builder subBuilder = null; + if (destinationCase_ == 1) { + subBuilder = + ((com.google.cloud.translate.v3.GcsDestination) destination_).toBuilder(); + } + destination_ = + input.readMessage( + com.google.cloud.translate.v3.GcsDestination.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.translate.v3.GcsDestination) destination_); + destination_ = subBuilder.buildPartial(); + } + destinationCase_ = 1; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchDocumentOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchDocumentOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.BatchDocumentOutputConfig.class, + com.google.cloud.translate.v3.BatchDocumentOutputConfig.Builder.class); + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_DESTINATION(1), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_DESTINATION; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; + /** + * + * + *
+   * Google Cloud Storage destination for output content.
+   * For every single input document (for example, gs://a/b/c.[extension]), we
+   * generate at most 2 * n output files. (n is the # of target_language_codes
+   * in the BatchTranslateDocumentRequest).
+   * While the input documents are being processed, we write/update an index
+   * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+   * gs://translation_output/index.csv) The index file is generated/updated as
+   * new files are being translated. The format is:
+   * input_document,target_language_code,translation_output,error_output,
+   * glossary_translation_output,glossary_error_output
+   * `input_document` is one file we matched using gcs_source.input_uri.
+   * `target_language_code` is provided in the request.
+   * `translation_output` contains the translations. (details provided below)
+   * `error_output` contains the error message during processing of the file.
+   * Both translations_file and errors_file could be empty strings if we have
+   * no content to output.
+   * `glossary_translation_output` and `glossary_error_output` are the
+   * translated output/error when we apply glossaries. They could also be
+   * empty if we have no content to output.
+   * Once a row is present in index.csv, the input/output matching never
+   * changes. Callers should also expect all the content in input_file are
+   * processed and ready to be consumed (that is, no partial output file is
+   * written).
+   * Since index.csv will be keeping updated during the process, please make
+   * sure there is no custom retention policy applied on the output bucket
+   * that may avoid file updating.
+   * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+   * The naming format of translation output files follows (for target
+   * language code [trg]): `translation_output`:
+   * gs://translation_output/a_b_c_[trg]_translation.[extension]
+   * `glossary_translation_output`:
+   * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+   * output document will maintain the same file format as the input document.
+   * The naming format of error output files follows (for target language code
+   * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+   * `glossary_error_output`:
+   * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+   * output is a txt file containing error details.
+   * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * Google Cloud Storage destination for output content.
+   * For every single input document (for example, gs://a/b/c.[extension]), we
+   * generate at most 2 * n output files. (n is the # of target_language_codes
+   * in the BatchTranslateDocumentRequest).
+   * While the input documents are being processed, we write/update an index
+   * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+   * gs://translation_output/index.csv) The index file is generated/updated as
+   * new files are being translated. The format is:
+   * input_document,target_language_code,translation_output,error_output,
+   * glossary_translation_output,glossary_error_output
+   * `input_document` is one file we matched using gcs_source.input_uri.
+   * `target_language_code` is provided in the request.
+   * `translation_output` contains the translations. (details provided below)
+   * `error_output` contains the error message during processing of the file.
+   * Both translations_file and errors_file could be empty strings if we have
+   * no content to output.
+   * `glossary_translation_output` and `glossary_error_output` are the
+   * translated output/error when we apply glossaries. They could also be
+   * empty if we have no content to output.
+   * Once a row is present in index.csv, the input/output matching never
+   * changes. Callers should also expect all the content in input_file are
+   * processed and ready to be consumed (that is, no partial output file is
+   * written).
+   * Since index.csv will be keeping updated during the process, please make
+   * sure there is no custom retention policy applied on the output bucket
+   * that may avoid file updating.
+   * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+   * The naming format of translation output files follows (for target
+   * language code [trg]): `translation_output`:
+   * gs://translation_output/a_b_c_[trg]_translation.[extension]
+   * `glossary_translation_output`:
+   * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+   * output document will maintain the same file format as the input document.
+   * The naming format of error output files follows (for target language code
+   * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+   * `glossary_error_output`:
+   * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+   * output is a txt file containing error details.
+   * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsDestination getGcsDestination() { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3.GcsDestination) destination_; + } + return com.google.cloud.translate.v3.GcsDestination.getDefaultInstance(); + } + /** + * + * + *
+   * Google Cloud Storage destination for output content.
+   * For every single input document (for example, gs://a/b/c.[extension]), we
+   * generate at most 2 * n output files. (n is the # of target_language_codes
+   * in the BatchTranslateDocumentRequest).
+   * While the input documents are being processed, we write/update an index
+   * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+   * gs://translation_output/index.csv) The index file is generated/updated as
+   * new files are being translated. The format is:
+   * input_document,target_language_code,translation_output,error_output,
+   * glossary_translation_output,glossary_error_output
+   * `input_document` is one file we matched using gcs_source.input_uri.
+   * `target_language_code` is provided in the request.
+   * `translation_output` contains the translations. (details provided below)
+   * `error_output` contains the error message during processing of the file.
+   * Both translations_file and errors_file could be empty strings if we have
+   * no content to output.
+   * `glossary_translation_output` and `glossary_error_output` are the
+   * translated output/error when we apply glossaries. They could also be
+   * empty if we have no content to output.
+   * Once a row is present in index.csv, the input/output matching never
+   * changes. Callers should also expect all the content in input_file are
+   * processed and ready to be consumed (that is, no partial output file is
+   * written).
+   * Since index.csv will be keeping updated during the process, please make
+   * sure there is no custom retention policy applied on the output bucket
+   * that may avoid file updating.
+   * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+   * The naming format of translation output files follows (for target
+   * language code [trg]): `translation_output`:
+   * gs://translation_output/a_b_c_[trg]_translation.[extension]
+   * `glossary_translation_output`:
+   * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+   * output document will maintain the same file format as the input document.
+   * The naming format of error output files follows (for target language code
+   * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+   * `glossary_error_output`:
+   * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+   * output is a txt file containing error details.
+   * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3.GcsDestination) destination_; + } + return com.google.cloud.translate.v3.GcsDestination.getDefaultInstance(); + } + + 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 (destinationCase_ == 1) { + output.writeMessage(1, (com.google.cloud.translate.v3.GcsDestination) destination_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.translate.v3.GcsDestination) destination_); + } + size += unknownFields.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.v3.BatchDocumentOutputConfig)) { + return super.equals(obj); + } + com.google.cloud.translate.v3.BatchDocumentOutputConfig other = + (com.google.cloud.translate.v3.BatchDocumentOutputConfig) obj; + + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsDestination().equals(other.getGcsDestination())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getGcsDestination().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.translate.v3.BatchDocumentOutputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.BatchDocumentOutputConfig 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.v3.BatchDocumentOutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.BatchDocumentOutputConfig 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.v3.BatchDocumentOutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.BatchDocumentOutputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.translate.v3.BatchDocumentOutputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.BatchDocumentOutputConfig 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.v3.BatchDocumentOutputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.BatchDocumentOutputConfig 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.v3.BatchDocumentOutputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.BatchDocumentOutputConfig 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.v3.BatchDocumentOutputConfig 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; + } + /** + * + * + *
+   * Output configuration for BatchTranslateDocument request.
+   * 
+ * + * Protobuf type {@code google.cloud.translation.v3.BatchDocumentOutputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3.BatchDocumentOutputConfig) + com.google.cloud.translate.v3.BatchDocumentOutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchDocumentOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchDocumentOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.BatchDocumentOutputConfig.class, + com.google.cloud.translate.v3.BatchDocumentOutputConfig.Builder.class); + } + + // Construct using com.google.cloud.translate.v3.BatchDocumentOutputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchDocumentOutputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchDocumentOutputConfig getDefaultInstanceForType() { + return com.google.cloud.translate.v3.BatchDocumentOutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchDocumentOutputConfig build() { + com.google.cloud.translate.v3.BatchDocumentOutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchDocumentOutputConfig buildPartial() { + com.google.cloud.translate.v3.BatchDocumentOutputConfig result = + new com.google.cloud.translate.v3.BatchDocumentOutputConfig(this); + if (destinationCase_ == 1) { + if (gcsDestinationBuilder_ == null) { + result.destination_ = destination_; + } else { + result.destination_ = gcsDestinationBuilder_.build(); + } + } + result.destinationCase_ = destinationCase_; + onBuilt(); + return result; + } + + @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.v3.BatchDocumentOutputConfig) { + return mergeFrom((com.google.cloud.translate.v3.BatchDocumentOutputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3.BatchDocumentOutputConfig other) { + if (other == com.google.cloud.translate.v3.BatchDocumentOutputConfig.getDefaultInstance()) + return this; + switch (other.getDestinationCase()) { + case GCS_DESTINATION: + { + mergeGcsDestination(other.getGcsDestination()); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.translate.v3.BatchDocumentOutputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3.BatchDocumentOutputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.GcsDestination, + com.google.cloud.translate.v3.GcsDestination.Builder, + com.google.cloud.translate.v3.GcsDestinationOrBuilder> + gcsDestinationBuilder_; + /** + * + * + *
+     * Google Cloud Storage destination for output content.
+     * For every single input document (for example, gs://a/b/c.[extension]), we
+     * generate at most 2 * n output files. (n is the # of target_language_codes
+     * in the BatchTranslateDocumentRequest).
+     * While the input documents are being processed, we write/update an index
+     * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+     * gs://translation_output/index.csv) The index file is generated/updated as
+     * new files are being translated. The format is:
+     * input_document,target_language_code,translation_output,error_output,
+     * glossary_translation_output,glossary_error_output
+     * `input_document` is one file we matched using gcs_source.input_uri.
+     * `target_language_code` is provided in the request.
+     * `translation_output` contains the translations. (details provided below)
+     * `error_output` contains the error message during processing of the file.
+     * Both translations_file and errors_file could be empty strings if we have
+     * no content to output.
+     * `glossary_translation_output` and `glossary_error_output` are the
+     * translated output/error when we apply glossaries. They could also be
+     * empty if we have no content to output.
+     * Once a row is present in index.csv, the input/output matching never
+     * changes. Callers should also expect all the content in input_file are
+     * processed and ready to be consumed (that is, no partial output file is
+     * written).
+     * Since index.csv will be keeping updated during the process, please make
+     * sure there is no custom retention policy applied on the output bucket
+     * that may avoid file updating.
+     * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+     * The naming format of translation output files follows (for target
+     * language code [trg]): `translation_output`:
+     * gs://translation_output/a_b_c_[trg]_translation.[extension]
+     * `glossary_translation_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+     * output document will maintain the same file format as the input document.
+     * The naming format of error output files follows (for target language code
+     * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+     * `glossary_error_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+     * output is a txt file containing error details.
+     * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * Google Cloud Storage destination for output content.
+     * For every single input document (for example, gs://a/b/c.[extension]), we
+     * generate at most 2 * n output files. (n is the # of target_language_codes
+     * in the BatchTranslateDocumentRequest).
+     * While the input documents are being processed, we write/update an index
+     * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+     * gs://translation_output/index.csv) The index file is generated/updated as
+     * new files are being translated. The format is:
+     * input_document,target_language_code,translation_output,error_output,
+     * glossary_translation_output,glossary_error_output
+     * `input_document` is one file we matched using gcs_source.input_uri.
+     * `target_language_code` is provided in the request.
+     * `translation_output` contains the translations. (details provided below)
+     * `error_output` contains the error message during processing of the file.
+     * Both translations_file and errors_file could be empty strings if we have
+     * no content to output.
+     * `glossary_translation_output` and `glossary_error_output` are the
+     * translated output/error when we apply glossaries. They could also be
+     * empty if we have no content to output.
+     * Once a row is present in index.csv, the input/output matching never
+     * changes. Callers should also expect all the content in input_file are
+     * processed and ready to be consumed (that is, no partial output file is
+     * written).
+     * Since index.csv will be keeping updated during the process, please make
+     * sure there is no custom retention policy applied on the output bucket
+     * that may avoid file updating.
+     * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+     * The naming format of translation output files follows (for target
+     * language code [trg]): `translation_output`:
+     * gs://translation_output/a_b_c_[trg]_translation.[extension]
+     * `glossary_translation_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+     * output document will maintain the same file format as the input document.
+     * The naming format of error output files follows (for target language code
+     * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+     * `glossary_error_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+     * output is a txt file containing error details.
+     * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3.GcsDestination) destination_; + } + return com.google.cloud.translate.v3.GcsDestination.getDefaultInstance(); + } else { + if (destinationCase_ == 1) { + return gcsDestinationBuilder_.getMessage(); + } + return com.google.cloud.translate.v3.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage destination for output content.
+     * For every single input document (for example, gs://a/b/c.[extension]), we
+     * generate at most 2 * n output files. (n is the # of target_language_codes
+     * in the BatchTranslateDocumentRequest).
+     * While the input documents are being processed, we write/update an index
+     * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+     * gs://translation_output/index.csv) The index file is generated/updated as
+     * new files are being translated. The format is:
+     * input_document,target_language_code,translation_output,error_output,
+     * glossary_translation_output,glossary_error_output
+     * `input_document` is one file we matched using gcs_source.input_uri.
+     * `target_language_code` is provided in the request.
+     * `translation_output` contains the translations. (details provided below)
+     * `error_output` contains the error message during processing of the file.
+     * Both translations_file and errors_file could be empty strings if we have
+     * no content to output.
+     * `glossary_translation_output` and `glossary_error_output` are the
+     * translated output/error when we apply glossaries. They could also be
+     * empty if we have no content to output.
+     * Once a row is present in index.csv, the input/output matching never
+     * changes. Callers should also expect all the content in input_file are
+     * processed and ready to be consumed (that is, no partial output file is
+     * written).
+     * Since index.csv will be keeping updated during the process, please make
+     * sure there is no custom retention policy applied on the output bucket
+     * that may avoid file updating.
+     * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+     * The naming format of translation output files follows (for target
+     * language code [trg]): `translation_output`:
+     * gs://translation_output/a_b_c_[trg]_translation.[extension]
+     * `glossary_translation_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+     * output document will maintain the same file format as the input document.
+     * The naming format of error output files follows (for target language code
+     * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+     * `glossary_error_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+     * output is a txt file containing error details.
+     * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination(com.google.cloud.translate.v3.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Google Cloud Storage destination for output content.
+     * For every single input document (for example, gs://a/b/c.[extension]), we
+     * generate at most 2 * n output files. (n is the # of target_language_codes
+     * in the BatchTranslateDocumentRequest).
+     * While the input documents are being processed, we write/update an index
+     * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+     * gs://translation_output/index.csv) The index file is generated/updated as
+     * new files are being translated. The format is:
+     * input_document,target_language_code,translation_output,error_output,
+     * glossary_translation_output,glossary_error_output
+     * `input_document` is one file we matched using gcs_source.input_uri.
+     * `target_language_code` is provided in the request.
+     * `translation_output` contains the translations. (details provided below)
+     * `error_output` contains the error message during processing of the file.
+     * Both translations_file and errors_file could be empty strings if we have
+     * no content to output.
+     * `glossary_translation_output` and `glossary_error_output` are the
+     * translated output/error when we apply glossaries. They could also be
+     * empty if we have no content to output.
+     * Once a row is present in index.csv, the input/output matching never
+     * changes. Callers should also expect all the content in input_file are
+     * processed and ready to be consumed (that is, no partial output file is
+     * written).
+     * Since index.csv will be keeping updated during the process, please make
+     * sure there is no custom retention policy applied on the output bucket
+     * that may avoid file updating.
+     * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+     * The naming format of translation output files follows (for target
+     * language code [trg]): `translation_output`:
+     * gs://translation_output/a_b_c_[trg]_translation.[extension]
+     * `glossary_translation_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+     * output document will maintain the same file format as the input document.
+     * The naming format of error output files follows (for target language code
+     * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+     * `glossary_error_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+     * output is a txt file containing error details.
+     * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination( + com.google.cloud.translate.v3.GcsDestination.Builder builderForValue) { + if (gcsDestinationBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(builderForValue.build()); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Google Cloud Storage destination for output content.
+     * For every single input document (for example, gs://a/b/c.[extension]), we
+     * generate at most 2 * n output files. (n is the # of target_language_codes
+     * in the BatchTranslateDocumentRequest).
+     * While the input documents are being processed, we write/update an index
+     * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+     * gs://translation_output/index.csv) The index file is generated/updated as
+     * new files are being translated. The format is:
+     * input_document,target_language_code,translation_output,error_output,
+     * glossary_translation_output,glossary_error_output
+     * `input_document` is one file we matched using gcs_source.input_uri.
+     * `target_language_code` is provided in the request.
+     * `translation_output` contains the translations. (details provided below)
+     * `error_output` contains the error message during processing of the file.
+     * Both translations_file and errors_file could be empty strings if we have
+     * no content to output.
+     * `glossary_translation_output` and `glossary_error_output` are the
+     * translated output/error when we apply glossaries. They could also be
+     * empty if we have no content to output.
+     * Once a row is present in index.csv, the input/output matching never
+     * changes. Callers should also expect all the content in input_file are
+     * processed and ready to be consumed (that is, no partial output file is
+     * written).
+     * Since index.csv will be keeping updated during the process, please make
+     * sure there is no custom retention policy applied on the output bucket
+     * that may avoid file updating.
+     * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+     * The naming format of translation output files follows (for target
+     * language code [trg]): `translation_output`:
+     * gs://translation_output/a_b_c_[trg]_translation.[extension]
+     * `glossary_translation_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+     * output document will maintain the same file format as the input document.
+     * The naming format of error output files follows (for target language code
+     * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+     * `glossary_error_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+     * output is a txt file containing error details.
+     * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + */ + public Builder mergeGcsDestination(com.google.cloud.translate.v3.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1 + && destination_ != com.google.cloud.translate.v3.GcsDestination.getDefaultInstance()) { + destination_ = + com.google.cloud.translate.v3.GcsDestination.newBuilder( + (com.google.cloud.translate.v3.GcsDestination) destination_) + .mergeFrom(value) + .buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + if (destinationCase_ == 1) { + gcsDestinationBuilder_.mergeFrom(value); + } + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Google Cloud Storage destination for output content.
+     * For every single input document (for example, gs://a/b/c.[extension]), we
+     * generate at most 2 * n output files. (n is the # of target_language_codes
+     * in the BatchTranslateDocumentRequest).
+     * While the input documents are being processed, we write/update an index
+     * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+     * gs://translation_output/index.csv) The index file is generated/updated as
+     * new files are being translated. The format is:
+     * input_document,target_language_code,translation_output,error_output,
+     * glossary_translation_output,glossary_error_output
+     * `input_document` is one file we matched using gcs_source.input_uri.
+     * `target_language_code` is provided in the request.
+     * `translation_output` contains the translations. (details provided below)
+     * `error_output` contains the error message during processing of the file.
+     * Both translations_file and errors_file could be empty strings if we have
+     * no content to output.
+     * `glossary_translation_output` and `glossary_error_output` are the
+     * translated output/error when we apply glossaries. They could also be
+     * empty if we have no content to output.
+     * Once a row is present in index.csv, the input/output matching never
+     * changes. Callers should also expect all the content in input_file are
+     * processed and ready to be consumed (that is, no partial output file is
+     * written).
+     * Since index.csv will be keeping updated during the process, please make
+     * sure there is no custom retention policy applied on the output bucket
+     * that may avoid file updating.
+     * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+     * The naming format of translation output files follows (for target
+     * language code [trg]): `translation_output`:
+     * gs://translation_output/a_b_c_[trg]_translation.[extension]
+     * `glossary_translation_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+     * output document will maintain the same file format as the input document.
+     * The naming format of error output files follows (for target language code
+     * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+     * `glossary_error_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+     * output is a txt file containing error details.
+     * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + */ + public Builder clearGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + } else { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + } + gcsDestinationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Google Cloud Storage destination for output content.
+     * For every single input document (for example, gs://a/b/c.[extension]), we
+     * generate at most 2 * n output files. (n is the # of target_language_codes
+     * in the BatchTranslateDocumentRequest).
+     * While the input documents are being processed, we write/update an index
+     * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+     * gs://translation_output/index.csv) The index file is generated/updated as
+     * new files are being translated. The format is:
+     * input_document,target_language_code,translation_output,error_output,
+     * glossary_translation_output,glossary_error_output
+     * `input_document` is one file we matched using gcs_source.input_uri.
+     * `target_language_code` is provided in the request.
+     * `translation_output` contains the translations. (details provided below)
+     * `error_output` contains the error message during processing of the file.
+     * Both translations_file and errors_file could be empty strings if we have
+     * no content to output.
+     * `glossary_translation_output` and `glossary_error_output` are the
+     * translated output/error when we apply glossaries. They could also be
+     * empty if we have no content to output.
+     * Once a row is present in index.csv, the input/output matching never
+     * changes. Callers should also expect all the content in input_file are
+     * processed and ready to be consumed (that is, no partial output file is
+     * written).
+     * Since index.csv will be keeping updated during the process, please make
+     * sure there is no custom retention policy applied on the output bucket
+     * that may avoid file updating.
+     * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+     * The naming format of translation output files follows (for target
+     * language code [trg]): `translation_output`:
+     * gs://translation_output/a_b_c_[trg]_translation.[extension]
+     * `glossary_translation_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+     * output document will maintain the same file format as the input document.
+     * The naming format of error output files follows (for target language code
+     * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+     * `glossary_error_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+     * output is a txt file containing error details.
+     * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.translate.v3.GcsDestination.Builder getGcsDestinationBuilder() { + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Google Cloud Storage destination for output content.
+     * For every single input document (for example, gs://a/b/c.[extension]), we
+     * generate at most 2 * n output files. (n is the # of target_language_codes
+     * in the BatchTranslateDocumentRequest).
+     * While the input documents are being processed, we write/update an index
+     * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+     * gs://translation_output/index.csv) The index file is generated/updated as
+     * new files are being translated. The format is:
+     * input_document,target_language_code,translation_output,error_output,
+     * glossary_translation_output,glossary_error_output
+     * `input_document` is one file we matched using gcs_source.input_uri.
+     * `target_language_code` is provided in the request.
+     * `translation_output` contains the translations. (details provided below)
+     * `error_output` contains the error message during processing of the file.
+     * Both translations_file and errors_file could be empty strings if we have
+     * no content to output.
+     * `glossary_translation_output` and `glossary_error_output` are the
+     * translated output/error when we apply glossaries. They could also be
+     * empty if we have no content to output.
+     * Once a row is present in index.csv, the input/output matching never
+     * changes. Callers should also expect all the content in input_file are
+     * processed and ready to be consumed (that is, no partial output file is
+     * written).
+     * Since index.csv will be keeping updated during the process, please make
+     * sure there is no custom retention policy applied on the output bucket
+     * that may avoid file updating.
+     * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+     * The naming format of translation output files follows (for target
+     * language code [trg]): `translation_output`:
+     * gs://translation_output/a_b_c_[trg]_translation.[extension]
+     * `glossary_translation_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+     * output document will maintain the same file format as the input document.
+     * The naming format of error output files follows (for target language code
+     * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+     * `glossary_error_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+     * output is a txt file containing error details.
+     * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3.GcsDestination) destination_; + } + return com.google.cloud.translate.v3.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage destination for output content.
+     * For every single input document (for example, gs://a/b/c.[extension]), we
+     * generate at most 2 * n output files. (n is the # of target_language_codes
+     * in the BatchTranslateDocumentRequest).
+     * While the input documents are being processed, we write/update an index
+     * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+     * gs://translation_output/index.csv) The index file is generated/updated as
+     * new files are being translated. The format is:
+     * input_document,target_language_code,translation_output,error_output,
+     * glossary_translation_output,glossary_error_output
+     * `input_document` is one file we matched using gcs_source.input_uri.
+     * `target_language_code` is provided in the request.
+     * `translation_output` contains the translations. (details provided below)
+     * `error_output` contains the error message during processing of the file.
+     * Both translations_file and errors_file could be empty strings if we have
+     * no content to output.
+     * `glossary_translation_output` and `glossary_error_output` are the
+     * translated output/error when we apply glossaries. They could also be
+     * empty if we have no content to output.
+     * Once a row is present in index.csv, the input/output matching never
+     * changes. Callers should also expect all the content in input_file are
+     * processed and ready to be consumed (that is, no partial output file is
+     * written).
+     * Since index.csv will be keeping updated during the process, please make
+     * sure there is no custom retention policy applied on the output bucket
+     * that may avoid file updating.
+     * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+     * The naming format of translation output files follows (for target
+     * language code [trg]): `translation_output`:
+     * gs://translation_output/a_b_c_[trg]_translation.[extension]
+     * `glossary_translation_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+     * output document will maintain the same file format as the input document.
+     * The naming format of error output files follows (for target language code
+     * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+     * `glossary_error_output`:
+     * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+     * output is a txt file containing error details.
+     * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.GcsDestination, + com.google.cloud.translate.v3.GcsDestination.Builder, + com.google.cloud.translate.v3.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + if (!(destinationCase_ == 1)) { + destination_ = com.google.cloud.translate.v3.GcsDestination.getDefaultInstance(); + } + gcsDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.GcsDestination, + com.google.cloud.translate.v3.GcsDestination.Builder, + com.google.cloud.translate.v3.GcsDestinationOrBuilder>( + (com.google.cloud.translate.v3.GcsDestination) destination_, + getParentForChildren(), + isClean()); + destination_ = null; + } + destinationCase_ = 1; + onChanged(); + ; + return gcsDestinationBuilder_; + } + + @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.v3.BatchDocumentOutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3.BatchDocumentOutputConfig) + private static final com.google.cloud.translate.v3.BatchDocumentOutputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3.BatchDocumentOutputConfig(); + } + + public static com.google.cloud.translate.v3.BatchDocumentOutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchDocumentOutputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchDocumentOutputConfig(input, extensionRegistry); + } + }; + + 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.v3.BatchDocumentOutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchDocumentOutputConfigOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchDocumentOutputConfigOrBuilder.java new file mode 100644 index 00000000..5783dd39 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchDocumentOutputConfigOrBuilder.java @@ -0,0 +1,174 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +public interface BatchDocumentOutputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3.BatchDocumentOutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Google Cloud Storage destination for output content.
+   * For every single input document (for example, gs://a/b/c.[extension]), we
+   * generate at most 2 * n output files. (n is the # of target_language_codes
+   * in the BatchTranslateDocumentRequest).
+   * While the input documents are being processed, we write/update an index
+   * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+   * gs://translation_output/index.csv) The index file is generated/updated as
+   * new files are being translated. The format is:
+   * input_document,target_language_code,translation_output,error_output,
+   * glossary_translation_output,glossary_error_output
+   * `input_document` is one file we matched using gcs_source.input_uri.
+   * `target_language_code` is provided in the request.
+   * `translation_output` contains the translations. (details provided below)
+   * `error_output` contains the error message during processing of the file.
+   * Both translations_file and errors_file could be empty strings if we have
+   * no content to output.
+   * `glossary_translation_output` and `glossary_error_output` are the
+   * translated output/error when we apply glossaries. They could also be
+   * empty if we have no content to output.
+   * Once a row is present in index.csv, the input/output matching never
+   * changes. Callers should also expect all the content in input_file are
+   * processed and ready to be consumed (that is, no partial output file is
+   * written).
+   * Since index.csv will be keeping updated during the process, please make
+   * sure there is no custom retention policy applied on the output bucket
+   * that may avoid file updating.
+   * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+   * The naming format of translation output files follows (for target
+   * language code [trg]): `translation_output`:
+   * gs://translation_output/a_b_c_[trg]_translation.[extension]
+   * `glossary_translation_output`:
+   * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+   * output document will maintain the same file format as the input document.
+   * The naming format of error output files follows (for target language code
+   * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+   * `glossary_error_output`:
+   * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+   * output is a txt file containing error details.
+   * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + boolean hasGcsDestination(); + /** + * + * + *
+   * Google Cloud Storage destination for output content.
+   * For every single input document (for example, gs://a/b/c.[extension]), we
+   * generate at most 2 * n output files. (n is the # of target_language_codes
+   * in the BatchTranslateDocumentRequest).
+   * While the input documents are being processed, we write/update an index
+   * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+   * gs://translation_output/index.csv) The index file is generated/updated as
+   * new files are being translated. The format is:
+   * input_document,target_language_code,translation_output,error_output,
+   * glossary_translation_output,glossary_error_output
+   * `input_document` is one file we matched using gcs_source.input_uri.
+   * `target_language_code` is provided in the request.
+   * `translation_output` contains the translations. (details provided below)
+   * `error_output` contains the error message during processing of the file.
+   * Both translations_file and errors_file could be empty strings if we have
+   * no content to output.
+   * `glossary_translation_output` and `glossary_error_output` are the
+   * translated output/error when we apply glossaries. They could also be
+   * empty if we have no content to output.
+   * Once a row is present in index.csv, the input/output matching never
+   * changes. Callers should also expect all the content in input_file are
+   * processed and ready to be consumed (that is, no partial output file is
+   * written).
+   * Since index.csv will be keeping updated during the process, please make
+   * sure there is no custom retention policy applied on the output bucket
+   * that may avoid file updating.
+   * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+   * The naming format of translation output files follows (for target
+   * language code [trg]): `translation_output`:
+   * gs://translation_output/a_b_c_[trg]_translation.[extension]
+   * `glossary_translation_output`:
+   * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+   * output document will maintain the same file format as the input document.
+   * The naming format of error output files follows (for target language code
+   * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+   * `glossary_error_output`:
+   * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+   * output is a txt file containing error details.
+   * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + com.google.cloud.translate.v3.GcsDestination getGcsDestination(); + /** + * + * + *
+   * Google Cloud Storage destination for output content.
+   * For every single input document (for example, gs://a/b/c.[extension]), we
+   * generate at most 2 * n output files. (n is the # of target_language_codes
+   * in the BatchTranslateDocumentRequest).
+   * While the input documents are being processed, we write/update an index
+   * file `index.csv` under `gcs_destination.output_uri_prefix` (for example,
+   * gs://translation_output/index.csv) The index file is generated/updated as
+   * new files are being translated. The format is:
+   * input_document,target_language_code,translation_output,error_output,
+   * glossary_translation_output,glossary_error_output
+   * `input_document` is one file we matched using gcs_source.input_uri.
+   * `target_language_code` is provided in the request.
+   * `translation_output` contains the translations. (details provided below)
+   * `error_output` contains the error message during processing of the file.
+   * Both translations_file and errors_file could be empty strings if we have
+   * no content to output.
+   * `glossary_translation_output` and `glossary_error_output` are the
+   * translated output/error when we apply glossaries. They could also be
+   * empty if we have no content to output.
+   * Once a row is present in index.csv, the input/output matching never
+   * changes. Callers should also expect all the content in input_file are
+   * processed and ready to be consumed (that is, no partial output file is
+   * written).
+   * Since index.csv will be keeping updated during the process, please make
+   * sure there is no custom retention policy applied on the output bucket
+   * that may avoid file updating.
+   * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
+   * The naming format of translation output files follows (for target
+   * language code [trg]): `translation_output`:
+   * gs://translation_output/a_b_c_[trg]_translation.[extension]
+   * `glossary_translation_output`:
+   * gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The
+   * output document will maintain the same file format as the input document.
+   * The naming format of error output files follows (for target language code
+   * [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt
+   * `glossary_error_output`:
+   * gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error
+   * output is a txt file containing error details.
+   * 
+ * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; + */ + com.google.cloud.translate.v3.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); + + public com.google.cloud.translate.v3.BatchDocumentOutputConfig.DestinationCase + getDestinationCase(); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentMetadata.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentMetadata.java new file mode 100644 index 00000000..38517ed0 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentMetadata.java @@ -0,0 +1,1872 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +/** + * + * + *
+ * State metadata for the batch translation operation.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3.BatchTranslateDocumentMetadata} + */ +public final class BatchTranslateDocumentMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3.BatchTranslateDocumentMetadata) + BatchTranslateDocumentMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchTranslateDocumentMetadata.newBuilder() to construct. + private BatchTranslateDocumentMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchTranslateDocumentMetadata() { + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchTranslateDocumentMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchTranslateDocumentMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 16: + { + totalPages_ = input.readInt64(); + break; + } + case 24: + { + translatedPages_ = input.readInt64(); + break; + } + case 32: + { + failedPages_ = input.readInt64(); + break; + } + case 40: + { + totalBillablePages_ = input.readInt64(); + break; + } + case 48: + { + totalCharacters_ = input.readInt64(); + break; + } + case 56: + { + translatedCharacters_ = input.readInt64(); + break; + } + case 64: + { + failedCharacters_ = input.readInt64(); + break; + } + case 72: + { + totalBillableCharacters_ = input.readInt64(); + break; + } + case 82: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (submitTime_ != null) { + subBuilder = submitTime_.toBuilder(); + } + submitTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(submitTime_); + submitTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.class, + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.Builder.class); + } + + /** + * + * + *
+   * State of the job.
+   * 
+ * + * Protobuf enum {@code google.cloud.translation.v3.BatchTranslateDocumentMetadata.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Request is being processed.
+     * 
+ * + * RUNNING = 1; + */ + RUNNING(1), + /** + * + * + *
+     * The batch is processed, and at least one item was successfully processed.
+     * 
+ * + * SUCCEEDED = 2; + */ + SUCCEEDED(2), + /** + * + * + *
+     * The batch is done and no item was successfully processed.
+     * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + * + * + *
+     * Request is in the process of being canceled after caller invoked
+     * longrunning.Operations.CancelOperation on the request id.
+     * 
+ * + * CANCELLING = 4; + */ + CANCELLING(4), + /** + * + * + *
+     * The batch is done after the user has called the
+     * longrunning.Operations.CancelOperation. Any records processed before the
+     * cancel command are output as specified in the request.
+     * 
+ * + * CANCELLED = 5; + */ + CANCELLED(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Request is being processed.
+     * 
+ * + * RUNNING = 1; + */ + public static final int RUNNING_VALUE = 1; + /** + * + * + *
+     * The batch is processed, and at least one item was successfully processed.
+     * 
+ * + * SUCCEEDED = 2; + */ + public static final int SUCCEEDED_VALUE = 2; + /** + * + * + *
+     * The batch is done and no item was successfully processed.
+     * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + /** + * + * + *
+     * Request is in the process of being canceled after caller invoked
+     * longrunning.Operations.CancelOperation on the request id.
+     * 
+ * + * CANCELLING = 4; + */ + public static final int CANCELLING_VALUE = 4; + /** + * + * + *
+     * The batch is done after the user has called the
+     * longrunning.Operations.CancelOperation. Any records processed before the
+     * cancel command are output as specified in the request.
+     * 
+ * + * CANCELLED = 5; + */ + public static final int CANCELLED_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return RUNNING; + case 2: + return SUCCEEDED; + case 3: + return FAILED; + case 4: + return CANCELLING; + case 5: + return CANCELLED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.translation.v3.BatchTranslateDocumentMetadata.State) + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.cloud.translation.v3.BatchTranslateDocumentMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.cloud.translation.v3.BatchTranslateDocumentMetadata.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.State result = + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.State.valueOf(state_); + return result == null + ? com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.State.UNRECOGNIZED + : result; + } + + public static final int TOTAL_PAGES_FIELD_NUMBER = 2; + private long totalPages_; + /** + * + * + *
+   * Total number of pages to translate in all documents so far. Documents
+   * without clear page definition (such as XLSX) are not counted.
+   * 
+ * + * int64 total_pages = 2; + * + * @return The totalPages. + */ + @java.lang.Override + public long getTotalPages() { + return totalPages_; + } + + public static final int TRANSLATED_PAGES_FIELD_NUMBER = 3; + private long translatedPages_; + /** + * + * + *
+   * Number of successfully translated pages in all documents so far. Documents
+   * without clear page definition (such as XLSX) are not counted.
+   * 
+ * + * int64 translated_pages = 3; + * + * @return The translatedPages. + */ + @java.lang.Override + public long getTranslatedPages() { + return translatedPages_; + } + + public static final int FAILED_PAGES_FIELD_NUMBER = 4; + private long failedPages_; + /** + * + * + *
+   * Number of pages that failed to process in all documents so far. Documents
+   * without clear page definition (such as XLSX) are not counted.
+   * 
+ * + * int64 failed_pages = 4; + * + * @return The failedPages. + */ + @java.lang.Override + public long getFailedPages() { + return failedPages_; + } + + public static final int TOTAL_BILLABLE_PAGES_FIELD_NUMBER = 5; + private long totalBillablePages_; + /** + * + * + *
+   * Number of billable pages in documents with clear page definition (such as
+   * PDF, DOCX, PPTX) so far.
+   * 
+ * + * int64 total_billable_pages = 5; + * + * @return The totalBillablePages. + */ + @java.lang.Override + public long getTotalBillablePages() { + return totalBillablePages_; + } + + public static final int TOTAL_CHARACTERS_FIELD_NUMBER = 6; + private long totalCharacters_; + /** + * + * + *
+   * Total number of characters (Unicode codepoints) in all documents so far.
+   * 
+ * + * int64 total_characters = 6; + * + * @return The totalCharacters. + */ + @java.lang.Override + public long getTotalCharacters() { + return totalCharacters_; + } + + public static final int TRANSLATED_CHARACTERS_FIELD_NUMBER = 7; + private long translatedCharacters_; + /** + * + * + *
+   * Number of successfully translated characters (Unicode codepoints) in all
+   * documents so far.
+   * 
+ * + * int64 translated_characters = 7; + * + * @return The translatedCharacters. + */ + @java.lang.Override + public long getTranslatedCharacters() { + return translatedCharacters_; + } + + public static final int FAILED_CHARACTERS_FIELD_NUMBER = 8; + private long failedCharacters_; + /** + * + * + *
+   * Number of characters that have failed to process (Unicode codepoints) in
+   * all documents so far.
+   * 
+ * + * int64 failed_characters = 8; + * + * @return The failedCharacters. + */ + @java.lang.Override + public long getFailedCharacters() { + return failedCharacters_; + } + + public static final int TOTAL_BILLABLE_CHARACTERS_FIELD_NUMBER = 9; + private long totalBillableCharacters_; + /** + * + * + *
+   * Number of billable characters (Unicode codepoints) in documents without
+   * clear page definition (such as XLSX) so far.
+   * 
+ * + * int64 total_billable_characters = 9; + * + * @return The totalBillableCharacters. + */ + @java.lang.Override + public long getTotalBillableCharacters() { + return totalBillableCharacters_; + } + + public static final int SUBMIT_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp submitTime_; + /** + * + * + *
+   * Time when the operation was submitted.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + * + * @return Whether the submitTime field is set. + */ + @java.lang.Override + public boolean hasSubmitTime() { + return submitTime_ != null; + } + /** + * + * + *
+   * Time when the operation was submitted.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + * + * @return The submitTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSubmitTime() { + return submitTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : submitTime_; + } + /** + * + * + *
+   * Time when the operation was submitted.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSubmitTimeOrBuilder() { + return getSubmitTime(); + } + + 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 (state_ + != com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, state_); + } + if (totalPages_ != 0L) { + output.writeInt64(2, totalPages_); + } + if (translatedPages_ != 0L) { + output.writeInt64(3, translatedPages_); + } + if (failedPages_ != 0L) { + output.writeInt64(4, failedPages_); + } + if (totalBillablePages_ != 0L) { + output.writeInt64(5, totalBillablePages_); + } + if (totalCharacters_ != 0L) { + output.writeInt64(6, totalCharacters_); + } + if (translatedCharacters_ != 0L) { + output.writeInt64(7, translatedCharacters_); + } + if (failedCharacters_ != 0L) { + output.writeInt64(8, failedCharacters_); + } + if (totalBillableCharacters_ != 0L) { + output.writeInt64(9, totalBillableCharacters_); + } + if (submitTime_ != null) { + output.writeMessage(10, getSubmitTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ + != com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, state_); + } + if (totalPages_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, totalPages_); + } + if (translatedPages_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, translatedPages_); + } + if (failedPages_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, failedPages_); + } + if (totalBillablePages_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, totalBillablePages_); + } + if (totalCharacters_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, totalCharacters_); + } + if (translatedCharacters_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, translatedCharacters_); + } + if (failedCharacters_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, failedCharacters_); + } + if (totalBillableCharacters_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, totalBillableCharacters_); + } + if (submitTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getSubmitTime()); + } + size += unknownFields.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.v3.BatchTranslateDocumentMetadata)) { + return super.equals(obj); + } + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata other = + (com.google.cloud.translate.v3.BatchTranslateDocumentMetadata) obj; + + if (state_ != other.state_) return false; + if (getTotalPages() != other.getTotalPages()) return false; + if (getTranslatedPages() != other.getTranslatedPages()) return false; + if (getFailedPages() != other.getFailedPages()) return false; + if (getTotalBillablePages() != other.getTotalBillablePages()) return false; + if (getTotalCharacters() != other.getTotalCharacters()) return false; + if (getTranslatedCharacters() != other.getTranslatedCharacters()) return false; + if (getFailedCharacters() != other.getFailedCharacters()) return false; + if (getTotalBillableCharacters() != other.getTotalBillableCharacters()) return false; + if (hasSubmitTime() != other.hasSubmitTime()) return false; + if (hasSubmitTime()) { + if (!getSubmitTime().equals(other.getSubmitTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + TOTAL_PAGES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTotalPages()); + hash = (37 * hash) + TRANSLATED_PAGES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTranslatedPages()); + hash = (37 * hash) + FAILED_PAGES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFailedPages()); + hash = (37 * hash) + TOTAL_BILLABLE_PAGES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTotalBillablePages()); + hash = (37 * hash) + TOTAL_CHARACTERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTotalCharacters()); + hash = (37 * hash) + TRANSLATED_CHARACTERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTranslatedCharacters()); + hash = (37 * hash) + FAILED_CHARACTERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFailedCharacters()); + hash = (37 * hash) + TOTAL_BILLABLE_CHARACTERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTotalBillableCharacters()); + if (hasSubmitTime()) { + hash = (37 * hash) + SUBMIT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSubmitTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentMetadata 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.v3.BatchTranslateDocumentMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentMetadata 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.v3.BatchTranslateDocumentMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentMetadata 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.v3.BatchTranslateDocumentMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentMetadata 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.v3.BatchTranslateDocumentMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentMetadata 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.v3.BatchTranslateDocumentMetadata 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; + } + /** + * + * + *
+   * State metadata for the batch translation operation.
+   * 
+ * + * Protobuf type {@code google.cloud.translation.v3.BatchTranslateDocumentMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3.BatchTranslateDocumentMetadata) + com.google.cloud.translate.v3.BatchTranslateDocumentMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.class, + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.Builder.class); + } + + // Construct using com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + state_ = 0; + + totalPages_ = 0L; + + translatedPages_ = 0L; + + failedPages_ = 0L; + + totalBillablePages_ = 0L; + + totalCharacters_ = 0L; + + translatedCharacters_ = 0L; + + failedCharacters_ = 0L; + + totalBillableCharacters_ = 0L; + + if (submitTimeBuilder_ == null) { + submitTime_ = null; + } else { + submitTime_ = null; + submitTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchTranslateDocumentMetadata + getDefaultInstanceForType() { + return com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchTranslateDocumentMetadata build() { + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchTranslateDocumentMetadata buildPartial() { + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata result = + new com.google.cloud.translate.v3.BatchTranslateDocumentMetadata(this); + result.state_ = state_; + result.totalPages_ = totalPages_; + result.translatedPages_ = translatedPages_; + result.failedPages_ = failedPages_; + result.totalBillablePages_ = totalBillablePages_; + result.totalCharacters_ = totalCharacters_; + result.translatedCharacters_ = translatedCharacters_; + result.failedCharacters_ = failedCharacters_; + result.totalBillableCharacters_ = totalBillableCharacters_; + if (submitTimeBuilder_ == null) { + result.submitTime_ = submitTime_; + } else { + result.submitTime_ = submitTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.v3.BatchTranslateDocumentMetadata) { + return mergeFrom((com.google.cloud.translate.v3.BatchTranslateDocumentMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3.BatchTranslateDocumentMetadata other) { + if (other + == com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.getDefaultInstance()) + return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.getTotalPages() != 0L) { + setTotalPages(other.getTotalPages()); + } + if (other.getTranslatedPages() != 0L) { + setTranslatedPages(other.getTranslatedPages()); + } + if (other.getFailedPages() != 0L) { + setFailedPages(other.getFailedPages()); + } + if (other.getTotalBillablePages() != 0L) { + setTotalBillablePages(other.getTotalBillablePages()); + } + if (other.getTotalCharacters() != 0L) { + setTotalCharacters(other.getTotalCharacters()); + } + if (other.getTranslatedCharacters() != 0L) { + setTranslatedCharacters(other.getTranslatedCharacters()); + } + if (other.getFailedCharacters() != 0L) { + setFailedCharacters(other.getFailedCharacters()); + } + if (other.getTotalBillableCharacters() != 0L) { + setTotalBillableCharacters(other.getTotalBillableCharacters()); + } + if (other.hasSubmitTime()) { + mergeSubmitTime(other.getSubmitTime()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3.BatchTranslateDocumentMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.cloud.translation.v3.BatchTranslateDocumentMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.cloud.translation.v3.BatchTranslateDocumentMetadata.State state = 1; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.cloud.translation.v3.BatchTranslateDocumentMetadata.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.State result = + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.State.valueOf(state_); + return result == null + ? com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.cloud.translation.v3.BatchTranslateDocumentMetadata.State state = 1; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState( + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.cloud.translation.v3.BatchTranslateDocumentMetadata.State state = 1; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private long totalPages_; + /** + * + * + *
+     * Total number of pages to translate in all documents so far. Documents
+     * without clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 total_pages = 2; + * + * @return The totalPages. + */ + @java.lang.Override + public long getTotalPages() { + return totalPages_; + } + /** + * + * + *
+     * Total number of pages to translate in all documents so far. Documents
+     * without clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 total_pages = 2; + * + * @param value The totalPages to set. + * @return This builder for chaining. + */ + public Builder setTotalPages(long value) { + + totalPages_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Total number of pages to translate in all documents so far. Documents
+     * without clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 total_pages = 2; + * + * @return This builder for chaining. + */ + public Builder clearTotalPages() { + + totalPages_ = 0L; + onChanged(); + return this; + } + + private long translatedPages_; + /** + * + * + *
+     * Number of successfully translated pages in all documents so far. Documents
+     * without clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 translated_pages = 3; + * + * @return The translatedPages. + */ + @java.lang.Override + public long getTranslatedPages() { + return translatedPages_; + } + /** + * + * + *
+     * Number of successfully translated pages in all documents so far. Documents
+     * without clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 translated_pages = 3; + * + * @param value The translatedPages to set. + * @return This builder for chaining. + */ + public Builder setTranslatedPages(long value) { + + translatedPages_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of successfully translated pages in all documents so far. Documents
+     * without clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 translated_pages = 3; + * + * @return This builder for chaining. + */ + public Builder clearTranslatedPages() { + + translatedPages_ = 0L; + onChanged(); + return this; + } + + private long failedPages_; + /** + * + * + *
+     * Number of pages that failed to process in all documents so far. Documents
+     * without clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 failed_pages = 4; + * + * @return The failedPages. + */ + @java.lang.Override + public long getFailedPages() { + return failedPages_; + } + /** + * + * + *
+     * Number of pages that failed to process in all documents so far. Documents
+     * without clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 failed_pages = 4; + * + * @param value The failedPages to set. + * @return This builder for chaining. + */ + public Builder setFailedPages(long value) { + + failedPages_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of pages that failed to process in all documents so far. Documents
+     * without clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 failed_pages = 4; + * + * @return This builder for chaining. + */ + public Builder clearFailedPages() { + + failedPages_ = 0L; + onChanged(); + return this; + } + + private long totalBillablePages_; + /** + * + * + *
+     * Number of billable pages in documents with clear page definition (such as
+     * PDF, DOCX, PPTX) so far.
+     * 
+ * + * int64 total_billable_pages = 5; + * + * @return The totalBillablePages. + */ + @java.lang.Override + public long getTotalBillablePages() { + return totalBillablePages_; + } + /** + * + * + *
+     * Number of billable pages in documents with clear page definition (such as
+     * PDF, DOCX, PPTX) so far.
+     * 
+ * + * int64 total_billable_pages = 5; + * + * @param value The totalBillablePages to set. + * @return This builder for chaining. + */ + public Builder setTotalBillablePages(long value) { + + totalBillablePages_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of billable pages in documents with clear page definition (such as
+     * PDF, DOCX, PPTX) so far.
+     * 
+ * + * int64 total_billable_pages = 5; + * + * @return This builder for chaining. + */ + public Builder clearTotalBillablePages() { + + totalBillablePages_ = 0L; + onChanged(); + return this; + } + + private long totalCharacters_; + /** + * + * + *
+     * Total number of characters (Unicode codepoints) in all documents so far.
+     * 
+ * + * int64 total_characters = 6; + * + * @return The totalCharacters. + */ + @java.lang.Override + public long getTotalCharacters() { + return totalCharacters_; + } + /** + * + * + *
+     * Total number of characters (Unicode codepoints) in all documents so far.
+     * 
+ * + * int64 total_characters = 6; + * + * @param value The totalCharacters to set. + * @return This builder for chaining. + */ + public Builder setTotalCharacters(long value) { + + totalCharacters_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Total number of characters (Unicode codepoints) in all documents so far.
+     * 
+ * + * int64 total_characters = 6; + * + * @return This builder for chaining. + */ + public Builder clearTotalCharacters() { + + totalCharacters_ = 0L; + onChanged(); + return this; + } + + private long translatedCharacters_; + /** + * + * + *
+     * Number of successfully translated characters (Unicode codepoints) in all
+     * documents so far.
+     * 
+ * + * int64 translated_characters = 7; + * + * @return The translatedCharacters. + */ + @java.lang.Override + public long getTranslatedCharacters() { + return translatedCharacters_; + } + /** + * + * + *
+     * Number of successfully translated characters (Unicode codepoints) in all
+     * documents so far.
+     * 
+ * + * int64 translated_characters = 7; + * + * @param value The translatedCharacters to set. + * @return This builder for chaining. + */ + public Builder setTranslatedCharacters(long value) { + + translatedCharacters_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of successfully translated characters (Unicode codepoints) in all
+     * documents so far.
+     * 
+ * + * int64 translated_characters = 7; + * + * @return This builder for chaining. + */ + public Builder clearTranslatedCharacters() { + + translatedCharacters_ = 0L; + onChanged(); + return this; + } + + private long failedCharacters_; + /** + * + * + *
+     * Number of characters that have failed to process (Unicode codepoints) in
+     * all documents so far.
+     * 
+ * + * int64 failed_characters = 8; + * + * @return The failedCharacters. + */ + @java.lang.Override + public long getFailedCharacters() { + return failedCharacters_; + } + /** + * + * + *
+     * Number of characters that have failed to process (Unicode codepoints) in
+     * all documents so far.
+     * 
+ * + * int64 failed_characters = 8; + * + * @param value The failedCharacters to set. + * @return This builder for chaining. + */ + public Builder setFailedCharacters(long value) { + + failedCharacters_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of characters that have failed to process (Unicode codepoints) in
+     * all documents so far.
+     * 
+ * + * int64 failed_characters = 8; + * + * @return This builder for chaining. + */ + public Builder clearFailedCharacters() { + + failedCharacters_ = 0L; + onChanged(); + return this; + } + + private long totalBillableCharacters_; + /** + * + * + *
+     * Number of billable characters (Unicode codepoints) in documents without
+     * clear page definition (such as XLSX) so far.
+     * 
+ * + * int64 total_billable_characters = 9; + * + * @return The totalBillableCharacters. + */ + @java.lang.Override + public long getTotalBillableCharacters() { + return totalBillableCharacters_; + } + /** + * + * + *
+     * Number of billable characters (Unicode codepoints) in documents without
+     * clear page definition (such as XLSX) so far.
+     * 
+ * + * int64 total_billable_characters = 9; + * + * @param value The totalBillableCharacters to set. + * @return This builder for chaining. + */ + public Builder setTotalBillableCharacters(long value) { + + totalBillableCharacters_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of billable characters (Unicode codepoints) in documents without
+     * clear page definition (such as XLSX) so far.
+     * 
+ * + * int64 total_billable_characters = 9; + * + * @return This builder for chaining. + */ + public Builder clearTotalBillableCharacters() { + + totalBillableCharacters_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp submitTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + submitTimeBuilder_; + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + * + * @return Whether the submitTime field is set. + */ + public boolean hasSubmitTime() { + return submitTimeBuilder_ != null || submitTime_ != null; + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + * + * @return The submitTime. + */ + public com.google.protobuf.Timestamp getSubmitTime() { + if (submitTimeBuilder_ == null) { + return submitTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : submitTime_; + } else { + return submitTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + */ + public Builder setSubmitTime(com.google.protobuf.Timestamp value) { + if (submitTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + submitTime_ = value; + onChanged(); + } else { + submitTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + */ + public Builder setSubmitTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (submitTimeBuilder_ == null) { + submitTime_ = builderForValue.build(); + onChanged(); + } else { + submitTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + */ + public Builder mergeSubmitTime(com.google.protobuf.Timestamp value) { + if (submitTimeBuilder_ == null) { + if (submitTime_ != null) { + submitTime_ = + com.google.protobuf.Timestamp.newBuilder(submitTime_).mergeFrom(value).buildPartial(); + } else { + submitTime_ = value; + } + onChanged(); + } else { + submitTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + */ + public Builder clearSubmitTime() { + if (submitTimeBuilder_ == null) { + submitTime_ = null; + onChanged(); + } else { + submitTime_ = null; + submitTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + */ + public com.google.protobuf.Timestamp.Builder getSubmitTimeBuilder() { + + onChanged(); + return getSubmitTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getSubmitTimeOrBuilder() { + if (submitTimeBuilder_ != null) { + return submitTimeBuilder_.getMessageOrBuilder(); + } else { + return submitTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : submitTime_; + } + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSubmitTimeFieldBuilder() { + if (submitTimeBuilder_ == null) { + submitTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSubmitTime(), getParentForChildren(), isClean()); + submitTime_ = null; + } + return submitTimeBuilder_; + } + + @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.v3.BatchTranslateDocumentMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3.BatchTranslateDocumentMetadata) + private static final com.google.cloud.translate.v3.BatchTranslateDocumentMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3.BatchTranslateDocumentMetadata(); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchTranslateDocumentMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchTranslateDocumentMetadata(input, extensionRegistry); + } + }; + + 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.v3.BatchTranslateDocumentMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentMetadataOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentMetadataOrBuilder.java new file mode 100644 index 00000000..eb703cf7 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentMetadataOrBuilder.java @@ -0,0 +1,196 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +public interface BatchTranslateDocumentMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3.BatchTranslateDocumentMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.cloud.translation.v3.BatchTranslateDocumentMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.cloud.translation.v3.BatchTranslateDocumentMetadata.State state = 1; + * + * @return The state. + */ + com.google.cloud.translate.v3.BatchTranslateDocumentMetadata.State getState(); + + /** + * + * + *
+   * Total number of pages to translate in all documents so far. Documents
+   * without clear page definition (such as XLSX) are not counted.
+   * 
+ * + * int64 total_pages = 2; + * + * @return The totalPages. + */ + long getTotalPages(); + + /** + * + * + *
+   * Number of successfully translated pages in all documents so far. Documents
+   * without clear page definition (such as XLSX) are not counted.
+   * 
+ * + * int64 translated_pages = 3; + * + * @return The translatedPages. + */ + long getTranslatedPages(); + + /** + * + * + *
+   * Number of pages that failed to process in all documents so far. Documents
+   * without clear page definition (such as XLSX) are not counted.
+   * 
+ * + * int64 failed_pages = 4; + * + * @return The failedPages. + */ + long getFailedPages(); + + /** + * + * + *
+   * Number of billable pages in documents with clear page definition (such as
+   * PDF, DOCX, PPTX) so far.
+   * 
+ * + * int64 total_billable_pages = 5; + * + * @return The totalBillablePages. + */ + long getTotalBillablePages(); + + /** + * + * + *
+   * Total number of characters (Unicode codepoints) in all documents so far.
+   * 
+ * + * int64 total_characters = 6; + * + * @return The totalCharacters. + */ + long getTotalCharacters(); + + /** + * + * + *
+   * Number of successfully translated characters (Unicode codepoints) in all
+   * documents so far.
+   * 
+ * + * int64 translated_characters = 7; + * + * @return The translatedCharacters. + */ + long getTranslatedCharacters(); + + /** + * + * + *
+   * Number of characters that have failed to process (Unicode codepoints) in
+   * all documents so far.
+   * 
+ * + * int64 failed_characters = 8; + * + * @return The failedCharacters. + */ + long getFailedCharacters(); + + /** + * + * + *
+   * Number of billable characters (Unicode codepoints) in documents without
+   * clear page definition (such as XLSX) so far.
+   * 
+ * + * int64 total_billable_characters = 9; + * + * @return The totalBillableCharacters. + */ + long getTotalBillableCharacters(); + + /** + * + * + *
+   * Time when the operation was submitted.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + * + * @return Whether the submitTime field is set. + */ + boolean hasSubmitTime(); + /** + * + * + *
+   * Time when the operation was submitted.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + * + * @return The submitTime. + */ + com.google.protobuf.Timestamp getSubmitTime(); + /** + * + * + *
+   * Time when the operation was submitted.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 10; + */ + com.google.protobuf.TimestampOrBuilder getSubmitTimeOrBuilder(); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentRequest.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentRequest.java new file mode 100644 index 00000000..3b92ddf5 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentRequest.java @@ -0,0 +1,3325 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +/** + * + * + *
+ * The BatchTranslateDocument request.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3.BatchTranslateDocumentRequest} + */ +public final class BatchTranslateDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3.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.EMPTY; + inputConfigs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchTranslateDocumentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchTranslateDocumentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + sourceLanguageCode_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + targetLanguageCodes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + targetLanguageCodes_.add(s); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + inputConfigs_ = + new java.util.ArrayList< + com.google.cloud.translate.v3.BatchDocumentInputConfig>(); + mutable_bitField0_ |= 0x00000002; + } + inputConfigs_.add( + input.readMessage( + com.google.cloud.translate.v3.BatchDocumentInputConfig.parser(), + extensionRegistry)); + break; + } + case 42: + { + com.google.cloud.translate.v3.BatchDocumentOutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = + input.readMessage( + com.google.cloud.translate.v3.BatchDocumentOutputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + models_ = + com.google.protobuf.MapField.newMapField(ModelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry models__ = + input.readMessage( + ModelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + models_.getMutableMap().put(models__.getKey(), models__.getValue()); + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + glossaries_ = + com.google.protobuf.MapField.newMapField( + GlossariesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.translate.v3.TranslateTextGlossaryConfig> + glossaries__ = + input.readMessage( + GlossariesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + glossaries_.getMutableMap().put(glossaries__.getKey(), glossaries__.getValue()); + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + formatConversions_ = + com.google.protobuf.MapField.newMapField( + FormatConversionsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000010; + } + com.google.protobuf.MapEntry formatConversions__ = + input.readMessage( + FormatConversionsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + formatConversions_ + .getMutableMap() + .put(formatConversions__.getKey(), formatConversions__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + targetLanguageCodes_ = targetLanguageCodes_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + inputConfigs_ = java.util.Collections.unmodifiableList(inputConfigs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(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.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.BatchTranslateDocumentRequest.class, + com.google.cloud.translate.v3.BatchTranslateDocumentRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + 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; + 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; + private com.google.protobuf.LazyStringList 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 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; + 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.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + 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.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3.BatchDocumentInputConfigOrBuilder getInputConfigsOrBuilder( + int index) { + return inputConfigs_.get(index); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 5; + private com.google.cloud.translate.v3.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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * 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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + @java.lang.Override + public com.google.cloud.translate.v3.BatchDocumentOutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.translate.v3.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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3.BatchDocumentOutputConfigOrBuilder + getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + 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.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_ModelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + 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 java.lang.NullPointerException(); + } + 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 java.lang.String getModelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 java.lang.NullPointerException(); + } + 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.v3.TranslateTextGlossaryConfig> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_GlossariesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.translate.v3.TranslateTextGlossaryConfig + .getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.translate.v3.TranslateTextGlossaryConfig> + glossaries_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.translate.v3.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.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsGlossaries(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetGlossaries().getMap().containsKey(key); + } + /** Use {@link #getGlossariesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getGlossaries() { + return getGlossariesMap(); + } + /** + * + * + *
+   * Optional. Glossaries to be applied. It's keyed by target language code.
+   * 
+ * + * + * map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getGlossariesMap() { + return internalGetGlossaries().getMap(); + } + /** + * + * + *
+   * Optional. Glossaries to be applied. It's keyed by target language code.
+   * 
+ * + * + * map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossariesOrDefault( + java.lang.String key, + com.google.cloud.translate.v3.TranslateTextGlossaryConfig defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossariesOrThrow( + java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_FormatConversionsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + 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 java.lang.NullPointerException(); + } + 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 java.lang.String getFormatConversionsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 java.lang.NullPointerException(); + } + java.util.Map map = internalGetFormatConversions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getSourceLanguageCodeBytes().isEmpty()) { + 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 (outputConfig_ != null) { + 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); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getSourceLanguageCodeBytes().isEmpty()) { + 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 (outputConfig_ != null) { + 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.v3.TranslateTextGlossaryConfig> + entry : internalGetGlossaries().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.translate.v3.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__); + } + size += unknownFields.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.v3.BatchTranslateDocumentRequest)) { + return super.equals(obj); + } + com.google.cloud.translate.v3.BatchTranslateDocumentRequest other = + (com.google.cloud.translate.v3.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 (!unknownFields.equals(other.unknownFields)) 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.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.v3.BatchTranslateDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.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.v3.BatchTranslateDocumentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.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.v3.BatchTranslateDocumentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.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.v3.BatchTranslateDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.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.v3.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.v3.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.v3.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.v3.BatchTranslateDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3.BatchTranslateDocumentRequest) + com.google.cloud.translate.v3.BatchTranslateDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(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.MapField internalGetMutableMapField(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.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.BatchTranslateDocumentRequest.class, + com.google.cloud.translate.v3.BatchTranslateDocumentRequest.Builder.class); + } + + // Construct using com.google.cloud.translate.v3.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + sourceLanguageCode_ = ""; + + targetLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (inputConfigsBuilder_ == null) { + inputConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + inputConfigsBuilder_.clear(); + } + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + internalGetMutableModels().clear(); + internalGetMutableGlossaries().clear(); + internalGetMutableFormatConversions().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchTranslateDocumentRequest getDefaultInstanceForType() { + return com.google.cloud.translate.v3.BatchTranslateDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchTranslateDocumentRequest build() { + com.google.cloud.translate.v3.BatchTranslateDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchTranslateDocumentRequest buildPartial() { + com.google.cloud.translate.v3.BatchTranslateDocumentRequest result = + new com.google.cloud.translate.v3.BatchTranslateDocumentRequest(this); + int from_bitField0_ = bitField0_; + result.parent_ = parent_; + result.sourceLanguageCode_ = sourceLanguageCode_; + if (((bitField0_ & 0x00000001) != 0)) { + targetLanguageCodes_ = targetLanguageCodes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.targetLanguageCodes_ = targetLanguageCodes_; + if (inputConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + inputConfigs_ = java.util.Collections.unmodifiableList(inputConfigs_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.inputConfigs_ = inputConfigs_; + } else { + result.inputConfigs_ = inputConfigsBuilder_.build(); + } + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + result.models_ = internalGetModels(); + result.models_.makeImmutable(); + result.glossaries_ = internalGetGlossaries(); + result.glossaries_.makeImmutable(); + result.formatConversions_ = internalGetFormatConversions(); + result.formatConversions_.makeImmutable(); + onBuilt(); + return result; + } + + @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.v3.BatchTranslateDocumentRequest) { + return mergeFrom((com.google.cloud.translate.v3.BatchTranslateDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3.BatchTranslateDocumentRequest other) { + if (other == com.google.cloud.translate.v3.BatchTranslateDocumentRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getSourceLanguageCode().isEmpty()) { + sourceLanguageCode_ = other.sourceLanguageCode_; + onChanged(); + } + if (!other.targetLanguageCodes_.isEmpty()) { + if (targetLanguageCodes_.isEmpty()) { + targetLanguageCodes_ = other.targetLanguageCodes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTargetLanguageCodesIsMutable(); + targetLanguageCodes_.addAll(other.targetLanguageCodes_); + } + onChanged(); + } + if (inputConfigsBuilder_ == null) { + if (!other.inputConfigs_.isEmpty()) { + if (inputConfigs_.isEmpty()) { + inputConfigs_ = other.inputConfigs_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureInputConfigsIsMutable(); + inputConfigs_.addAll(other.inputConfigs_); + } + onChanged(); + } + } else { + if (!other.inputConfigs_.isEmpty()) { + if (inputConfigsBuilder_.isEmpty()) { + inputConfigsBuilder_.dispose(); + inputConfigsBuilder_ = null; + inputConfigs_ = other.inputConfigs_; + bitField0_ = (bitField0_ & ~0x00000002); + inputConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInputConfigsFieldBuilder() + : null; + } else { + inputConfigsBuilder_.addAllMessages(other.inputConfigs_); + } + } + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + internalGetMutableModels().mergeFrom(other.internalGetModels()); + internalGetMutableGlossaries().mergeFrom(other.internalGetGlossaries()); + internalGetMutableFormatConversions().mergeFrom(other.internalGetFormatConversions()); + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.translate.v3.BatchTranslateDocumentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3.BatchTranslateDocumentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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; + 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(); + 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; + 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; + 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(); + 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; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList targetLanguageCodes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTargetLanguageCodesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + targetLanguageCodes_ = new com.google.protobuf.LazyStringArrayList(targetLanguageCodes_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * 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_.getUnmodifiableView(); + } + /** + * + * + *
+     * 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); + 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); + 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_); + 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.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + 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); + onChanged(); + return this; + } + + private java.util.List inputConfigs_ = + java.util.Collections.emptyList(); + + private void ensureInputConfigsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + inputConfigs_ = + new java.util.ArrayList( + inputConfigs_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.translate.v3.BatchDocumentInputConfig, + com.google.cloud.translate.v3.BatchDocumentInputConfig.Builder, + com.google.cloud.translate.v3.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.v3.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.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfigs( + int index, com.google.cloud.translate.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfigs( + int index, com.google.cloud.translate.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInputConfigs(com.google.cloud.translate.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInputConfigs( + int index, com.google.cloud.translate.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInputConfigs( + com.google.cloud.translate.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInputConfigs( + int index, com.google.cloud.translate.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllInputConfigs( + java.lang.Iterable + 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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInputConfigs() { + if (inputConfigsBuilder_ == null) { + inputConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + 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.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + 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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3.BatchDocumentInputConfig.Builder addInputConfigsBuilder() { + return getInputConfigsFieldBuilder() + .addBuilder(com.google.cloud.translate.v3.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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3.BatchDocumentInputConfig.Builder addInputConfigsBuilder( + int index) { + return getInputConfigsFieldBuilder() + .addBuilder( + index, com.google.cloud.translate.v3.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.v3.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.v3.BatchDocumentInputConfig, + com.google.cloud.translate.v3.BatchDocumentInputConfig.Builder, + com.google.cloud.translate.v3.BatchDocumentInputConfigOrBuilder> + getInputConfigsFieldBuilder() { + if (inputConfigsBuilder_ == null) { + inputConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.translate.v3.BatchDocumentInputConfig, + com.google.cloud.translate.v3.BatchDocumentInputConfig.Builder, + com.google.cloud.translate.v3.BatchDocumentInputConfigOrBuilder>( + inputConfigs_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + inputConfigs_ = null; + } + return inputConfigsBuilder_; + } + + private com.google.cloud.translate.v3.BatchDocumentOutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.BatchDocumentOutputConfig, + com.google.cloud.translate.v3.BatchDocumentOutputConfig.Builder, + com.google.cloud.translate.v3.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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + * + * + *
+     * 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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + public com.google.cloud.translate.v3.BatchDocumentOutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.translate.v3.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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOutputConfig(com.google.cloud.translate.v3.BatchDocumentOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + 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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOutputConfig( + com.google.cloud.translate.v3.BatchDocumentOutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + 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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeOutputConfig( + com.google.cloud.translate.v3.BatchDocumentOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.translate.v3.BatchDocumentOutputConfig.newBuilder(outputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + 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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + 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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3.BatchDocumentOutputConfig.Builder + getOutputConfigBuilder() { + + 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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3.BatchDocumentOutputConfigOrBuilder + getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.translate.v3.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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.BatchDocumentOutputConfig, + com.google.cloud.translate.v3.BatchDocumentOutputConfig.Builder, + com.google.cloud.translate.v3.BatchDocumentOutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.BatchDocumentOutputConfig, + com.google.cloud.translate.v3.BatchDocumentOutputConfig.Builder, + com.google.cloud.translate.v3.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() { + onChanged(); + ; + if (models_ == null) { + models_ = com.google.protobuf.MapField.newMapField(ModelsDefaultEntryHolder.defaultEntry); + } + if (!models_.isMutable()) { + models_ = models_.copy(); + } + 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 java.lang.NullPointerException(); + } + 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 java.lang.String getModelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 java.lang.NullPointerException(); + } + java.util.Map map = internalGetModels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearModels() { + 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 java.lang.NullPointerException(); + } + internalGetMutableModels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableModels() { + 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 java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableModels().getMutableMap().put(key, value); + 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); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.translate.v3.TranslateTextGlossaryConfig> + glossaries_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.translate.v3.TranslateTextGlossaryConfig> + internalGetGlossaries() { + if (glossaries_ == null) { + return com.google.protobuf.MapField.emptyMapField( + GlossariesDefaultEntryHolder.defaultEntry); + } + return glossaries_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.translate.v3.TranslateTextGlossaryConfig> + internalGetMutableGlossaries() { + onChanged(); + ; + if (glossaries_ == null) { + glossaries_ = + com.google.protobuf.MapField.newMapField(GlossariesDefaultEntryHolder.defaultEntry); + } + if (!glossaries_.isMutable()) { + glossaries_ = glossaries_.copy(); + } + 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.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsGlossaries(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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.v3.TranslateTextGlossaryConfig> + getGlossaries() { + return getGlossariesMap(); + } + /** + * + * + *
+     * Optional. Glossaries to be applied. It's keyed by target language code.
+     * 
+ * + * + * map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.translate.v3.TranslateTextGlossaryConfig> + getGlossariesMap() { + return internalGetGlossaries().getMap(); + } + /** + * + * + *
+     * Optional. Glossaries to be applied. It's keyed by target language code.
+     * 
+ * + * + * map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossariesOrDefault( + java.lang.String key, + com.google.cloud.translate.v3.TranslateTextGlossaryConfig defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossariesOrThrow( + java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map + map = internalGetGlossaries().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearGlossaries() { + internalGetMutableGlossaries().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Glossaries to be applied. It's keyed by target language code.
+     * 
+ * + * + * map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeGlossaries(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableGlossaries().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.translate.v3.TranslateTextGlossaryConfig> + getMutableGlossaries() { + return internalGetMutableGlossaries().getMutableMap(); + } + /** + * + * + *
+     * Optional. Glossaries to be applied. It's keyed by target language code.
+     * 
+ * + * + * map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putGlossaries( + java.lang.String key, com.google.cloud.translate.v3.TranslateTextGlossaryConfig value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableGlossaries().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. Glossaries to be applied. It's keyed by target language code.
+     * 
+ * + * + * map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllGlossaries( + java.util.Map + values) { + internalGetMutableGlossaries().getMutableMap().putAll(values); + return this; + } + + 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() { + onChanged(); + ; + if (formatConversions_ == null) { + formatConversions_ = + com.google.protobuf.MapField.newMapField( + FormatConversionsDefaultEntryHolder.defaultEntry); + } + if (!formatConversions_.isMutable()) { + formatConversions_ = formatConversions_.copy(); + } + 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 java.lang.NullPointerException(); + } + 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 java.lang.String getFormatConversionsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 java.lang.NullPointerException(); + } + java.util.Map map = + internalGetFormatConversions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearFormatConversions() { + 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 java.lang.NullPointerException(); + } + internalGetMutableFormatConversions().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableFormatConversions() { + 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 java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableFormatConversions().getMutableMap().put(key, value); + 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); + 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.v3.BatchTranslateDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3.BatchTranslateDocumentRequest) + private static final com.google.cloud.translate.v3.BatchTranslateDocumentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3.BatchTranslateDocumentRequest(); + } + + public static com.google.cloud.translate.v3.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 { + return new BatchTranslateDocumentRequest(input, extensionRegistry); + } + }; + + 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.v3.BatchTranslateDocumentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentRequestOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentRequestOrBuilder.java new file mode 100644 index 00000000..38993312 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentRequestOrBuilder.java @@ -0,0 +1,544 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +public interface BatchTranslateDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3.BatchTranslateDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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.String getParent(); + /** + * + * + *
+   * 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. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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.String getSourceLanguageCode(); + /** + * + * + *
+   * 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. + */ + com.google.protobuf.ByteString getSourceLanguageCodeBytes(); + + /** + * + * + *
+   * 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. + */ + java.util.List getTargetLanguageCodesList(); + /** + * + * + *
+   * 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. + */ + int getTargetLanguageCodesCount(); + /** + * + * + *
+   * 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. + */ + java.lang.String getTargetLanguageCodes(int 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. + */ + com.google.protobuf.ByteString getTargetLanguageCodesBytes(int 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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getInputConfigsList(); + /** + * + * + *
+   * 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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.translate.v3.BatchDocumentInputConfig getInputConfigs(int 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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getInputConfigsCount(); + /** + * + * + *
+   * 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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getInputConfigsOrBuilderList(); + /** + * + * + *
+   * 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.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.translate.v3.BatchDocumentInputConfigOrBuilder getInputConfigsOrBuilder( + int index); + + /** + * + * + *
+   * 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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * 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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + com.google.cloud.translate.v3.BatchDocumentOutputConfig getOutputConfig(); + /** + * + * + *
+   * 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.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.translate.v3.BatchDocumentOutputConfigOrBuilder getOutputConfigOrBuilder(); + + /** + * + * + *
+   * 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]; + */ + int getModelsCount(); + /** + * + * + *
+   * 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]; + */ + boolean containsModels(java.lang.String key); + /** Use {@link #getModelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getModels(); + /** + * + * + *
+   * 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.util.Map 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.String getModelsOrDefault(java.lang.String key, java.lang.String 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.String getModelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. Glossaries to be applied. It's keyed by target language code.
+   * 
+ * + * + * map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getGlossariesCount(); + /** + * + * + *
+   * Optional. Glossaries to be applied. It's keyed by target language code.
+   * 
+ * + * + * map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsGlossaries(java.lang.String key); + /** Use {@link #getGlossariesMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getGlossaries(); + /** + * + * + *
+   * Optional. Glossaries to be applied. It's keyed by target language code.
+   * 
+ * + * + * map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map + getGlossariesMap(); + /** + * + * + *
+   * Optional. Glossaries to be applied. It's keyed by target language code.
+   * 
+ * + * + * map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossariesOrDefault( + java.lang.String key, com.google.cloud.translate.v3.TranslateTextGlossaryConfig defaultValue); + /** + * + * + *
+   * Optional. Glossaries to be applied. It's keyed by target language code.
+   * 
+ * + * + * map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossariesOrThrow( + java.lang.String key); + + /** + * + * + *
+   * 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]; + * + */ + int getFormatConversionsCount(); + /** + * + * + *
+   * 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]; + * + */ + boolean containsFormatConversions(java.lang.String key); + /** Use {@link #getFormatConversionsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getFormatConversions(); + /** + * + * + *
+   * 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.util.Map 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.String getFormatConversionsOrDefault( + java.lang.String key, java.lang.String 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.String getFormatConversionsOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentResponse.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentResponse.java new file mode 100644 index 00000000..c7fcbe1f --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentResponse.java @@ -0,0 +1,1779 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +/** + * + * + *
+ * Stored in the
+ * [google.longrunning.Operation.response][google.longrunning.Operation.response]
+ * field returned by BatchTranslateDocument if at least one document is
+ * translated successfully.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3.BatchTranslateDocumentResponse} + */ +public final class BatchTranslateDocumentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3.BatchTranslateDocumentResponse) + BatchTranslateDocumentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchTranslateDocumentResponse.newBuilder() to construct. + private BatchTranslateDocumentResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchTranslateDocumentResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchTranslateDocumentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchTranslateDocumentResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + totalPages_ = input.readInt64(); + break; + } + case 16: + { + translatedPages_ = input.readInt64(); + break; + } + case 24: + { + failedPages_ = input.readInt64(); + break; + } + case 32: + { + totalBillablePages_ = input.readInt64(); + break; + } + case 40: + { + totalCharacters_ = input.readInt64(); + break; + } + case 48: + { + translatedCharacters_ = input.readInt64(); + break; + } + case 56: + { + failedCharacters_ = input.readInt64(); + break; + } + case 64: + { + totalBillableCharacters_ = input.readInt64(); + break; + } + case 74: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (submitTime_ != null) { + subBuilder = submitTime_.toBuilder(); + } + submitTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(submitTime_); + submitTime_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.BatchTranslateDocumentResponse.class, + com.google.cloud.translate.v3.BatchTranslateDocumentResponse.Builder.class); + } + + public static final int TOTAL_PAGES_FIELD_NUMBER = 1; + private long totalPages_; + /** + * + * + *
+   * Total number of pages to translate in all documents. Documents without
+   * clear page definition (such as XLSX) are not counted.
+   * 
+ * + * int64 total_pages = 1; + * + * @return The totalPages. + */ + @java.lang.Override + public long getTotalPages() { + return totalPages_; + } + + public static final int TRANSLATED_PAGES_FIELD_NUMBER = 2; + private long translatedPages_; + /** + * + * + *
+   * Number of successfully translated pages in all documents. Documents without
+   * clear page definition (such as XLSX) are not counted.
+   * 
+ * + * int64 translated_pages = 2; + * + * @return The translatedPages. + */ + @java.lang.Override + public long getTranslatedPages() { + return translatedPages_; + } + + public static final int FAILED_PAGES_FIELD_NUMBER = 3; + private long failedPages_; + /** + * + * + *
+   * Number of pages that failed to process in all documents. Documents without
+   * clear page definition (such as XLSX) are not counted.
+   * 
+ * + * int64 failed_pages = 3; + * + * @return The failedPages. + */ + @java.lang.Override + public long getFailedPages() { + return failedPages_; + } + + public static final int TOTAL_BILLABLE_PAGES_FIELD_NUMBER = 4; + private long totalBillablePages_; + /** + * + * + *
+   * Number of billable pages in documents with clear page definition (such as
+   * PDF, DOCX, PPTX)
+   * 
+ * + * int64 total_billable_pages = 4; + * + * @return The totalBillablePages. + */ + @java.lang.Override + public long getTotalBillablePages() { + return totalBillablePages_; + } + + public static final int TOTAL_CHARACTERS_FIELD_NUMBER = 5; + private long totalCharacters_; + /** + * + * + *
+   * Total number of characters (Unicode codepoints) in all documents.
+   * 
+ * + * int64 total_characters = 5; + * + * @return The totalCharacters. + */ + @java.lang.Override + public long getTotalCharacters() { + return totalCharacters_; + } + + public static final int TRANSLATED_CHARACTERS_FIELD_NUMBER = 6; + private long translatedCharacters_; + /** + * + * + *
+   * Number of successfully translated characters (Unicode codepoints) in all
+   * documents.
+   * 
+ * + * int64 translated_characters = 6; + * + * @return The translatedCharacters. + */ + @java.lang.Override + public long getTranslatedCharacters() { + return translatedCharacters_; + } + + public static final int FAILED_CHARACTERS_FIELD_NUMBER = 7; + private long failedCharacters_; + /** + * + * + *
+   * Number of characters that have failed to process (Unicode codepoints) in
+   * all documents.
+   * 
+ * + * int64 failed_characters = 7; + * + * @return The failedCharacters. + */ + @java.lang.Override + public long getFailedCharacters() { + return failedCharacters_; + } + + public static final int TOTAL_BILLABLE_CHARACTERS_FIELD_NUMBER = 8; + private long totalBillableCharacters_; + /** + * + * + *
+   * Number of billable characters (Unicode codepoints) in documents without
+   * clear page definition, such as XLSX.
+   * 
+ * + * int64 total_billable_characters = 8; + * + * @return The totalBillableCharacters. + */ + @java.lang.Override + public long getTotalBillableCharacters() { + return totalBillableCharacters_; + } + + public static final int SUBMIT_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp submitTime_; + /** + * + * + *
+   * Time when the operation was submitted.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + * + * @return Whether the submitTime field is set. + */ + @java.lang.Override + public boolean hasSubmitTime() { + return submitTime_ != null; + } + /** + * + * + *
+   * Time when the operation was submitted.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + * + * @return The submitTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSubmitTime() { + return submitTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : submitTime_; + } + /** + * + * + *
+   * Time when the operation was submitted.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSubmitTimeOrBuilder() { + return getSubmitTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * The time when the operation is finished and
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 10; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The time when the operation is finished and
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 10; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The time when the operation is finished and
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 10; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + 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 (totalPages_ != 0L) { + output.writeInt64(1, totalPages_); + } + if (translatedPages_ != 0L) { + output.writeInt64(2, translatedPages_); + } + if (failedPages_ != 0L) { + output.writeInt64(3, failedPages_); + } + if (totalBillablePages_ != 0L) { + output.writeInt64(4, totalBillablePages_); + } + if (totalCharacters_ != 0L) { + output.writeInt64(5, totalCharacters_); + } + if (translatedCharacters_ != 0L) { + output.writeInt64(6, translatedCharacters_); + } + if (failedCharacters_ != 0L) { + output.writeInt64(7, failedCharacters_); + } + if (totalBillableCharacters_ != 0L) { + output.writeInt64(8, totalBillableCharacters_); + } + if (submitTime_ != null) { + output.writeMessage(9, getSubmitTime()); + } + if (endTime_ != null) { + output.writeMessage(10, getEndTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (totalPages_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, totalPages_); + } + if (translatedPages_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, translatedPages_); + } + if (failedPages_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, failedPages_); + } + if (totalBillablePages_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, totalBillablePages_); + } + if (totalCharacters_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, totalCharacters_); + } + if (translatedCharacters_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, translatedCharacters_); + } + if (failedCharacters_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, failedCharacters_); + } + if (totalBillableCharacters_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, totalBillableCharacters_); + } + if (submitTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getSubmitTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getEndTime()); + } + size += unknownFields.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.v3.BatchTranslateDocumentResponse)) { + return super.equals(obj); + } + com.google.cloud.translate.v3.BatchTranslateDocumentResponse other = + (com.google.cloud.translate.v3.BatchTranslateDocumentResponse) obj; + + if (getTotalPages() != other.getTotalPages()) return false; + if (getTranslatedPages() != other.getTranslatedPages()) return false; + if (getFailedPages() != other.getFailedPages()) return false; + if (getTotalBillablePages() != other.getTotalBillablePages()) return false; + if (getTotalCharacters() != other.getTotalCharacters()) return false; + if (getTranslatedCharacters() != other.getTranslatedCharacters()) return false; + if (getFailedCharacters() != other.getFailedCharacters()) return false; + if (getTotalBillableCharacters() != other.getTotalBillableCharacters()) return false; + if (hasSubmitTime() != other.hasSubmitTime()) return false; + if (hasSubmitTime()) { + if (!getSubmitTime().equals(other.getSubmitTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + TOTAL_PAGES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTotalPages()); + hash = (37 * hash) + TRANSLATED_PAGES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTranslatedPages()); + hash = (37 * hash) + FAILED_PAGES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFailedPages()); + hash = (37 * hash) + TOTAL_BILLABLE_PAGES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTotalBillablePages()); + hash = (37 * hash) + TOTAL_CHARACTERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTotalCharacters()); + hash = (37 * hash) + TRANSLATED_CHARACTERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTranslatedCharacters()); + hash = (37 * hash) + FAILED_CHARACTERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFailedCharacters()); + hash = (37 * hash) + TOTAL_BILLABLE_CHARACTERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTotalBillableCharacters()); + if (hasSubmitTime()) { + hash = (37 * hash) + SUBMIT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSubmitTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentResponse 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.v3.BatchTranslateDocumentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentResponse 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.v3.BatchTranslateDocumentResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentResponse 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.v3.BatchTranslateDocumentResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentResponse 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.v3.BatchTranslateDocumentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentResponse 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.v3.BatchTranslateDocumentResponse 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; + } + /** + * + * + *
+   * Stored in the
+   * [google.longrunning.Operation.response][google.longrunning.Operation.response]
+   * field returned by BatchTranslateDocument if at least one document is
+   * translated successfully.
+   * 
+ * + * Protobuf type {@code google.cloud.translation.v3.BatchTranslateDocumentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3.BatchTranslateDocumentResponse) + com.google.cloud.translate.v3.BatchTranslateDocumentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.BatchTranslateDocumentResponse.class, + com.google.cloud.translate.v3.BatchTranslateDocumentResponse.Builder.class); + } + + // Construct using com.google.cloud.translate.v3.BatchTranslateDocumentResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + totalPages_ = 0L; + + translatedPages_ = 0L; + + failedPages_ = 0L; + + totalBillablePages_ = 0L; + + totalCharacters_ = 0L; + + translatedCharacters_ = 0L; + + failedCharacters_ = 0L; + + totalBillableCharacters_ = 0L; + + if (submitTimeBuilder_ == null) { + submitTime_ = null; + } else { + submitTime_ = null; + submitTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_BatchTranslateDocumentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchTranslateDocumentResponse + getDefaultInstanceForType() { + return com.google.cloud.translate.v3.BatchTranslateDocumentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchTranslateDocumentResponse build() { + com.google.cloud.translate.v3.BatchTranslateDocumentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3.BatchTranslateDocumentResponse buildPartial() { + com.google.cloud.translate.v3.BatchTranslateDocumentResponse result = + new com.google.cloud.translate.v3.BatchTranslateDocumentResponse(this); + result.totalPages_ = totalPages_; + result.translatedPages_ = translatedPages_; + result.failedPages_ = failedPages_; + result.totalBillablePages_ = totalBillablePages_; + result.totalCharacters_ = totalCharacters_; + result.translatedCharacters_ = translatedCharacters_; + result.failedCharacters_ = failedCharacters_; + result.totalBillableCharacters_ = totalBillableCharacters_; + if (submitTimeBuilder_ == null) { + result.submitTime_ = submitTime_; + } else { + result.submitTime_ = submitTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.v3.BatchTranslateDocumentResponse) { + return mergeFrom((com.google.cloud.translate.v3.BatchTranslateDocumentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3.BatchTranslateDocumentResponse other) { + if (other + == com.google.cloud.translate.v3.BatchTranslateDocumentResponse.getDefaultInstance()) + return this; + if (other.getTotalPages() != 0L) { + setTotalPages(other.getTotalPages()); + } + if (other.getTranslatedPages() != 0L) { + setTranslatedPages(other.getTranslatedPages()); + } + if (other.getFailedPages() != 0L) { + setFailedPages(other.getFailedPages()); + } + if (other.getTotalBillablePages() != 0L) { + setTotalBillablePages(other.getTotalBillablePages()); + } + if (other.getTotalCharacters() != 0L) { + setTotalCharacters(other.getTotalCharacters()); + } + if (other.getTranslatedCharacters() != 0L) { + setTranslatedCharacters(other.getTranslatedCharacters()); + } + if (other.getFailedCharacters() != 0L) { + setFailedCharacters(other.getFailedCharacters()); + } + if (other.getTotalBillableCharacters() != 0L) { + setTotalBillableCharacters(other.getTotalBillableCharacters()); + } + if (other.hasSubmitTime()) { + mergeSubmitTime(other.getSubmitTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.translate.v3.BatchTranslateDocumentResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3.BatchTranslateDocumentResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long totalPages_; + /** + * + * + *
+     * Total number of pages to translate in all documents. Documents without
+     * clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 total_pages = 1; + * + * @return The totalPages. + */ + @java.lang.Override + public long getTotalPages() { + return totalPages_; + } + /** + * + * + *
+     * Total number of pages to translate in all documents. Documents without
+     * clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 total_pages = 1; + * + * @param value The totalPages to set. + * @return This builder for chaining. + */ + public Builder setTotalPages(long value) { + + totalPages_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Total number of pages to translate in all documents. Documents without
+     * clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 total_pages = 1; + * + * @return This builder for chaining. + */ + public Builder clearTotalPages() { + + totalPages_ = 0L; + onChanged(); + return this; + } + + private long translatedPages_; + /** + * + * + *
+     * Number of successfully translated pages in all documents. Documents without
+     * clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 translated_pages = 2; + * + * @return The translatedPages. + */ + @java.lang.Override + public long getTranslatedPages() { + return translatedPages_; + } + /** + * + * + *
+     * Number of successfully translated pages in all documents. Documents without
+     * clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 translated_pages = 2; + * + * @param value The translatedPages to set. + * @return This builder for chaining. + */ + public Builder setTranslatedPages(long value) { + + translatedPages_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of successfully translated pages in all documents. Documents without
+     * clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 translated_pages = 2; + * + * @return This builder for chaining. + */ + public Builder clearTranslatedPages() { + + translatedPages_ = 0L; + onChanged(); + return this; + } + + private long failedPages_; + /** + * + * + *
+     * Number of pages that failed to process in all documents. Documents without
+     * clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 failed_pages = 3; + * + * @return The failedPages. + */ + @java.lang.Override + public long getFailedPages() { + return failedPages_; + } + /** + * + * + *
+     * Number of pages that failed to process in all documents. Documents without
+     * clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 failed_pages = 3; + * + * @param value The failedPages to set. + * @return This builder for chaining. + */ + public Builder setFailedPages(long value) { + + failedPages_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of pages that failed to process in all documents. Documents without
+     * clear page definition (such as XLSX) are not counted.
+     * 
+ * + * int64 failed_pages = 3; + * + * @return This builder for chaining. + */ + public Builder clearFailedPages() { + + failedPages_ = 0L; + onChanged(); + return this; + } + + private long totalBillablePages_; + /** + * + * + *
+     * Number of billable pages in documents with clear page definition (such as
+     * PDF, DOCX, PPTX)
+     * 
+ * + * int64 total_billable_pages = 4; + * + * @return The totalBillablePages. + */ + @java.lang.Override + public long getTotalBillablePages() { + return totalBillablePages_; + } + /** + * + * + *
+     * Number of billable pages in documents with clear page definition (such as
+     * PDF, DOCX, PPTX)
+     * 
+ * + * int64 total_billable_pages = 4; + * + * @param value The totalBillablePages to set. + * @return This builder for chaining. + */ + public Builder setTotalBillablePages(long value) { + + totalBillablePages_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of billable pages in documents with clear page definition (such as
+     * PDF, DOCX, PPTX)
+     * 
+ * + * int64 total_billable_pages = 4; + * + * @return This builder for chaining. + */ + public Builder clearTotalBillablePages() { + + totalBillablePages_ = 0L; + onChanged(); + return this; + } + + private long totalCharacters_; + /** + * + * + *
+     * Total number of characters (Unicode codepoints) in all documents.
+     * 
+ * + * int64 total_characters = 5; + * + * @return The totalCharacters. + */ + @java.lang.Override + public long getTotalCharacters() { + return totalCharacters_; + } + /** + * + * + *
+     * Total number of characters (Unicode codepoints) in all documents.
+     * 
+ * + * int64 total_characters = 5; + * + * @param value The totalCharacters to set. + * @return This builder for chaining. + */ + public Builder setTotalCharacters(long value) { + + totalCharacters_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Total number of characters (Unicode codepoints) in all documents.
+     * 
+ * + * int64 total_characters = 5; + * + * @return This builder for chaining. + */ + public Builder clearTotalCharacters() { + + totalCharacters_ = 0L; + onChanged(); + return this; + } + + private long translatedCharacters_; + /** + * + * + *
+     * Number of successfully translated characters (Unicode codepoints) in all
+     * documents.
+     * 
+ * + * int64 translated_characters = 6; + * + * @return The translatedCharacters. + */ + @java.lang.Override + public long getTranslatedCharacters() { + return translatedCharacters_; + } + /** + * + * + *
+     * Number of successfully translated characters (Unicode codepoints) in all
+     * documents.
+     * 
+ * + * int64 translated_characters = 6; + * + * @param value The translatedCharacters to set. + * @return This builder for chaining. + */ + public Builder setTranslatedCharacters(long value) { + + translatedCharacters_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of successfully translated characters (Unicode codepoints) in all
+     * documents.
+     * 
+ * + * int64 translated_characters = 6; + * + * @return This builder for chaining. + */ + public Builder clearTranslatedCharacters() { + + translatedCharacters_ = 0L; + onChanged(); + return this; + } + + private long failedCharacters_; + /** + * + * + *
+     * Number of characters that have failed to process (Unicode codepoints) in
+     * all documents.
+     * 
+ * + * int64 failed_characters = 7; + * + * @return The failedCharacters. + */ + @java.lang.Override + public long getFailedCharacters() { + return failedCharacters_; + } + /** + * + * + *
+     * Number of characters that have failed to process (Unicode codepoints) in
+     * all documents.
+     * 
+ * + * int64 failed_characters = 7; + * + * @param value The failedCharacters to set. + * @return This builder for chaining. + */ + public Builder setFailedCharacters(long value) { + + failedCharacters_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of characters that have failed to process (Unicode codepoints) in
+     * all documents.
+     * 
+ * + * int64 failed_characters = 7; + * + * @return This builder for chaining. + */ + public Builder clearFailedCharacters() { + + failedCharacters_ = 0L; + onChanged(); + return this; + } + + private long totalBillableCharacters_; + /** + * + * + *
+     * Number of billable characters (Unicode codepoints) in documents without
+     * clear page definition, such as XLSX.
+     * 
+ * + * int64 total_billable_characters = 8; + * + * @return The totalBillableCharacters. + */ + @java.lang.Override + public long getTotalBillableCharacters() { + return totalBillableCharacters_; + } + /** + * + * + *
+     * Number of billable characters (Unicode codepoints) in documents without
+     * clear page definition, such as XLSX.
+     * 
+ * + * int64 total_billable_characters = 8; + * + * @param value The totalBillableCharacters to set. + * @return This builder for chaining. + */ + public Builder setTotalBillableCharacters(long value) { + + totalBillableCharacters_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of billable characters (Unicode codepoints) in documents without
+     * clear page definition, such as XLSX.
+     * 
+ * + * int64 total_billable_characters = 8; + * + * @return This builder for chaining. + */ + public Builder clearTotalBillableCharacters() { + + totalBillableCharacters_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp submitTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + submitTimeBuilder_; + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + * + * @return Whether the submitTime field is set. + */ + public boolean hasSubmitTime() { + return submitTimeBuilder_ != null || submitTime_ != null; + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + * + * @return The submitTime. + */ + public com.google.protobuf.Timestamp getSubmitTime() { + if (submitTimeBuilder_ == null) { + return submitTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : submitTime_; + } else { + return submitTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + */ + public Builder setSubmitTime(com.google.protobuf.Timestamp value) { + if (submitTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + submitTime_ = value; + onChanged(); + } else { + submitTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + */ + public Builder setSubmitTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (submitTimeBuilder_ == null) { + submitTime_ = builderForValue.build(); + onChanged(); + } else { + submitTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + */ + public Builder mergeSubmitTime(com.google.protobuf.Timestamp value) { + if (submitTimeBuilder_ == null) { + if (submitTime_ != null) { + submitTime_ = + com.google.protobuf.Timestamp.newBuilder(submitTime_).mergeFrom(value).buildPartial(); + } else { + submitTime_ = value; + } + onChanged(); + } else { + submitTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + */ + public Builder clearSubmitTime() { + if (submitTimeBuilder_ == null) { + submitTime_ = null; + onChanged(); + } else { + submitTime_ = null; + submitTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + */ + public com.google.protobuf.Timestamp.Builder getSubmitTimeBuilder() { + + onChanged(); + return getSubmitTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + */ + public com.google.protobuf.TimestampOrBuilder getSubmitTimeOrBuilder() { + if (submitTimeBuilder_ != null) { + return submitTimeBuilder_.getMessageOrBuilder(); + } else { + return submitTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : submitTime_; + } + } + /** + * + * + *
+     * Time when the operation was submitted.
+     * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSubmitTimeFieldBuilder() { + if (submitTimeBuilder_ == null) { + submitTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSubmitTime(), getParentForChildren(), isClean()); + submitTime_ = null; + } + return submitTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The time when the operation is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 10; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The time when the operation is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 10; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the operation is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 10; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the operation is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 10; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the operation is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 10; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the operation is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 10; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the operation is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 10; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the operation is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * The time when the operation is finished and
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + @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.v3.BatchTranslateDocumentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3.BatchTranslateDocumentResponse) + private static final com.google.cloud.translate.v3.BatchTranslateDocumentResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3.BatchTranslateDocumentResponse(); + } + + public static com.google.cloud.translate.v3.BatchTranslateDocumentResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchTranslateDocumentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchTranslateDocumentResponse(input, extensionRegistry); + } + }; + + 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.v3.BatchTranslateDocumentResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentResponseOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentResponseOrBuilder.java new file mode 100644 index 00000000..748a8f9c --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateDocumentResponseOrBuilder.java @@ -0,0 +1,212 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +public interface BatchTranslateDocumentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3.BatchTranslateDocumentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Total number of pages to translate in all documents. Documents without
+   * clear page definition (such as XLSX) are not counted.
+   * 
+ * + * int64 total_pages = 1; + * + * @return The totalPages. + */ + long getTotalPages(); + + /** + * + * + *
+   * Number of successfully translated pages in all documents. Documents without
+   * clear page definition (such as XLSX) are not counted.
+   * 
+ * + * int64 translated_pages = 2; + * + * @return The translatedPages. + */ + long getTranslatedPages(); + + /** + * + * + *
+   * Number of pages that failed to process in all documents. Documents without
+   * clear page definition (such as XLSX) are not counted.
+   * 
+ * + * int64 failed_pages = 3; + * + * @return The failedPages. + */ + long getFailedPages(); + + /** + * + * + *
+   * Number of billable pages in documents with clear page definition (such as
+   * PDF, DOCX, PPTX)
+   * 
+ * + * int64 total_billable_pages = 4; + * + * @return The totalBillablePages. + */ + long getTotalBillablePages(); + + /** + * + * + *
+   * Total number of characters (Unicode codepoints) in all documents.
+   * 
+ * + * int64 total_characters = 5; + * + * @return The totalCharacters. + */ + long getTotalCharacters(); + + /** + * + * + *
+   * Number of successfully translated characters (Unicode codepoints) in all
+   * documents.
+   * 
+ * + * int64 translated_characters = 6; + * + * @return The translatedCharacters. + */ + long getTranslatedCharacters(); + + /** + * + * + *
+   * Number of characters that have failed to process (Unicode codepoints) in
+   * all documents.
+   * 
+ * + * int64 failed_characters = 7; + * + * @return The failedCharacters. + */ + long getFailedCharacters(); + + /** + * + * + *
+   * Number of billable characters (Unicode codepoints) in documents without
+   * clear page definition, such as XLSX.
+   * 
+ * + * int64 total_billable_characters = 8; + * + * @return The totalBillableCharacters. + */ + long getTotalBillableCharacters(); + + /** + * + * + *
+   * Time when the operation was submitted.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + * + * @return Whether the submitTime field is set. + */ + boolean hasSubmitTime(); + /** + * + * + *
+   * Time when the operation was submitted.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + * + * @return The submitTime. + */ + com.google.protobuf.Timestamp getSubmitTime(); + /** + * + * + *
+   * Time when the operation was submitted.
+   * 
+ * + * .google.protobuf.Timestamp submit_time = 9; + */ + com.google.protobuf.TimestampOrBuilder getSubmitTimeOrBuilder(); + + /** + * + * + *
+   * The time when the operation is finished and
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 10; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * The time when the operation is finished and
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 10; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The time when the operation is finished and
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 10; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateTextRequest.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateTextRequest.java index acc57eba..986c4629 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateTextRequest.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateTextRequest.java @@ -438,7 +438,6 @@ public int getModelsCount() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -470,7 +469,6 @@ public java.util.Map getModels() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -493,7 +491,6 @@ public java.util.Map getModelsMap() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -520,7 +517,6 @@ public java.lang.String getModelsOrDefault(java.lang.String key, java.lang.Strin * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -546,7 +542,7 @@ public java.lang.String getModelsOrThrow(java.lang.String key) { * *
    * Required. Input configurations.
-   * The total number of files matched should be <= 1000.
+   * The total number of files matched should be <= 100.
    * The total content size should be <= 100M Unicode codepoints.
    * The files must use UTF-8 encoding.
    * 
@@ -564,7 +560,7 @@ public java.util.List getInputConfigs * *
    * Required. Input configurations.
-   * The total number of files matched should be <= 1000.
+   * The total number of files matched should be <= 100.
    * The total content size should be <= 100M Unicode codepoints.
    * The files must use UTF-8 encoding.
    * 
@@ -583,7 +579,7 @@ public java.util.List getInputConfigs * *
    * Required. Input configurations.
-   * The total number of files matched should be <= 1000.
+   * The total number of files matched should be <= 100.
    * The total content size should be <= 100M Unicode codepoints.
    * The files must use UTF-8 encoding.
    * 
@@ -601,7 +597,7 @@ public int getInputConfigsCount() { * *
    * Required. Input configurations.
-   * The total number of files matched should be <= 1000.
+   * The total number of files matched should be <= 100.
    * The total content size should be <= 100M Unicode codepoints.
    * The files must use UTF-8 encoding.
    * 
@@ -619,7 +615,7 @@ public com.google.cloud.translate.v3.InputConfig getInputConfigs(int index) { * *
    * Required. Input configurations.
-   * The total number of files matched should be <= 1000.
+   * The total number of files matched should be <= 100.
    * The total content size should be <= 100M Unicode codepoints.
    * The files must use UTF-8 encoding.
    * 
@@ -853,7 +849,8 @@ public int getLabelsCount() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -880,7 +877,8 @@ public java.util.Map getLabels() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -898,7 +896,8 @@ public java.util.Map getLabelsMap() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -920,7 +919,8 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -1946,7 +1946,6 @@ public int getModelsCount() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -1978,7 +1977,6 @@ public java.util.Map getModels() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -2001,7 +1999,6 @@ public java.util.Map getModelsMap() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -2029,7 +2026,6 @@ public java.lang.String getModelsOrDefault( * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -2064,7 +2060,6 @@ public Builder clearModels() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -2095,7 +2090,6 @@ public java.util.Map getMutableModels() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -2124,7 +2118,6 @@ public Builder putModels(java.lang.String key, java.lang.String value) { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -2158,7 +2151,7 @@ private void ensureInputConfigsIsMutable() { * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2179,7 +2172,7 @@ public java.util.List getInputConfigs * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2200,7 +2193,7 @@ public int getInputConfigsCount() { * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2221,7 +2214,7 @@ public com.google.cloud.translate.v3.InputConfig getInputConfigs(int index) { * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2248,7 +2241,7 @@ public Builder setInputConfigs(int index, com.google.cloud.translate.v3.InputCon * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2273,7 +2266,7 @@ public Builder setInputConfigs( * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2300,7 +2293,7 @@ public Builder addInputConfigs(com.google.cloud.translate.v3.InputConfig value) * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2327,7 +2320,7 @@ public Builder addInputConfigs(int index, com.google.cloud.translate.v3.InputCon * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2352,7 +2345,7 @@ public Builder addInputConfigs( * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2377,7 +2370,7 @@ public Builder addInputConfigs( * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2402,7 +2395,7 @@ public Builder addAllInputConfigs( * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2426,7 +2419,7 @@ public Builder clearInputConfigs() { * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2450,7 +2443,7 @@ public Builder removeInputConfigs(int index) { * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2467,7 +2460,7 @@ public com.google.cloud.translate.v3.InputConfig.Builder getInputConfigsBuilder( * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2488,7 +2481,7 @@ public com.google.cloud.translate.v3.InputConfigOrBuilder getInputConfigsOrBuild * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2510,7 +2503,7 @@ public com.google.cloud.translate.v3.InputConfigOrBuilder getInputConfigsOrBuild * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2528,7 +2521,7 @@ public com.google.cloud.translate.v3.InputConfig.Builder addInputConfigsBuilder( * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -2546,7 +2539,7 @@ public com.google.cloud.translate.v3.InputConfig.Builder addInputConfigsBuilder( * *
      * Required. Input configurations.
-     * The total number of files matched should be <= 1000.
+     * The total number of files matched should be <= 100.
      * The total content size should be <= 100M Unicode codepoints.
      * The files must use UTF-8 encoding.
      * 
@@ -3031,7 +3024,8 @@ public int getLabelsCount() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -3058,7 +3052,8 @@ public java.util.Map getLabels() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -3076,7 +3071,8 @@ public java.util.Map getLabelsMap() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -3099,7 +3095,8 @@ public java.lang.String getLabelsOrDefault( * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -3129,7 +3126,8 @@ public Builder clearLabels() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -3155,7 +3153,8 @@ public java.util.Map getMutableLabels() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -3179,7 +3178,8 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateTextRequestOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateTextRequestOrBuilder.java index 328651e2..06bc5fef 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateTextRequestOrBuilder.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/BatchTranslateTextRequestOrBuilder.java @@ -154,7 +154,6 @@ public interface BatchTranslateTextRequestOrBuilder * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -174,7 +173,6 @@ public interface BatchTranslateTextRequestOrBuilder * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -197,7 +195,6 @@ public interface BatchTranslateTextRequestOrBuilder * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -217,7 +214,6 @@ public interface BatchTranslateTextRequestOrBuilder * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -237,7 +233,6 @@ public interface BatchTranslateTextRequestOrBuilder * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * If the map is empty or a specific model is * not requested for a language pair, then default google model (nmt) is used. * @@ -251,7 +246,7 @@ public interface BatchTranslateTextRequestOrBuilder * *
    * Required. Input configurations.
-   * The total number of files matched should be <= 1000.
+   * The total number of files matched should be <= 100.
    * The total content size should be <= 100M Unicode codepoints.
    * The files must use UTF-8 encoding.
    * 
@@ -266,7 +261,7 @@ public interface BatchTranslateTextRequestOrBuilder * *
    * Required. Input configurations.
-   * The total number of files matched should be <= 1000.
+   * The total number of files matched should be <= 100.
    * The total content size should be <= 100M Unicode codepoints.
    * The files must use UTF-8 encoding.
    * 
@@ -281,7 +276,7 @@ public interface BatchTranslateTextRequestOrBuilder * *
    * Required. Input configurations.
-   * The total number of files matched should be <= 1000.
+   * The total number of files matched should be <= 100.
    * The total content size should be <= 100M Unicode codepoints.
    * The files must use UTF-8 encoding.
    * 
@@ -296,7 +291,7 @@ public interface BatchTranslateTextRequestOrBuilder * *
    * Required. Input configurations.
-   * The total number of files matched should be <= 1000.
+   * The total number of files matched should be <= 100.
    * The total content size should be <= 100M Unicode codepoints.
    * The files must use UTF-8 encoding.
    * 
@@ -312,7 +307,7 @@ public interface BatchTranslateTextRequestOrBuilder * *
    * Required. Input configurations.
-   * The total number of files matched should be <= 1000.
+   * The total number of files matched should be <= 100.
    * The total content size should be <= 100M Unicode codepoints.
    * The files must use UTF-8 encoding.
    * 
@@ -452,7 +447,8 @@ com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossariesOrThrow( * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -467,7 +463,8 @@ com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossariesOrThrow( * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -485,7 +482,8 @@ com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossariesOrThrow( * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -500,7 +498,8 @@ com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossariesOrThrow( * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; @@ -515,7 +514,8 @@ com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossariesOrThrow( * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageRequest.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageRequest.java index ca7cf91b..4904295e 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageRequest.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageRequest.java @@ -484,7 +484,8 @@ public int getLabelsCount() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -511,7 +512,8 @@ public java.util.Map getLabels() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -529,7 +531,8 @@ public java.util.Map getLabelsMap() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -551,7 +554,8 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -1578,7 +1582,8 @@ public int getLabelsCount() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -1605,7 +1610,8 @@ public java.util.Map getLabels() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -1623,7 +1629,8 @@ public java.util.Map getLabelsMap() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -1646,7 +1653,8 @@ public java.lang.String getLabelsOrDefault( * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -1676,7 +1684,8 @@ public Builder clearLabels() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -1702,7 +1711,8 @@ public java.util.Map getMutableLabels() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -1726,7 +1736,8 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageRequestOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageRequestOrBuilder.java index 0e2d4ee6..df6f7e15 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageRequestOrBuilder.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageRequestOrBuilder.java @@ -174,7 +174,8 @@ public interface DetectLanguageRequestOrBuilder * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -189,7 +190,8 @@ public interface DetectLanguageRequestOrBuilder * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -207,7 +209,8 @@ public interface DetectLanguageRequestOrBuilder * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -222,7 +225,8 @@ public interface DetectLanguageRequestOrBuilder * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -237,7 +241,8 @@ public interface DetectLanguageRequestOrBuilder * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageResponse.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageResponse.java index 008f9eb6..e2be566e 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageResponse.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageResponse.java @@ -126,8 +126,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * A list of detected languages sorted by detection confidence in descending
-   * order. The most probable language first.
+   * The most probable language detected by the Translation API. For each
+   * request, the Translation API will always return only one result.
    * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -140,8 +140,8 @@ public java.util.List getLanguag * * *
-   * A list of detected languages sorted by detection confidence in descending
-   * order. The most probable language first.
+   * The most probable language detected by the Translation API. For each
+   * request, the Translation API will always return only one result.
    * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -155,8 +155,8 @@ public java.util.List getLanguag * * *
-   * A list of detected languages sorted by detection confidence in descending
-   * order. The most probable language first.
+   * The most probable language detected by the Translation API. For each
+   * request, the Translation API will always return only one result.
    * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -169,8 +169,8 @@ public int getLanguagesCount() { * * *
-   * A list of detected languages sorted by detection confidence in descending
-   * order. The most probable language first.
+   * The most probable language detected by the Translation API. For each
+   * request, the Translation API will always return only one result.
    * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -183,8 +183,8 @@ public com.google.cloud.translate.v3.DetectedLanguage getLanguages(int index) { * * *
-   * A list of detected languages sorted by detection confidence in descending
-   * order. The most probable language first.
+   * The most probable language detected by the Translation API. For each
+   * request, the Translation API will always return only one result.
    * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -575,8 +575,8 @@ private void ensureLanguagesIsMutable() { * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -592,8 +592,8 @@ public java.util.List getLanguag * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -609,8 +609,8 @@ public int getLanguagesCount() { * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -626,8 +626,8 @@ public com.google.cloud.translate.v3.DetectedLanguage getLanguages(int index) { * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -649,8 +649,8 @@ public Builder setLanguages(int index, com.google.cloud.translate.v3.DetectedLan * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -670,8 +670,8 @@ public Builder setLanguages( * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -693,8 +693,8 @@ public Builder addLanguages(com.google.cloud.translate.v3.DetectedLanguage value * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -716,8 +716,8 @@ public Builder addLanguages(int index, com.google.cloud.translate.v3.DetectedLan * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -737,8 +737,8 @@ public Builder addLanguages( * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -758,8 +758,8 @@ public Builder addLanguages( * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -779,8 +779,8 @@ public Builder addAllLanguages( * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -799,8 +799,8 @@ public Builder clearLanguages() { * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -819,8 +819,8 @@ public Builder removeLanguages(int index) { * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -832,8 +832,8 @@ public com.google.cloud.translate.v3.DetectedLanguage.Builder getLanguagesBuilde * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -850,8 +850,8 @@ public com.google.cloud.translate.v3.DetectedLanguageOrBuilder getLanguagesOrBui * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -868,8 +868,8 @@ public com.google.cloud.translate.v3.DetectedLanguageOrBuilder getLanguagesOrBui * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -882,8 +882,8 @@ public com.google.cloud.translate.v3.DetectedLanguage.Builder addLanguagesBuilde * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -896,8 +896,8 @@ public com.google.cloud.translate.v3.DetectedLanguage.Builder addLanguagesBuilde * * *
-     * A list of detected languages sorted by detection confidence in descending
-     * order. The most probable language first.
+     * The most probable language detected by the Translation API. For each
+     * request, the Translation API will always return only one result.
      * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageResponseOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageResponseOrBuilder.java index d5461c3f..b0ef344a 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageResponseOrBuilder.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DetectLanguageResponseOrBuilder.java @@ -27,8 +27,8 @@ public interface DetectLanguageResponseOrBuilder * * *
-   * A list of detected languages sorted by detection confidence in descending
-   * order. The most probable language first.
+   * The most probable language detected by the Translation API. For each
+   * request, the Translation API will always return only one result.
    * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -38,8 +38,8 @@ public interface DetectLanguageResponseOrBuilder * * *
-   * A list of detected languages sorted by detection confidence in descending
-   * order. The most probable language first.
+   * The most probable language detected by the Translation API. For each
+   * request, the Translation API will always return only one result.
    * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -49,8 +49,8 @@ public interface DetectLanguageResponseOrBuilder * * *
-   * A list of detected languages sorted by detection confidence in descending
-   * order. The most probable language first.
+   * The most probable language detected by the Translation API. For each
+   * request, the Translation API will always return only one result.
    * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -60,8 +60,8 @@ public interface DetectLanguageResponseOrBuilder * * *
-   * A list of detected languages sorted by detection confidence in descending
-   * order. The most probable language first.
+   * The most probable language detected by the Translation API. For each
+   * request, the Translation API will always return only one result.
    * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; @@ -72,8 +72,8 @@ public interface DetectLanguageResponseOrBuilder * * *
-   * A list of detected languages sorted by detection confidence in descending
-   * order. The most probable language first.
+   * The most probable language detected by the Translation API. For each
+   * request, the Translation API will always return only one result.
    * 
* * repeated .google.cloud.translation.v3.DetectedLanguage languages = 1; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentInputConfig.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentInputConfig.java new file mode 100644 index 00000000..4b526b2b --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentInputConfig.java @@ -0,0 +1,1221 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +/** + * + * + *
+ * A document translation request input config.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3.DocumentInputConfig} + */ +public final class DocumentInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3.DocumentInputConfig) + DocumentInputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentInputConfig.newBuilder() to construct. + private DocumentInputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentInputConfig() { + mimeType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DocumentInputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentInputConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + sourceCase_ = 1; + source_ = input.readBytes(); + break; + } + case 18: + { + com.google.cloud.translate.v3.GcsSource.Builder subBuilder = null; + if (sourceCase_ == 2) { + subBuilder = ((com.google.cloud.translate.v3.GcsSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.translate.v3.GcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.translate.v3.GcsSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 2; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + mimeType_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.DocumentInputConfig.class, + com.google.cloud.translate.v3.DocumentInputConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CONTENT(1), + GCS_SOURCE(2), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return CONTENT; + case 2: + return GCS_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + /** + * + * + *
+   * Document's content represented as a stream of bytes.
+   * 
+ * + * bytes content = 1; + * + * @return Whether the content field is set. + */ + @java.lang.Override + public boolean hasContent() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * Document's content represented as a stream of bytes.
+   * 
+ * + * bytes content = 1; + * + * @return The content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContent() { + if (sourceCase_ == 1) { + return (com.google.protobuf.ByteString) source_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 2; + /** + * + * + *
+   * Google Cloud Storage location. This must be a single file.
+   * For example: gs://example_bucket/example_file.pdf
+   * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+   * Google Cloud Storage location. This must be a single file.
+   * For example: gs://example_bucket/example_file.pdf
+   * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsSource getGcsSource() { + if (sourceCase_ == 2) { + return (com.google.cloud.translate.v3.GcsSource) source_; + } + return com.google.cloud.translate.v3.GcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * Google Cloud Storage location. This must be a single file.
+   * For example: gs://example_bucket/example_file.pdf
+   * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.cloud.translate.v3.GcsSource) source_; + } + return com.google.cloud.translate.v3.GcsSource.getDefaultInstance(); + } + + public static final int MIME_TYPE_FIELD_NUMBER = 4; + private volatile java.lang.Object mimeType_; + /** + * + * + *
+   * Specifies the input document's mime_type.
+   * If not specified it will be determined using the file extension for
+   * gcs_source provided files. For a file provided through bytes content the
+   * mime_type must be provided.
+   * Currently supported mime types are:
+   * - application/pdf
+   * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * 
+ * + * string mime_type = 4; + * + * @return The mimeType. + */ + @java.lang.Override + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + 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(); + mimeType_ = s; + return s; + } + } + /** + * + * + *
+   * Specifies the input document's mime_type.
+   * If not specified it will be determined using the file extension for
+   * gcs_source provided files. For a file provided through bytes content the
+   * mime_type must be provided.
+   * Currently supported mime types are:
+   * - application/pdf
+   * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * 
+ * + * string mime_type = 4; + * + * @return The bytes for mimeType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (sourceCase_ == 1) { + output.writeBytes(1, (com.google.protobuf.ByteString) source_); + } + if (sourceCase_ == 2) { + output.writeMessage(2, (com.google.cloud.translate.v3.GcsSource) source_); + } + if (!getMimeTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, mimeType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 1, (com.google.protobuf.ByteString) source_); + } + if (sourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.translate.v3.GcsSource) source_); + } + if (!getMimeTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, mimeType_); + } + size += unknownFields.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.v3.DocumentInputConfig)) { + return super.equals(obj); + } + com.google.cloud.translate.v3.DocumentInputConfig other = + (com.google.cloud.translate.v3.DocumentInputConfig) obj; + + if (!getMimeType().equals(other.getMimeType())) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getContent().equals(other.getContent())) return false; + break; + case 2: + if (!getGcsSource().equals(other.getGcsSource())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) 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) + MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMimeType().hashCode(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + break; + case 2: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.translate.v3.DocumentInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.DocumentInputConfig 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.v3.DocumentInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.DocumentInputConfig 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.v3.DocumentInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.DocumentInputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.translate.v3.DocumentInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.DocumentInputConfig 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.v3.DocumentInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.DocumentInputConfig 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.v3.DocumentInputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.DocumentInputConfig 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.v3.DocumentInputConfig 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; + } + /** + * + * + *
+   * A document translation request input config.
+   * 
+ * + * Protobuf type {@code google.cloud.translation.v3.DocumentInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3.DocumentInputConfig) + com.google.cloud.translate.v3.DocumentInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.DocumentInputConfig.class, + com.google.cloud.translate.v3.DocumentInputConfig.Builder.class); + } + + // Construct using com.google.cloud.translate.v3.DocumentInputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + mimeType_ = ""; + + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3.DocumentInputConfig getDefaultInstanceForType() { + return com.google.cloud.translate.v3.DocumentInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3.DocumentInputConfig build() { + com.google.cloud.translate.v3.DocumentInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3.DocumentInputConfig buildPartial() { + com.google.cloud.translate.v3.DocumentInputConfig result = + new com.google.cloud.translate.v3.DocumentInputConfig(this); + if (sourceCase_ == 1) { + result.source_ = source_; + } + if (sourceCase_ == 2) { + if (gcsSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = gcsSourceBuilder_.build(); + } + } + result.mimeType_ = mimeType_; + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + @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.v3.DocumentInputConfig) { + return mergeFrom((com.google.cloud.translate.v3.DocumentInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3.DocumentInputConfig other) { + if (other == com.google.cloud.translate.v3.DocumentInputConfig.getDefaultInstance()) + return this; + if (!other.getMimeType().isEmpty()) { + mimeType_ = other.mimeType_; + onChanged(); + } + switch (other.getSourceCase()) { + case CONTENT: + { + setContent(other.getContent()); + break; + } + case GCS_SOURCE: + { + mergeGcsSource(other.getGcsSource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.translate.v3.DocumentInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3.DocumentInputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Document's content represented as a stream of bytes.
+     * 
+ * + * bytes content = 1; + * + * @return Whether the content field is set. + */ + public boolean hasContent() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * Document's content represented as a stream of bytes.
+     * 
+ * + * bytes content = 1; + * + * @return The content. + */ + public com.google.protobuf.ByteString getContent() { + if (sourceCase_ == 1) { + return (com.google.protobuf.ByteString) source_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+     * Document's content represented as a stream of bytes.
+     * 
+ * + * bytes content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCase_ = 1; + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Document's content represented as a stream of bytes.
+     * 
+ * + * bytes content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.GcsSource, + com.google.cloud.translate.v3.GcsSource.Builder, + com.google.cloud.translate.v3.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Google Cloud Storage location. This must be a single file.
+     * For example: gs://example_bucket/example_file.pdf
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+     * Google Cloud Storage location. This must be a single file.
+     * For example: gs://example_bucket/example_file.pdf
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.cloud.translate.v3.GcsSource) source_; + } + return com.google.cloud.translate.v3.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.translate.v3.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage location. This must be a single file.
+     * For example: gs://example_bucket/example_file.pdf
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + */ + public Builder setGcsSource(com.google.cloud.translate.v3.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location. This must be a single file.
+     * For example: gs://example_bucket/example_file.pdf
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + */ + public Builder setGcsSource(com.google.cloud.translate.v3.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location. This must be a single file.
+     * For example: gs://example_bucket/example_file.pdf
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + */ + public Builder mergeGcsSource(com.google.cloud.translate.v3.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2 + && source_ != com.google.cloud.translate.v3.GcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.translate.v3.GcsSource.newBuilder( + (com.google.cloud.translate.v3.GcsSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + gcsSourceBuilder_.mergeFrom(value); + } + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Google Cloud Storage location. This must be a single file.
+     * For example: gs://example_bucket/example_file.pdf
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + gcsSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Google Cloud Storage location. This must be a single file.
+     * For example: gs://example_bucket/example_file.pdf
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + */ + public com.google.cloud.translate.v3.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Google Cloud Storage location. This must be a single file.
+     * For example: gs://example_bucket/example_file.pdf
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 2) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.cloud.translate.v3.GcsSource) source_; + } + return com.google.cloud.translate.v3.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage location. This must be a single file.
+     * For example: gs://example_bucket/example_file.pdf
+     * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.GcsSource, + com.google.cloud.translate.v3.GcsSource.Builder, + com.google.cloud.translate.v3.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = com.google.cloud.translate.v3.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.GcsSource, + com.google.cloud.translate.v3.GcsSource.Builder, + com.google.cloud.translate.v3.GcsSourceOrBuilder>( + (com.google.cloud.translate.v3.GcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged(); + ; + return gcsSourceBuilder_; + } + + private java.lang.Object mimeType_ = ""; + /** + * + * + *
+     * Specifies the input document's mime_type.
+     * If not specified it will be determined using the file extension for
+     * gcs_source provided files. For a file provided through bytes content the
+     * mime_type must be provided.
+     * Currently supported mime types are:
+     * - application/pdf
+     * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * 
+ * + * string mime_type = 4; + * + * @return The mimeType. + */ + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Specifies the input document's mime_type.
+     * If not specified it will be determined using the file extension for
+     * gcs_source provided files. For a file provided through bytes content the
+     * mime_type must be provided.
+     * Currently supported mime types are:
+     * - application/pdf
+     * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * 
+ * + * string mime_type = 4; + * + * @return The bytes for mimeType. + */ + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Specifies the input document's mime_type.
+     * If not specified it will be determined using the file extension for
+     * gcs_source provided files. For a file provided through bytes content the
+     * mime_type must be provided.
+     * Currently supported mime types are:
+     * - application/pdf
+     * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * 
+ * + * string mime_type = 4; + * + * @param value The mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mimeType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the input document's mime_type.
+     * If not specified it will be determined using the file extension for
+     * gcs_source provided files. For a file provided through bytes content the
+     * mime_type must be provided.
+     * Currently supported mime types are:
+     * - application/pdf
+     * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * 
+ * + * string mime_type = 4; + * + * @return This builder for chaining. + */ + public Builder clearMimeType() { + + mimeType_ = getDefaultInstance().getMimeType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the input document's mime_type.
+     * If not specified it will be determined using the file extension for
+     * gcs_source provided files. For a file provided through bytes content the
+     * mime_type must be provided.
+     * Currently supported mime types are:
+     * - application/pdf
+     * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * 
+ * + * string mime_type = 4; + * + * @param value The bytes for mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mimeType_ = value; + 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.v3.DocumentInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3.DocumentInputConfig) + private static final com.google.cloud.translate.v3.DocumentInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3.DocumentInputConfig(); + } + + public static com.google.cloud.translate.v3.DocumentInputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentInputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentInputConfig(input, extensionRegistry); + } + }; + + 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.v3.DocumentInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentInputConfigOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentInputConfigOrBuilder.java new file mode 100644 index 00000000..5ef7fe41 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentInputConfigOrBuilder.java @@ -0,0 +1,131 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +public interface DocumentInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3.DocumentInputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Document's content represented as a stream of bytes.
+   * 
+ * + * bytes content = 1; + * + * @return Whether the content field is set. + */ + boolean hasContent(); + /** + * + * + *
+   * Document's content represented as a stream of bytes.
+   * 
+ * + * bytes content = 1; + * + * @return The content. + */ + com.google.protobuf.ByteString getContent(); + + /** + * + * + *
+   * Google Cloud Storage location. This must be a single file.
+   * For example: gs://example_bucket/example_file.pdf
+   * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * Google Cloud Storage location. This must be a single file.
+   * For example: gs://example_bucket/example_file.pdf
+   * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + com.google.cloud.translate.v3.GcsSource getGcsSource(); + /** + * + * + *
+   * Google Cloud Storage location. This must be a single file.
+   * For example: gs://example_bucket/example_file.pdf
+   * 
+ * + * .google.cloud.translation.v3.GcsSource gcs_source = 2; + */ + com.google.cloud.translate.v3.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * Specifies the input document's mime_type.
+   * If not specified it will be determined using the file extension for
+   * gcs_source provided files. For a file provided through bytes content the
+   * mime_type must be provided.
+   * Currently supported mime types are:
+   * - application/pdf
+   * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * 
+ * + * string mime_type = 4; + * + * @return The mimeType. + */ + java.lang.String getMimeType(); + /** + * + * + *
+   * Specifies the input document's mime_type.
+   * If not specified it will be determined using the file extension for
+   * gcs_source provided files. For a file provided through bytes content the
+   * mime_type must be provided.
+   * Currently supported mime types are:
+   * - application/pdf
+   * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * 
+ * + * string mime_type = 4; + * + * @return The bytes for mimeType. + */ + com.google.protobuf.ByteString getMimeTypeBytes(); + + public com.google.cloud.translate.v3.DocumentInputConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentOutputConfig.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentOutputConfig.java new file mode 100644 index 00000000..11959ae0 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentOutputConfig.java @@ -0,0 +1,1492 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +/** + * + * + *
+ * A document translation request output config.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3.DocumentOutputConfig} + */ +public final class DocumentOutputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3.DocumentOutputConfig) + DocumentOutputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentOutputConfig.newBuilder() to construct. + private DocumentOutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentOutputConfig() { + mimeType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DocumentOutputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentOutputConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.translate.v3.GcsDestination.Builder subBuilder = null; + if (destinationCase_ == 1) { + subBuilder = + ((com.google.cloud.translate.v3.GcsDestination) destination_).toBuilder(); + } + destination_ = + input.readMessage( + com.google.cloud.translate.v3.GcsDestination.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.translate.v3.GcsDestination) destination_); + destination_ = subBuilder.buildPartial(); + } + destinationCase_ = 1; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + mimeType_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.DocumentOutputConfig.class, + com.google.cloud.translate.v3.DocumentOutputConfig.Builder.class); + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_DESTINATION(1), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_DESTINATION; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; + /** + * + * + *
+   * Optional. Google Cloud Storage destination for the translation output,
+   * e.g., `gs://my_bucket/my_directory/`.
+   * The destination directory provided does not have to be empty, but the
+   * bucket must exist. If a file with the same name as the output file
+   * already exists in the destination an error will be returned.
+   * For a DocumentInputConfig.contents provided document, the output file
+   * will have the name "output_[trg]_translations.[ext]", where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * For a DocumentInputConfig.gcs_uri provided document, the output file will
+   * have a name according to its URI. For example: an input file with URI:
+   * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+   * "my_bucket" will have an output URI:
+   * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * If the document was directly provided through the request, then the
+   * output document will have the format:
+   * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * If a glossary was provided, then the output URI for the glossary
+   * translation will be equal to the default output URI but have
+   * `glossary_translations` instead of `translations`. For the previous
+   * example, its glossary URI would be:
+   * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+   * Thus the max number of output files will be 2 (Translated document,
+   * Glossary translated document).
+   * Callers should expect no partial outputs. If there is any error during
+   * document translation, no output will be stored in the Cloud Storage
+   * bucket.
+   * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * Optional. Google Cloud Storage destination for the translation output,
+   * e.g., `gs://my_bucket/my_directory/`.
+   * The destination directory provided does not have to be empty, but the
+   * bucket must exist. If a file with the same name as the output file
+   * already exists in the destination an error will be returned.
+   * For a DocumentInputConfig.contents provided document, the output file
+   * will have the name "output_[trg]_translations.[ext]", where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * For a DocumentInputConfig.gcs_uri provided document, the output file will
+   * have a name according to its URI. For example: an input file with URI:
+   * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+   * "my_bucket" will have an output URI:
+   * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * If the document was directly provided through the request, then the
+   * output document will have the format:
+   * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * If a glossary was provided, then the output URI for the glossary
+   * translation will be equal to the default output URI but have
+   * `glossary_translations` instead of `translations`. For the previous
+   * example, its glossary URI would be:
+   * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+   * Thus the max number of output files will be 2 (Translated document,
+   * Glossary translated document).
+   * Callers should expect no partial outputs. If there is any error during
+   * document translation, no output will be stored in the Cloud Storage
+   * bucket.
+   * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsDestination getGcsDestination() { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3.GcsDestination) destination_; + } + return com.google.cloud.translate.v3.GcsDestination.getDefaultInstance(); + } + /** + * + * + *
+   * Optional. Google Cloud Storage destination for the translation output,
+   * e.g., `gs://my_bucket/my_directory/`.
+   * The destination directory provided does not have to be empty, but the
+   * bucket must exist. If a file with the same name as the output file
+   * already exists in the destination an error will be returned.
+   * For a DocumentInputConfig.contents provided document, the output file
+   * will have the name "output_[trg]_translations.[ext]", where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * For a DocumentInputConfig.gcs_uri provided document, the output file will
+   * have a name according to its URI. For example: an input file with URI:
+   * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+   * "my_bucket" will have an output URI:
+   * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * If the document was directly provided through the request, then the
+   * output document will have the format:
+   * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * If a glossary was provided, then the output URI for the glossary
+   * translation will be equal to the default output URI but have
+   * `glossary_translations` instead of `translations`. For the previous
+   * example, its glossary URI would be:
+   * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+   * Thus the max number of output files will be 2 (Translated document,
+   * Glossary translated document).
+   * Callers should expect no partial outputs. If there is any error during
+   * document translation, no output will be stored in the Cloud Storage
+   * bucket.
+   * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3.GcsDestination) destination_; + } + return com.google.cloud.translate.v3.GcsDestination.getDefaultInstance(); + } + + public static final int MIME_TYPE_FIELD_NUMBER = 3; + private volatile java.lang.Object mimeType_; + /** + * + * + *
+   * Optional. Specifies the translated document's mime_type.
+   * If not specified, the translated file's mime type will be the same as the
+   * input file's mime type.
+   * Currently only support the output mime type to be the same as input mime
+   * type.
+   * - application/pdf
+   * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * 
+ * + * string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The mimeType. + */ + @java.lang.Override + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + 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(); + mimeType_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Specifies the translated document's mime_type.
+   * If not specified, the translated file's mime type will be the same as the
+   * input file's mime type.
+   * Currently only support the output mime type to be the same as input mime
+   * type.
+   * - application/pdf
+   * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * 
+ * + * string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for mimeType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (destinationCase_ == 1) { + output.writeMessage(1, (com.google.cloud.translate.v3.GcsDestination) destination_); + } + if (!getMimeTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, mimeType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.translate.v3.GcsDestination) destination_); + } + if (!getMimeTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, mimeType_); + } + size += unknownFields.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.v3.DocumentOutputConfig)) { + return super.equals(obj); + } + com.google.cloud.translate.v3.DocumentOutputConfig other = + (com.google.cloud.translate.v3.DocumentOutputConfig) obj; + + if (!getMimeType().equals(other.getMimeType())) return false; + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsDestination().equals(other.getGcsDestination())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) 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) + MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMimeType().hashCode(); + switch (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getGcsDestination().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.translate.v3.DocumentOutputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.DocumentOutputConfig 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.v3.DocumentOutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.DocumentOutputConfig 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.v3.DocumentOutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.DocumentOutputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.translate.v3.DocumentOutputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.DocumentOutputConfig 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.v3.DocumentOutputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.DocumentOutputConfig 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.v3.DocumentOutputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.DocumentOutputConfig 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.v3.DocumentOutputConfig 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; + } + /** + * + * + *
+   * A document translation request output config.
+   * 
+ * + * Protobuf type {@code google.cloud.translation.v3.DocumentOutputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3.DocumentOutputConfig) + com.google.cloud.translate.v3.DocumentOutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.DocumentOutputConfig.class, + com.google.cloud.translate.v3.DocumentOutputConfig.Builder.class); + } + + // Construct using com.google.cloud.translate.v3.DocumentOutputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + mimeType_ = ""; + + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentOutputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3.DocumentOutputConfig getDefaultInstanceForType() { + return com.google.cloud.translate.v3.DocumentOutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3.DocumentOutputConfig build() { + com.google.cloud.translate.v3.DocumentOutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3.DocumentOutputConfig buildPartial() { + com.google.cloud.translate.v3.DocumentOutputConfig result = + new com.google.cloud.translate.v3.DocumentOutputConfig(this); + if (destinationCase_ == 1) { + if (gcsDestinationBuilder_ == null) { + result.destination_ = destination_; + } else { + result.destination_ = gcsDestinationBuilder_.build(); + } + } + result.mimeType_ = mimeType_; + result.destinationCase_ = destinationCase_; + onBuilt(); + return result; + } + + @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.v3.DocumentOutputConfig) { + return mergeFrom((com.google.cloud.translate.v3.DocumentOutputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3.DocumentOutputConfig other) { + if (other == com.google.cloud.translate.v3.DocumentOutputConfig.getDefaultInstance()) + return this; + if (!other.getMimeType().isEmpty()) { + mimeType_ = other.mimeType_; + onChanged(); + } + switch (other.getDestinationCase()) { + case GCS_DESTINATION: + { + mergeGcsDestination(other.getGcsDestination()); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.translate.v3.DocumentOutputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3.DocumentOutputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.GcsDestination, + com.google.cloud.translate.v3.GcsDestination.Builder, + com.google.cloud.translate.v3.GcsDestinationOrBuilder> + gcsDestinationBuilder_; + /** + * + * + *
+     * Optional. Google Cloud Storage destination for the translation output,
+     * e.g., `gs://my_bucket/my_directory/`.
+     * The destination directory provided does not have to be empty, but the
+     * bucket must exist. If a file with the same name as the output file
+     * already exists in the destination an error will be returned.
+     * For a DocumentInputConfig.contents provided document, the output file
+     * will have the name "output_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * For a DocumentInputConfig.gcs_uri provided document, the output file will
+     * have a name according to its URI. For example: an input file with URI:
+     * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+     * "my_bucket" will have an output URI:
+     * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If the document was directly provided through the request, then the
+     * output document will have the format:
+     * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If a glossary was provided, then the output URI for the glossary
+     * translation will be equal to the default output URI but have
+     * `glossary_translations` instead of `translations`. For the previous
+     * example, its glossary URI would be:
+     * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+     * Thus the max number of output files will be 2 (Translated document,
+     * Glossary translated document).
+     * Callers should expect no partial outputs. If there is any error during
+     * document translation, no output will be stored in the Cloud Storage
+     * bucket.
+     * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * Optional. Google Cloud Storage destination for the translation output,
+     * e.g., `gs://my_bucket/my_directory/`.
+     * The destination directory provided does not have to be empty, but the
+     * bucket must exist. If a file with the same name as the output file
+     * already exists in the destination an error will be returned.
+     * For a DocumentInputConfig.contents provided document, the output file
+     * will have the name "output_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * For a DocumentInputConfig.gcs_uri provided document, the output file will
+     * have a name according to its URI. For example: an input file with URI:
+     * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+     * "my_bucket" will have an output URI:
+     * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If the document was directly provided through the request, then the
+     * output document will have the format:
+     * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If a glossary was provided, then the output URI for the glossary
+     * translation will be equal to the default output URI but have
+     * `glossary_translations` instead of `translations`. For the previous
+     * example, its glossary URI would be:
+     * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+     * Thus the max number of output files will be 2 (Translated document,
+     * Glossary translated document).
+     * Callers should expect no partial outputs. If there is any error during
+     * document translation, no output will be stored in the Cloud Storage
+     * bucket.
+     * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3.GcsDestination) destination_; + } + return com.google.cloud.translate.v3.GcsDestination.getDefaultInstance(); + } else { + if (destinationCase_ == 1) { + return gcsDestinationBuilder_.getMessage(); + } + return com.google.cloud.translate.v3.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Google Cloud Storage destination for the translation output,
+     * e.g., `gs://my_bucket/my_directory/`.
+     * The destination directory provided does not have to be empty, but the
+     * bucket must exist. If a file with the same name as the output file
+     * already exists in the destination an error will be returned.
+     * For a DocumentInputConfig.contents provided document, the output file
+     * will have the name "output_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * For a DocumentInputConfig.gcs_uri provided document, the output file will
+     * have a name according to its URI. For example: an input file with URI:
+     * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+     * "my_bucket" will have an output URI:
+     * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If the document was directly provided through the request, then the
+     * output document will have the format:
+     * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If a glossary was provided, then the output URI for the glossary
+     * translation will be equal to the default output URI but have
+     * `glossary_translations` instead of `translations`. For the previous
+     * example, its glossary URI would be:
+     * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+     * Thus the max number of output files will be 2 (Translated document,
+     * Glossary translated document).
+     * Callers should expect no partial outputs. If there is any error during
+     * document translation, no output will be stored in the Cloud Storage
+     * bucket.
+     * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGcsDestination(com.google.cloud.translate.v3.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Optional. Google Cloud Storage destination for the translation output,
+     * e.g., `gs://my_bucket/my_directory/`.
+     * The destination directory provided does not have to be empty, but the
+     * bucket must exist. If a file with the same name as the output file
+     * already exists in the destination an error will be returned.
+     * For a DocumentInputConfig.contents provided document, the output file
+     * will have the name "output_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * For a DocumentInputConfig.gcs_uri provided document, the output file will
+     * have a name according to its URI. For example: an input file with URI:
+     * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+     * "my_bucket" will have an output URI:
+     * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If the document was directly provided through the request, then the
+     * output document will have the format:
+     * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If a glossary was provided, then the output URI for the glossary
+     * translation will be equal to the default output URI but have
+     * `glossary_translations` instead of `translations`. For the previous
+     * example, its glossary URI would be:
+     * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+     * Thus the max number of output files will be 2 (Translated document,
+     * Glossary translated document).
+     * Callers should expect no partial outputs. If there is any error during
+     * document translation, no output will be stored in the Cloud Storage
+     * bucket.
+     * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGcsDestination( + com.google.cloud.translate.v3.GcsDestination.Builder builderForValue) { + if (gcsDestinationBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(builderForValue.build()); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Optional. Google Cloud Storage destination for the translation output,
+     * e.g., `gs://my_bucket/my_directory/`.
+     * The destination directory provided does not have to be empty, but the
+     * bucket must exist. If a file with the same name as the output file
+     * already exists in the destination an error will be returned.
+     * For a DocumentInputConfig.contents provided document, the output file
+     * will have the name "output_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * For a DocumentInputConfig.gcs_uri provided document, the output file will
+     * have a name according to its URI. For example: an input file with URI:
+     * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+     * "my_bucket" will have an output URI:
+     * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If the document was directly provided through the request, then the
+     * output document will have the format:
+     * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If a glossary was provided, then the output URI for the glossary
+     * translation will be equal to the default output URI but have
+     * `glossary_translations` instead of `translations`. For the previous
+     * example, its glossary URI would be:
+     * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+     * Thus the max number of output files will be 2 (Translated document,
+     * Glossary translated document).
+     * Callers should expect no partial outputs. If there is any error during
+     * document translation, no output will be stored in the Cloud Storage
+     * bucket.
+     * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeGcsDestination(com.google.cloud.translate.v3.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1 + && destination_ != com.google.cloud.translate.v3.GcsDestination.getDefaultInstance()) { + destination_ = + com.google.cloud.translate.v3.GcsDestination.newBuilder( + (com.google.cloud.translate.v3.GcsDestination) destination_) + .mergeFrom(value) + .buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + if (destinationCase_ == 1) { + gcsDestinationBuilder_.mergeFrom(value); + } + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Optional. Google Cloud Storage destination for the translation output,
+     * e.g., `gs://my_bucket/my_directory/`.
+     * The destination directory provided does not have to be empty, but the
+     * bucket must exist. If a file with the same name as the output file
+     * already exists in the destination an error will be returned.
+     * For a DocumentInputConfig.contents provided document, the output file
+     * will have the name "output_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * For a DocumentInputConfig.gcs_uri provided document, the output file will
+     * have a name according to its URI. For example: an input file with URI:
+     * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+     * "my_bucket" will have an output URI:
+     * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If the document was directly provided through the request, then the
+     * output document will have the format:
+     * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If a glossary was provided, then the output URI for the glossary
+     * translation will be equal to the default output URI but have
+     * `glossary_translations` instead of `translations`. For the previous
+     * example, its glossary URI would be:
+     * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+     * Thus the max number of output files will be 2 (Translated document,
+     * Glossary translated document).
+     * Callers should expect no partial outputs. If there is any error during
+     * document translation, no output will be stored in the Cloud Storage
+     * bucket.
+     * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + } else { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + } + gcsDestinationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Google Cloud Storage destination for the translation output,
+     * e.g., `gs://my_bucket/my_directory/`.
+     * The destination directory provided does not have to be empty, but the
+     * bucket must exist. If a file with the same name as the output file
+     * already exists in the destination an error will be returned.
+     * For a DocumentInputConfig.contents provided document, the output file
+     * will have the name "output_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * For a DocumentInputConfig.gcs_uri provided document, the output file will
+     * have a name according to its URI. For example: an input file with URI:
+     * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+     * "my_bucket" will have an output URI:
+     * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If the document was directly provided through the request, then the
+     * output document will have the format:
+     * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If a glossary was provided, then the output URI for the glossary
+     * translation will be equal to the default output URI but have
+     * `glossary_translations` instead of `translations`. For the previous
+     * example, its glossary URI would be:
+     * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+     * Thus the max number of output files will be 2 (Translated document,
+     * Glossary translated document).
+     * Callers should expect no partial outputs. If there is any error during
+     * document translation, no output will be stored in the Cloud Storage
+     * bucket.
+     * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.translate.v3.GcsDestination.Builder getGcsDestinationBuilder() { + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Google Cloud Storage destination for the translation output,
+     * e.g., `gs://my_bucket/my_directory/`.
+     * The destination directory provided does not have to be empty, but the
+     * bucket must exist. If a file with the same name as the output file
+     * already exists in the destination an error will be returned.
+     * For a DocumentInputConfig.contents provided document, the output file
+     * will have the name "output_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * For a DocumentInputConfig.gcs_uri provided document, the output file will
+     * have a name according to its URI. For example: an input file with URI:
+     * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+     * "my_bucket" will have an output URI:
+     * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If the document was directly provided through the request, then the
+     * output document will have the format:
+     * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If a glossary was provided, then the output URI for the glossary
+     * translation will be equal to the default output URI but have
+     * `glossary_translations` instead of `translations`. For the previous
+     * example, its glossary URI would be:
+     * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+     * Thus the max number of output files will be 2 (Translated document,
+     * Glossary translated document).
+     * Callers should expect no partial outputs. If there is any error during
+     * document translation, no output will be stored in the Cloud Storage
+     * bucket.
+     * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3.GcsDestination) destination_; + } + return com.google.cloud.translate.v3.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Google Cloud Storage destination for the translation output,
+     * e.g., `gs://my_bucket/my_directory/`.
+     * The destination directory provided does not have to be empty, but the
+     * bucket must exist. If a file with the same name as the output file
+     * already exists in the destination an error will be returned.
+     * For a DocumentInputConfig.contents provided document, the output file
+     * will have the name "output_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * For a DocumentInputConfig.gcs_uri provided document, the output file will
+     * have a name according to its URI. For example: an input file with URI:
+     * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+     * "my_bucket" will have an output URI:
+     * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If the document was directly provided through the request, then the
+     * output document will have the format:
+     * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+     * - [trg] corresponds to the translated file's language code,
+     * - [ext] corresponds to the translated file's extension according to its
+     * mime type.
+     * If a glossary was provided, then the output URI for the glossary
+     * translation will be equal to the default output URI but have
+     * `glossary_translations` instead of `translations`. For the previous
+     * example, its glossary URI would be:
+     * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+     * Thus the max number of output files will be 2 (Translated document,
+     * Glossary translated document).
+     * Callers should expect no partial outputs. If there is any error during
+     * document translation, no output will be stored in the Cloud Storage
+     * bucket.
+     * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.GcsDestination, + com.google.cloud.translate.v3.GcsDestination.Builder, + com.google.cloud.translate.v3.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + if (!(destinationCase_ == 1)) { + destination_ = com.google.cloud.translate.v3.GcsDestination.getDefaultInstance(); + } + gcsDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.GcsDestination, + com.google.cloud.translate.v3.GcsDestination.Builder, + com.google.cloud.translate.v3.GcsDestinationOrBuilder>( + (com.google.cloud.translate.v3.GcsDestination) destination_, + getParentForChildren(), + isClean()); + destination_ = null; + } + destinationCase_ = 1; + onChanged(); + ; + return gcsDestinationBuilder_; + } + + private java.lang.Object mimeType_ = ""; + /** + * + * + *
+     * Optional. Specifies the translated document's mime_type.
+     * If not specified, the translated file's mime type will be the same as the
+     * input file's mime type.
+     * Currently only support the output mime type to be the same as input mime
+     * type.
+     * - application/pdf
+     * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * 
+ * + * string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The mimeType. + */ + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the translated document's mime_type.
+     * If not specified, the translated file's mime type will be the same as the
+     * input file's mime type.
+     * Currently only support the output mime type to be the same as input mime
+     * type.
+     * - application/pdf
+     * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * 
+ * + * string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for mimeType. + */ + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the translated document's mime_type.
+     * If not specified, the translated file's mime type will be the same as the
+     * input file's mime type.
+     * Currently only support the output mime type to be the same as input mime
+     * type.
+     * - application/pdf
+     * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * 
+ * + * string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mimeType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the translated document's mime_type.
+     * If not specified, the translated file's mime type will be the same as the
+     * input file's mime type.
+     * Currently only support the output mime type to be the same as input mime
+     * type.
+     * - application/pdf
+     * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * 
+ * + * string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearMimeType() { + + mimeType_ = getDefaultInstance().getMimeType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the translated document's mime_type.
+     * If not specified, the translated file's mime type will be the same as the
+     * input file's mime type.
+     * Currently only support the output mime type to be the same as input mime
+     * type.
+     * - application/pdf
+     * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+     * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+     * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+     * 
+ * + * string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mimeType_ = value; + 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.v3.DocumentOutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3.DocumentOutputConfig) + private static final com.google.cloud.translate.v3.DocumentOutputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3.DocumentOutputConfig(); + } + + public static com.google.cloud.translate.v3.DocumentOutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentOutputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentOutputConfig(input, extensionRegistry); + } + }; + + 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.v3.DocumentOutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentOutputConfigOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentOutputConfigOrBuilder.java new file mode 100644 index 00000000..9f863d83 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentOutputConfigOrBuilder.java @@ -0,0 +1,208 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +public interface DocumentOutputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3.DocumentOutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Google Cloud Storage destination for the translation output,
+   * e.g., `gs://my_bucket/my_directory/`.
+   * The destination directory provided does not have to be empty, but the
+   * bucket must exist. If a file with the same name as the output file
+   * already exists in the destination an error will be returned.
+   * For a DocumentInputConfig.contents provided document, the output file
+   * will have the name "output_[trg]_translations.[ext]", where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * For a DocumentInputConfig.gcs_uri provided document, the output file will
+   * have a name according to its URI. For example: an input file with URI:
+   * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+   * "my_bucket" will have an output URI:
+   * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * If the document was directly provided through the request, then the
+   * output document will have the format:
+   * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * If a glossary was provided, then the output URI for the glossary
+   * translation will be equal to the default output URI but have
+   * `glossary_translations` instead of `translations`. For the previous
+   * example, its glossary URI would be:
+   * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+   * Thus the max number of output files will be 2 (Translated document,
+   * Glossary translated document).
+   * Callers should expect no partial outputs. If there is any error during
+   * document translation, no output will be stored in the Cloud Storage
+   * bucket.
+   * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the gcsDestination field is set. + */ + boolean hasGcsDestination(); + /** + * + * + *
+   * Optional. Google Cloud Storage destination for the translation output,
+   * e.g., `gs://my_bucket/my_directory/`.
+   * The destination directory provided does not have to be empty, but the
+   * bucket must exist. If a file with the same name as the output file
+   * already exists in the destination an error will be returned.
+   * For a DocumentInputConfig.contents provided document, the output file
+   * will have the name "output_[trg]_translations.[ext]", where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * For a DocumentInputConfig.gcs_uri provided document, the output file will
+   * have a name according to its URI. For example: an input file with URI:
+   * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+   * "my_bucket" will have an output URI:
+   * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * If the document was directly provided through the request, then the
+   * output document will have the format:
+   * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * If a glossary was provided, then the output URI for the glossary
+   * translation will be equal to the default output URI but have
+   * `glossary_translations` instead of `translations`. For the previous
+   * example, its glossary URI would be:
+   * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+   * Thus the max number of output files will be 2 (Translated document,
+   * Glossary translated document).
+   * Callers should expect no partial outputs. If there is any error during
+   * document translation, no output will be stored in the Cloud Storage
+   * bucket.
+   * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The gcsDestination. + */ + com.google.cloud.translate.v3.GcsDestination getGcsDestination(); + /** + * + * + *
+   * Optional. Google Cloud Storage destination for the translation output,
+   * e.g., `gs://my_bucket/my_directory/`.
+   * The destination directory provided does not have to be empty, but the
+   * bucket must exist. If a file with the same name as the output file
+   * already exists in the destination an error will be returned.
+   * For a DocumentInputConfig.contents provided document, the output file
+   * will have the name "output_[trg]_translations.[ext]", where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * For a DocumentInputConfig.gcs_uri provided document, the output file will
+   * have a name according to its URI. For example: an input file with URI:
+   * "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name
+   * "my_bucket" will have an output URI:
+   * "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * If the document was directly provided through the request, then the
+   * output document will have the format:
+   * "gs://my_bucket/translated_document_[trg]_translations.[ext], where
+   * - [trg] corresponds to the translated file's language code,
+   * - [ext] corresponds to the translated file's extension according to its
+   * mime type.
+   * If a glossary was provided, then the output URI for the glossary
+   * translation will be equal to the default output URI but have
+   * `glossary_translations` instead of `translations`. For the previous
+   * example, its glossary URI would be:
+   * "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]".
+   * Thus the max number of output files will be 2 (Translated document,
+   * Glossary translated document).
+   * Callers should expect no partial outputs. If there is any error during
+   * document translation, no output will be stored in the Cloud Storage
+   * bucket.
+   * 
+ * + * + * .google.cloud.translation.v3.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.translate.v3.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); + + /** + * + * + *
+   * Optional. Specifies the translated document's mime_type.
+   * If not specified, the translated file's mime type will be the same as the
+   * input file's mime type.
+   * Currently only support the output mime type to be the same as input mime
+   * type.
+   * - application/pdf
+   * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * 
+ * + * string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The mimeType. + */ + java.lang.String getMimeType(); + /** + * + * + *
+   * Optional. Specifies the translated document's mime_type.
+   * If not specified, the translated file's mime type will be the same as the
+   * input file's mime type.
+   * Currently only support the output mime type to be the same as input mime
+   * type.
+   * - application/pdf
+   * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
+   * - application/vnd.openxmlformats-officedocument.presentationml.presentation
+   * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+   * 
+ * + * string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for mimeType. + */ + com.google.protobuf.ByteString getMimeTypeBytes(); + + public com.google.cloud.translate.v3.DocumentOutputConfig.DestinationCase getDestinationCase(); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentTranslation.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentTranslation.java new file mode 100644 index 00000000..37aa5f0a --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentTranslation.java @@ -0,0 +1,1096 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +/** + * + * + *
+ * A translated document message.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3.DocumentTranslation} + */ +public final class DocumentTranslation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3.DocumentTranslation) + DocumentTranslationOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentTranslation.newBuilder() to construct. + private DocumentTranslation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentTranslation() { + byteStreamOutputs_ = java.util.Collections.emptyList(); + mimeType_ = ""; + detectedLanguageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DocumentTranslation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentTranslation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + byteStreamOutputs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + byteStreamOutputs_.add(input.readBytes()); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + mimeType_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + detectedLanguageCode_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + byteStreamOutputs_ = java.util.Collections.unmodifiableList(byteStreamOutputs_); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentTranslation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentTranslation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.DocumentTranslation.class, + com.google.cloud.translate.v3.DocumentTranslation.Builder.class); + } + + public static final int BYTE_STREAM_OUTPUTS_FIELD_NUMBER = 1; + private java.util.List byteStreamOutputs_; + /** + * + * + *
+   * The array of translated documents. It is expected to be size 1 for now. We
+   * may produce multiple translated documents in the future for other type of
+   * file formats.
+   * 
+ * + * repeated bytes byte_stream_outputs = 1; + * + * @return A list containing the byteStreamOutputs. + */ + @java.lang.Override + public java.util.List getByteStreamOutputsList() { + return byteStreamOutputs_; + } + /** + * + * + *
+   * The array of translated documents. It is expected to be size 1 for now. We
+   * may produce multiple translated documents in the future for other type of
+   * file formats.
+   * 
+ * + * repeated bytes byte_stream_outputs = 1; + * + * @return The count of byteStreamOutputs. + */ + public int getByteStreamOutputsCount() { + return byteStreamOutputs_.size(); + } + /** + * + * + *
+   * The array of translated documents. It is expected to be size 1 for now. We
+   * may produce multiple translated documents in the future for other type of
+   * file formats.
+   * 
+ * + * repeated bytes byte_stream_outputs = 1; + * + * @param index The index of the element to return. + * @return The byteStreamOutputs at the given index. + */ + public com.google.protobuf.ByteString getByteStreamOutputs(int index) { + return byteStreamOutputs_.get(index); + } + + public static final int MIME_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object mimeType_; + /** + * + * + *
+   * The translated document's mime type.
+   * 
+ * + * string mime_type = 2; + * + * @return The mimeType. + */ + @java.lang.Override + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + 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(); + mimeType_ = s; + return s; + } + } + /** + * + * + *
+   * The translated document's mime type.
+   * 
+ * + * string mime_type = 2; + * + * @return The bytes for mimeType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DETECTED_LANGUAGE_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object detectedLanguageCode_; + /** + * + * + *
+   * The detected language for the input document.
+   * If the user did not provide the source language for the input document,
+   * this field will have the language code automatically detected. If the
+   * source language was passed, auto-detection of the language does not occur
+   * and this field is empty.
+   * 
+ * + * string detected_language_code = 3; + * + * @return The detectedLanguageCode. + */ + @java.lang.Override + public java.lang.String getDetectedLanguageCode() { + java.lang.Object ref = detectedLanguageCode_; + 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(); + detectedLanguageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The detected language for the input document.
+   * If the user did not provide the source language for the input document,
+   * this field will have the language code automatically detected. If the
+   * source language was passed, auto-detection of the language does not occur
+   * and this field is empty.
+   * 
+ * + * string detected_language_code = 3; + * + * @return The bytes for detectedLanguageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDetectedLanguageCodeBytes() { + java.lang.Object ref = detectedLanguageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detectedLanguageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 { + for (int i = 0; i < byteStreamOutputs_.size(); i++) { + output.writeBytes(1, byteStreamOutputs_.get(i)); + } + if (!getMimeTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mimeType_); + } + if (!getDetectedLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, detectedLanguageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < byteStreamOutputs_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(byteStreamOutputs_.get(i)); + } + size += dataSize; + size += 1 * getByteStreamOutputsList().size(); + } + if (!getMimeTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mimeType_); + } + if (!getDetectedLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, detectedLanguageCode_); + } + size += unknownFields.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.v3.DocumentTranslation)) { + return super.equals(obj); + } + com.google.cloud.translate.v3.DocumentTranslation other = + (com.google.cloud.translate.v3.DocumentTranslation) obj; + + if (!getByteStreamOutputsList().equals(other.getByteStreamOutputsList())) return false; + if (!getMimeType().equals(other.getMimeType())) return false; + if (!getDetectedLanguageCode().equals(other.getDetectedLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getByteStreamOutputsCount() > 0) { + hash = (37 * hash) + BYTE_STREAM_OUTPUTS_FIELD_NUMBER; + hash = (53 * hash) + getByteStreamOutputsList().hashCode(); + } + hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMimeType().hashCode(); + hash = (37 * hash) + DETECTED_LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getDetectedLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.translate.v3.DocumentTranslation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.DocumentTranslation 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.v3.DocumentTranslation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.DocumentTranslation 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.v3.DocumentTranslation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.DocumentTranslation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.translate.v3.DocumentTranslation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.DocumentTranslation 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.v3.DocumentTranslation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.DocumentTranslation 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.v3.DocumentTranslation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.DocumentTranslation 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.v3.DocumentTranslation 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; + } + /** + * + * + *
+   * A translated document message.
+   * 
+ * + * Protobuf type {@code google.cloud.translation.v3.DocumentTranslation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3.DocumentTranslation) + com.google.cloud.translate.v3.DocumentTranslationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentTranslation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentTranslation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.DocumentTranslation.class, + com.google.cloud.translate.v3.DocumentTranslation.Builder.class); + } + + // Construct using com.google.cloud.translate.v3.DocumentTranslation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + byteStreamOutputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + mimeType_ = ""; + + detectedLanguageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_DocumentTranslation_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3.DocumentTranslation getDefaultInstanceForType() { + return com.google.cloud.translate.v3.DocumentTranslation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3.DocumentTranslation build() { + com.google.cloud.translate.v3.DocumentTranslation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3.DocumentTranslation buildPartial() { + com.google.cloud.translate.v3.DocumentTranslation result = + new com.google.cloud.translate.v3.DocumentTranslation(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + byteStreamOutputs_ = java.util.Collections.unmodifiableList(byteStreamOutputs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.byteStreamOutputs_ = byteStreamOutputs_; + result.mimeType_ = mimeType_; + result.detectedLanguageCode_ = detectedLanguageCode_; + onBuilt(); + return result; + } + + @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.v3.DocumentTranslation) { + return mergeFrom((com.google.cloud.translate.v3.DocumentTranslation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3.DocumentTranslation other) { + if (other == com.google.cloud.translate.v3.DocumentTranslation.getDefaultInstance()) + return this; + if (!other.byteStreamOutputs_.isEmpty()) { + if (byteStreamOutputs_.isEmpty()) { + byteStreamOutputs_ = other.byteStreamOutputs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureByteStreamOutputsIsMutable(); + byteStreamOutputs_.addAll(other.byteStreamOutputs_); + } + onChanged(); + } + if (!other.getMimeType().isEmpty()) { + mimeType_ = other.mimeType_; + onChanged(); + } + if (!other.getDetectedLanguageCode().isEmpty()) { + detectedLanguageCode_ = other.detectedLanguageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.translate.v3.DocumentTranslation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3.DocumentTranslation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List byteStreamOutputs_ = + java.util.Collections.emptyList(); + + private void ensureByteStreamOutputsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + byteStreamOutputs_ = + new java.util.ArrayList(byteStreamOutputs_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The array of translated documents. It is expected to be size 1 for now. We
+     * may produce multiple translated documents in the future for other type of
+     * file formats.
+     * 
+ * + * repeated bytes byte_stream_outputs = 1; + * + * @return A list containing the byteStreamOutputs. + */ + public java.util.List getByteStreamOutputsList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(byteStreamOutputs_) + : byteStreamOutputs_; + } + /** + * + * + *
+     * The array of translated documents. It is expected to be size 1 for now. We
+     * may produce multiple translated documents in the future for other type of
+     * file formats.
+     * 
+ * + * repeated bytes byte_stream_outputs = 1; + * + * @return The count of byteStreamOutputs. + */ + public int getByteStreamOutputsCount() { + return byteStreamOutputs_.size(); + } + /** + * + * + *
+     * The array of translated documents. It is expected to be size 1 for now. We
+     * may produce multiple translated documents in the future for other type of
+     * file formats.
+     * 
+ * + * repeated bytes byte_stream_outputs = 1; + * + * @param index The index of the element to return. + * @return The byteStreamOutputs at the given index. + */ + public com.google.protobuf.ByteString getByteStreamOutputs(int index) { + return byteStreamOutputs_.get(index); + } + /** + * + * + *
+     * The array of translated documents. It is expected to be size 1 for now. We
+     * may produce multiple translated documents in the future for other type of
+     * file formats.
+     * 
+ * + * repeated bytes byte_stream_outputs = 1; + * + * @param index The index to set the value at. + * @param value The byteStreamOutputs to set. + * @return This builder for chaining. + */ + public Builder setByteStreamOutputs(int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureByteStreamOutputsIsMutable(); + byteStreamOutputs_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The array of translated documents. It is expected to be size 1 for now. We
+     * may produce multiple translated documents in the future for other type of
+     * file formats.
+     * 
+ * + * repeated bytes byte_stream_outputs = 1; + * + * @param value The byteStreamOutputs to add. + * @return This builder for chaining. + */ + public Builder addByteStreamOutputs(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureByteStreamOutputsIsMutable(); + byteStreamOutputs_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The array of translated documents. It is expected to be size 1 for now. We
+     * may produce multiple translated documents in the future for other type of
+     * file formats.
+     * 
+ * + * repeated bytes byte_stream_outputs = 1; + * + * @param values The byteStreamOutputs to add. + * @return This builder for chaining. + */ + public Builder addAllByteStreamOutputs( + java.lang.Iterable values) { + ensureByteStreamOutputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, byteStreamOutputs_); + onChanged(); + return this; + } + /** + * + * + *
+     * The array of translated documents. It is expected to be size 1 for now. We
+     * may produce multiple translated documents in the future for other type of
+     * file formats.
+     * 
+ * + * repeated bytes byte_stream_outputs = 1; + * + * @return This builder for chaining. + */ + public Builder clearByteStreamOutputs() { + byteStreamOutputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private java.lang.Object mimeType_ = ""; + /** + * + * + *
+     * The translated document's mime type.
+     * 
+ * + * string mime_type = 2; + * + * @return The mimeType. + */ + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The translated document's mime type.
+     * 
+ * + * string mime_type = 2; + * + * @return The bytes for mimeType. + */ + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The translated document's mime type.
+     * 
+ * + * string mime_type = 2; + * + * @param value The mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mimeType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The translated document's mime type.
+     * 
+ * + * string mime_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearMimeType() { + + mimeType_ = getDefaultInstance().getMimeType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The translated document's mime type.
+     * 
+ * + * string mime_type = 2; + * + * @param value The bytes for mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mimeType_ = value; + onChanged(); + return this; + } + + private java.lang.Object detectedLanguageCode_ = ""; + /** + * + * + *
+     * The detected language for the input document.
+     * If the user did not provide the source language for the input document,
+     * this field will have the language code automatically detected. If the
+     * source language was passed, auto-detection of the language does not occur
+     * and this field is empty.
+     * 
+ * + * string detected_language_code = 3; + * + * @return The detectedLanguageCode. + */ + public java.lang.String getDetectedLanguageCode() { + java.lang.Object ref = detectedLanguageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detectedLanguageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The detected language for the input document.
+     * If the user did not provide the source language for the input document,
+     * this field will have the language code automatically detected. If the
+     * source language was passed, auto-detection of the language does not occur
+     * and this field is empty.
+     * 
+ * + * string detected_language_code = 3; + * + * @return The bytes for detectedLanguageCode. + */ + public com.google.protobuf.ByteString getDetectedLanguageCodeBytes() { + java.lang.Object ref = detectedLanguageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detectedLanguageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The detected language for the input document.
+     * If the user did not provide the source language for the input document,
+     * this field will have the language code automatically detected. If the
+     * source language was passed, auto-detection of the language does not occur
+     * and this field is empty.
+     * 
+ * + * string detected_language_code = 3; + * + * @param value The detectedLanguageCode to set. + * @return This builder for chaining. + */ + public Builder setDetectedLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + detectedLanguageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The detected language for the input document.
+     * If the user did not provide the source language for the input document,
+     * this field will have the language code automatically detected. If the
+     * source language was passed, auto-detection of the language does not occur
+     * and this field is empty.
+     * 
+ * + * string detected_language_code = 3; + * + * @return This builder for chaining. + */ + public Builder clearDetectedLanguageCode() { + + detectedLanguageCode_ = getDefaultInstance().getDetectedLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The detected language for the input document.
+     * If the user did not provide the source language for the input document,
+     * this field will have the language code automatically detected. If the
+     * source language was passed, auto-detection of the language does not occur
+     * and this field is empty.
+     * 
+ * + * string detected_language_code = 3; + * + * @param value The bytes for detectedLanguageCode to set. + * @return This builder for chaining. + */ + public Builder setDetectedLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + detectedLanguageCode_ = value; + 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.v3.DocumentTranslation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3.DocumentTranslation) + private static final com.google.cloud.translate.v3.DocumentTranslation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3.DocumentTranslation(); + } + + public static com.google.cloud.translate.v3.DocumentTranslation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentTranslation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentTranslation(input, extensionRegistry); + } + }; + + 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.v3.DocumentTranslation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentTranslationOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentTranslationOrBuilder.java new file mode 100644 index 00000000..7e00d334 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/DocumentTranslationOrBuilder.java @@ -0,0 +1,127 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +public interface DocumentTranslationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3.DocumentTranslation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The array of translated documents. It is expected to be size 1 for now. We
+   * may produce multiple translated documents in the future for other type of
+   * file formats.
+   * 
+ * + * repeated bytes byte_stream_outputs = 1; + * + * @return A list containing the byteStreamOutputs. + */ + java.util.List getByteStreamOutputsList(); + /** + * + * + *
+   * The array of translated documents. It is expected to be size 1 for now. We
+   * may produce multiple translated documents in the future for other type of
+   * file formats.
+   * 
+ * + * repeated bytes byte_stream_outputs = 1; + * + * @return The count of byteStreamOutputs. + */ + int getByteStreamOutputsCount(); + /** + * + * + *
+   * The array of translated documents. It is expected to be size 1 for now. We
+   * may produce multiple translated documents in the future for other type of
+   * file formats.
+   * 
+ * + * repeated bytes byte_stream_outputs = 1; + * + * @param index The index of the element to return. + * @return The byteStreamOutputs at the given index. + */ + com.google.protobuf.ByteString getByteStreamOutputs(int index); + + /** + * + * + *
+   * The translated document's mime type.
+   * 
+ * + * string mime_type = 2; + * + * @return The mimeType. + */ + java.lang.String getMimeType(); + /** + * + * + *
+   * The translated document's mime type.
+   * 
+ * + * string mime_type = 2; + * + * @return The bytes for mimeType. + */ + com.google.protobuf.ByteString getMimeTypeBytes(); + + /** + * + * + *
+   * The detected language for the input document.
+   * If the user did not provide the source language for the input document,
+   * this field will have the language code automatically detected. If the
+   * source language was passed, auto-detection of the language does not occur
+   * and this field is empty.
+   * 
+ * + * string detected_language_code = 3; + * + * @return The detectedLanguageCode. + */ + java.lang.String getDetectedLanguageCode(); + /** + * + * + *
+   * The detected language for the input document.
+   * If the user did not provide the source language for the input document,
+   * this field will have the language code automatically detected. If the
+   * source language was passed, auto-detection of the language does not occur
+   * and this field is empty.
+   * 
+ * + * string detected_language_code = 3; + * + * @return The bytes for detectedLanguageCode. + */ + com.google.protobuf.ByteString getDetectedLanguageCodeBytes(); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsDestination.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsDestination.java index 6fe86629..2516a54b 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsDestination.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsDestination.java @@ -117,12 +117,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. There must be no files under 'output_uri_prefix'.
-   * 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an
-   * INVALID_ARGUMENT (400) error is returned.
+   * Required. The bucket used in 'output_uri_prefix' must exist and there must
+   * be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with
+   * "/" and start with "gs://". One 'output_uri_prefix' can only be used by one
+   * batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error
+   * is returned.
    * 
* - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The outputUriPrefix. */ @@ -142,12 +144,14 @@ public java.lang.String getOutputUriPrefix() { * * *
-   * Required. There must be no files under 'output_uri_prefix'.
-   * 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an
-   * INVALID_ARGUMENT (400) error is returned.
+   * Required. The bucket used in 'output_uri_prefix' must exist and there must
+   * be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with
+   * "/" and start with "gs://". One 'output_uri_prefix' can only be used by one
+   * batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error
+   * is returned.
    * 
* - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for outputUriPrefix. */ @@ -485,12 +489,14 @@ public Builder mergeFrom( * * *
-     * Required. There must be no files under 'output_uri_prefix'.
-     * 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an
-     * INVALID_ARGUMENT (400) error is returned.
+     * Required. The bucket used in 'output_uri_prefix' must exist and there must
+     * be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with
+     * "/" and start with "gs://". One 'output_uri_prefix' can only be used by one
+     * batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error
+     * is returned.
      * 
* - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The outputUriPrefix. */ @@ -509,12 +515,14 @@ public java.lang.String getOutputUriPrefix() { * * *
-     * Required. There must be no files under 'output_uri_prefix'.
-     * 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an
-     * INVALID_ARGUMENT (400) error is returned.
+     * Required. The bucket used in 'output_uri_prefix' must exist and there must
+     * be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with
+     * "/" and start with "gs://". One 'output_uri_prefix' can only be used by one
+     * batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error
+     * is returned.
      * 
* - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for outputUriPrefix. */ @@ -533,12 +541,14 @@ public com.google.protobuf.ByteString getOutputUriPrefixBytes() { * * *
-     * Required. There must be no files under 'output_uri_prefix'.
-     * 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an
-     * INVALID_ARGUMENT (400) error is returned.
+     * Required. The bucket used in 'output_uri_prefix' must exist and there must
+     * be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with
+     * "/" and start with "gs://". One 'output_uri_prefix' can only be used by one
+     * batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error
+     * is returned.
      * 
* - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The outputUriPrefix to set. * @return This builder for chaining. @@ -556,12 +566,14 @@ public Builder setOutputUriPrefix(java.lang.String value) { * * *
-     * Required. There must be no files under 'output_uri_prefix'.
-     * 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an
-     * INVALID_ARGUMENT (400) error is returned.
+     * Required. The bucket used in 'output_uri_prefix' must exist and there must
+     * be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with
+     * "/" and start with "gs://". One 'output_uri_prefix' can only be used by one
+     * batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error
+     * is returned.
      * 
* - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -575,12 +587,14 @@ public Builder clearOutputUriPrefix() { * * *
-     * Required. There must be no files under 'output_uri_prefix'.
-     * 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an
-     * INVALID_ARGUMENT (400) error is returned.
+     * Required. The bucket used in 'output_uri_prefix' must exist and there must
+     * be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with
+     * "/" and start with "gs://". One 'output_uri_prefix' can only be used by one
+     * batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error
+     * is returned.
      * 
* - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for outputUriPrefix to set. * @return This builder for chaining. diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsDestinationOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsDestinationOrBuilder.java index fc7c223a..623f945b 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsDestinationOrBuilder.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsDestinationOrBuilder.java @@ -27,12 +27,14 @@ public interface GcsDestinationOrBuilder * * *
-   * Required. There must be no files under 'output_uri_prefix'.
-   * 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an
-   * INVALID_ARGUMENT (400) error is returned.
+   * Required. The bucket used in 'output_uri_prefix' must exist and there must
+   * be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with
+   * "/" and start with "gs://". One 'output_uri_prefix' can only be used by one
+   * batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error
+   * is returned.
    * 
* - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The outputUriPrefix. */ @@ -41,12 +43,14 @@ public interface GcsDestinationOrBuilder * * *
-   * Required. There must be no files under 'output_uri_prefix'.
-   * 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an
-   * INVALID_ARGUMENT (400) error is returned.
+   * Required. The bucket used in 'output_uri_prefix' must exist and there must
+   * be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with
+   * "/" and start with "gs://". One 'output_uri_prefix' can only be used by one
+   * batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error
+   * is returned.
    * 
* - * string output_uri_prefix = 1; + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for outputUriPrefix. */ diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsSource.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsSource.java index 233b1f4b..5bbedccb 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsSource.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsSource.java @@ -120,7 +120,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Required. Source data URI. For example, `gs://my_bucket/my_object`. * * - * string input_uri = 1; + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The inputUri. */ @@ -143,7 +143,7 @@ public java.lang.String getInputUri() { * Required. Source data URI. For example, `gs://my_bucket/my_object`. * * - * string input_uri = 1; + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for inputUri. */ @@ -483,7 +483,7 @@ public Builder mergeFrom( * Required. Source data URI. For example, `gs://my_bucket/my_object`. * * - * string input_uri = 1; + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The inputUri. */ @@ -505,7 +505,7 @@ public java.lang.String getInputUri() { * Required. Source data URI. For example, `gs://my_bucket/my_object`. * * - * string input_uri = 1; + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for inputUri. */ @@ -527,7 +527,7 @@ public com.google.protobuf.ByteString getInputUriBytes() { * Required. Source data URI. For example, `gs://my_bucket/my_object`. * * - * string input_uri = 1; + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The inputUri to set. * @return This builder for chaining. @@ -548,7 +548,7 @@ public Builder setInputUri(java.lang.String value) { * Required. Source data URI. For example, `gs://my_bucket/my_object`. * * - * string input_uri = 1; + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -565,7 +565,7 @@ public Builder clearInputUri() { * Required. Source data URI. For example, `gs://my_bucket/my_object`. * * - * string input_uri = 1; + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for inputUri to set. * @return This builder for chaining. diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsSourceOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsSourceOrBuilder.java index 0330a245..dd91af19 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsSourceOrBuilder.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GcsSourceOrBuilder.java @@ -30,7 +30,7 @@ public interface GcsSourceOrBuilder * Required. Source data URI. For example, `gs://my_bucket/my_object`. * * - * string input_uri = 1; + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The inputUri. */ @@ -42,7 +42,7 @@ public interface GcsSourceOrBuilder * Required. Source data URI. For example, `gs://my_bucket/my_object`. * * - * string input_uri = 1; + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for inputUri. */ diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GetSupportedLanguagesRequest.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GetSupportedLanguagesRequest.java index b5ec92f1..d2ee8484 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GetSupportedLanguagesRequest.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GetSupportedLanguagesRequest.java @@ -261,9 +261,8 @@ public com.google.protobuf.ByteString getDisplayLanguageCodeBytes() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. + * If missing, we get supported languages of Google general NMT model. * * * string model = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -292,9 +291,8 @@ public java.lang.String getModel() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. + * If missing, we get supported languages of Google general NMT model. * * * string model = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -948,9 +946,8 @@ public Builder setDisplayLanguageCodeBytes(com.google.protobuf.ByteString value) * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. + * If missing, we get supported languages of Google general NMT model. * * * string model = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -978,9 +975,8 @@ public java.lang.String getModel() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. + * If missing, we get supported languages of Google general NMT model. * * * string model = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1008,9 +1004,8 @@ public com.google.protobuf.ByteString getModelBytes() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. + * If missing, we get supported languages of Google general NMT model. * * * string model = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1037,9 +1032,8 @@ public Builder setModel(java.lang.String value) { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. + * If missing, we get supported languages of Google general NMT model. * * * string model = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1062,9 +1056,8 @@ public Builder clearModel() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. + * If missing, we get supported languages of Google general NMT model. * * * string model = 2 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GetSupportedLanguagesRequestOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GetSupportedLanguagesRequestOrBuilder.java index df939115..bcf4d1f7 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GetSupportedLanguagesRequestOrBuilder.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GetSupportedLanguagesRequestOrBuilder.java @@ -107,9 +107,8 @@ public interface GetSupportedLanguagesRequestOrBuilder * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. + * If missing, we get supported languages of Google general NMT model. * * * string model = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -127,9 +126,8 @@ public interface GetSupportedLanguagesRequestOrBuilder * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * Returns languages supported by the specified model. - * If missing, we get supported languages of Google general base (PBMT) model. + * If missing, we get supported languages of Google general NMT model. * * * string model = 2 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/Glossary.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/Glossary.java index 638fc2ab..f4a24008 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/Glossary.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/Glossary.java @@ -1949,7 +1949,7 @@ public LanguagesCase getLanguagesCase() { * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -1973,7 +1973,7 @@ public java.lang.String getName() { * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -2770,7 +2770,7 @@ public Builder clearLanguages() { * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -2793,7 +2793,7 @@ public java.lang.String getName() { * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -2816,7 +2816,7 @@ public com.google.protobuf.ByteString getNameBytes() { * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The name to set. * @return This builder for chaining. @@ -2838,7 +2838,7 @@ public Builder setName(java.lang.String value) { * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -2856,7 +2856,7 @@ public Builder clearName() { * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for name to set. * @return This builder for chaining. diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GlossaryInputConfig.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GlossaryInputConfig.java index 7fbbc1af..3f94cc2e 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GlossaryInputConfig.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GlossaryInputConfig.java @@ -181,9 +181,8 @@ public SourceCase getSourceCase() { * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; @@ -212,9 +211,8 @@ public boolean hasGcsSource() { * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; @@ -246,9 +244,8 @@ public com.google.cloud.translate.v3.GcsSource getGcsSource() { * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; @@ -645,9 +642,8 @@ public Builder clearSource() { * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; @@ -676,9 +672,8 @@ public boolean hasGcsSource() { * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; @@ -717,9 +712,8 @@ public com.google.cloud.translate.v3.GcsSource getGcsSource() { * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; @@ -755,9 +749,8 @@ public Builder setGcsSource(com.google.cloud.translate.v3.GcsSource value) { * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; @@ -790,9 +783,8 @@ public Builder setGcsSource(com.google.cloud.translate.v3.GcsSource.Builder buil * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; @@ -837,9 +829,8 @@ public Builder mergeGcsSource(com.google.cloud.translate.v3.GcsSource value) { * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; @@ -878,9 +869,8 @@ public Builder clearGcsSource() { * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; @@ -906,9 +896,8 @@ public com.google.cloud.translate.v3.GcsSource.Builder getGcsSourceBuilder() { * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; @@ -942,9 +931,8 @@ public com.google.cloud.translate.v3.GcsSourceOrBuilder getGcsSourceOrBuilder() * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GlossaryInputConfigOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GlossaryInputConfigOrBuilder.java index d1c74057..ad6ac9a1 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GlossaryInputConfigOrBuilder.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GlossaryInputConfigOrBuilder.java @@ -41,9 +41,8 @@ public interface GlossaryInputConfigOrBuilder * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; @@ -69,9 +68,8 @@ public interface GlossaryInputConfigOrBuilder * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; @@ -97,9 +95,8 @@ public interface GlossaryInputConfigOrBuilder * pairs. * For equivalent term sets glossaries: * - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - * in multiple languages. The format is defined for Google Translation - * Toolkit and documented in [Use a - * glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + * in multiple languages. See documentation for more information - + * [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). * * * .google.cloud.translation.v3.GcsSource gcs_source = 1; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GlossaryOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GlossaryOrBuilder.java index 6fafa7d9..9781de31 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GlossaryOrBuilder.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/GlossaryOrBuilder.java @@ -31,7 +31,7 @@ public interface GlossaryOrBuilder * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -44,7 +44,7 @@ public interface GlossaryOrBuilder * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/ListGlossariesRequest.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/ListGlossariesRequest.java index 25d31e47..e3ad011f 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/ListGlossariesRequest.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/ListGlossariesRequest.java @@ -266,7 +266,20 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * *
    * Optional. Filter specifying constraints of a list operation.
-   * Filtering is not supported yet, and the parameter currently has no effect.
+   * Specify the constraint by the format of "key=value", where key must be
+   * "src" or "tgt", and the value must be a valid language code.
+   * For multiple restrictions, concatenate them by "AND" (uppercase only),
+   * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used
+   * here, which means using 'en-US' and 'en' can lead to different results,
+   * which depends on the language code you used when you create the glossary.
+   * For the unidirectional glossaries, the "src" and "tgt" add restrictions
+   * on the source and target language code separately.
+   * For the equivalent term set glossaries, the "src" and/or "tgt" add
+   * restrictions on the term set.
+   * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional
+   * glossaries which exactly match the source language code as "en-US" and the
+   * target language code "zh-CN", but all equivalent term set glossaries which
+   * contain "en-US" and "zh-CN" in their language set will be picked.
    * If missing, no filtering is performed.
    * 
* @@ -291,7 +304,20 @@ public java.lang.String getFilter() { * *
    * Optional. Filter specifying constraints of a list operation.
-   * Filtering is not supported yet, and the parameter currently has no effect.
+   * Specify the constraint by the format of "key=value", where key must be
+   * "src" or "tgt", and the value must be a valid language code.
+   * For multiple restrictions, concatenate them by "AND" (uppercase only),
+   * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used
+   * here, which means using 'en-US' and 'en' can lead to different results,
+   * which depends on the language code you used when you create the glossary.
+   * For the unidirectional glossaries, the "src" and "tgt" add restrictions
+   * on the source and target language code separately.
+   * For the equivalent term set glossaries, the "src" and/or "tgt" add
+   * restrictions on the term set.
+   * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional
+   * glossaries which exactly match the source language code as "en-US" and the
+   * target language code "zh-CN", but all equivalent term set glossaries which
+   * contain "en-US" and "zh-CN" in their language set will be picked.
    * If missing, no filtering is performed.
    * 
* @@ -975,7 +1001,20 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { * *
      * Optional. Filter specifying constraints of a list operation.
-     * Filtering is not supported yet, and the parameter currently has no effect.
+     * Specify the constraint by the format of "key=value", where key must be
+     * "src" or "tgt", and the value must be a valid language code.
+     * For multiple restrictions, concatenate them by "AND" (uppercase only),
+     * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used
+     * here, which means using 'en-US' and 'en' can lead to different results,
+     * which depends on the language code you used when you create the glossary.
+     * For the unidirectional glossaries, the "src" and "tgt" add restrictions
+     * on the source and target language code separately.
+     * For the equivalent term set glossaries, the "src" and/or "tgt" add
+     * restrictions on the term set.
+     * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional
+     * glossaries which exactly match the source language code as "en-US" and the
+     * target language code "zh-CN", but all equivalent term set glossaries which
+     * contain "en-US" and "zh-CN" in their language set will be picked.
      * If missing, no filtering is performed.
      * 
* @@ -999,7 +1038,20 @@ public java.lang.String getFilter() { * *
      * Optional. Filter specifying constraints of a list operation.
-     * Filtering is not supported yet, and the parameter currently has no effect.
+     * Specify the constraint by the format of "key=value", where key must be
+     * "src" or "tgt", and the value must be a valid language code.
+     * For multiple restrictions, concatenate them by "AND" (uppercase only),
+     * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used
+     * here, which means using 'en-US' and 'en' can lead to different results,
+     * which depends on the language code you used when you create the glossary.
+     * For the unidirectional glossaries, the "src" and "tgt" add restrictions
+     * on the source and target language code separately.
+     * For the equivalent term set glossaries, the "src" and/or "tgt" add
+     * restrictions on the term set.
+     * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional
+     * glossaries which exactly match the source language code as "en-US" and the
+     * target language code "zh-CN", but all equivalent term set glossaries which
+     * contain "en-US" and "zh-CN" in their language set will be picked.
      * If missing, no filtering is performed.
      * 
* @@ -1023,7 +1075,20 @@ public com.google.protobuf.ByteString getFilterBytes() { * *
      * Optional. Filter specifying constraints of a list operation.
-     * Filtering is not supported yet, and the parameter currently has no effect.
+     * Specify the constraint by the format of "key=value", where key must be
+     * "src" or "tgt", and the value must be a valid language code.
+     * For multiple restrictions, concatenate them by "AND" (uppercase only),
+     * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used
+     * here, which means using 'en-US' and 'en' can lead to different results,
+     * which depends on the language code you used when you create the glossary.
+     * For the unidirectional glossaries, the "src" and "tgt" add restrictions
+     * on the source and target language code separately.
+     * For the equivalent term set glossaries, the "src" and/or "tgt" add
+     * restrictions on the term set.
+     * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional
+     * glossaries which exactly match the source language code as "en-US" and the
+     * target language code "zh-CN", but all equivalent term set glossaries which
+     * contain "en-US" and "zh-CN" in their language set will be picked.
      * If missing, no filtering is performed.
      * 
* @@ -1046,7 +1111,20 @@ public Builder setFilter(java.lang.String value) { * *
      * Optional. Filter specifying constraints of a list operation.
-     * Filtering is not supported yet, and the parameter currently has no effect.
+     * Specify the constraint by the format of "key=value", where key must be
+     * "src" or "tgt", and the value must be a valid language code.
+     * For multiple restrictions, concatenate them by "AND" (uppercase only),
+     * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used
+     * here, which means using 'en-US' and 'en' can lead to different results,
+     * which depends on the language code you used when you create the glossary.
+     * For the unidirectional glossaries, the "src" and "tgt" add restrictions
+     * on the source and target language code separately.
+     * For the equivalent term set glossaries, the "src" and/or "tgt" add
+     * restrictions on the term set.
+     * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional
+     * glossaries which exactly match the source language code as "en-US" and the
+     * target language code "zh-CN", but all equivalent term set glossaries which
+     * contain "en-US" and "zh-CN" in their language set will be picked.
      * If missing, no filtering is performed.
      * 
* @@ -1065,7 +1143,20 @@ public Builder clearFilter() { * *
      * Optional. Filter specifying constraints of a list operation.
-     * Filtering is not supported yet, and the parameter currently has no effect.
+     * Specify the constraint by the format of "key=value", where key must be
+     * "src" or "tgt", and the value must be a valid language code.
+     * For multiple restrictions, concatenate them by "AND" (uppercase only),
+     * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used
+     * here, which means using 'en-US' and 'en' can lead to different results,
+     * which depends on the language code you used when you create the glossary.
+     * For the unidirectional glossaries, the "src" and "tgt" add restrictions
+     * on the source and target language code separately.
+     * For the equivalent term set glossaries, the "src" and/or "tgt" add
+     * restrictions on the term set.
+     * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional
+     * glossaries which exactly match the source language code as "en-US" and the
+     * target language code "zh-CN", but all equivalent term set glossaries which
+     * contain "en-US" and "zh-CN" in their language set will be picked.
      * If missing, no filtering is performed.
      * 
* diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/ListGlossariesRequestOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/ListGlossariesRequestOrBuilder.java index 7ae14fb0..a939c96b 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/ListGlossariesRequestOrBuilder.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/ListGlossariesRequestOrBuilder.java @@ -102,7 +102,20 @@ public interface ListGlossariesRequestOrBuilder * *
    * Optional. Filter specifying constraints of a list operation.
-   * Filtering is not supported yet, and the parameter currently has no effect.
+   * Specify the constraint by the format of "key=value", where key must be
+   * "src" or "tgt", and the value must be a valid language code.
+   * For multiple restrictions, concatenate them by "AND" (uppercase only),
+   * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used
+   * here, which means using 'en-US' and 'en' can lead to different results,
+   * which depends on the language code you used when you create the glossary.
+   * For the unidirectional glossaries, the "src" and "tgt" add restrictions
+   * on the source and target language code separately.
+   * For the equivalent term set glossaries, the "src" and/or "tgt" add
+   * restrictions on the term set.
+   * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional
+   * glossaries which exactly match the source language code as "en-US" and the
+   * target language code "zh-CN", but all equivalent term set glossaries which
+   * contain "en-US" and "zh-CN" in their language set will be picked.
    * If missing, no filtering is performed.
    * 
* @@ -116,7 +129,20 @@ public interface ListGlossariesRequestOrBuilder * *
    * Optional. Filter specifying constraints of a list operation.
-   * Filtering is not supported yet, and the parameter currently has no effect.
+   * Specify the constraint by the format of "key=value", where key must be
+   * "src" or "tgt", and the value must be a valid language code.
+   * For multiple restrictions, concatenate them by "AND" (uppercase only),
+   * such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used
+   * here, which means using 'en-US' and 'en' can lead to different results,
+   * which depends on the language code you used when you create the glossary.
+   * For the unidirectional glossaries, the "src" and "tgt" add restrictions
+   * on the source and target language code separately.
+   * For the equivalent term set glossaries, the "src" and/or "tgt" add
+   * restrictions on the term set.
+   * For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional
+   * glossaries which exactly match the source language code as "en-US" and the
+   * target language code "zh-CN", but all equivalent term set glossaries which
+   * contain "en-US" and "zh-CN" in their language set will be picked.
    * If missing, no filtering is performed.
    * 
* diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/OutputConfig.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/OutputConfig.java index e77c2a99..99c2b51c 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/OutputConfig.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/OutputConfig.java @@ -194,8 +194,12 @@ public DestinationCase getDestinationCase() { * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -210,9 +214,9 @@ public DestinationCase getDestinationCase() { * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -222,7 +226,7 @@ public DestinationCase getDestinationCase() { * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; @@ -263,8 +267,12 @@ public boolean hasGcsDestination() { * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -279,9 +287,9 @@ public boolean hasGcsDestination() { * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -291,7 +299,7 @@ public boolean hasGcsDestination() { * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; @@ -335,8 +343,12 @@ public com.google.cloud.translate.v3.GcsDestination getGcsDestination() { * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -351,9 +363,9 @@ public com.google.cloud.translate.v3.GcsDestination getGcsDestination() { * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -363,7 +375,7 @@ public com.google.cloud.translate.v3.GcsDestination getGcsDestination() { * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; @@ -770,8 +782,12 @@ public Builder clearDestination() { * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -786,9 +802,9 @@ public Builder clearDestination() { * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -798,7 +814,7 @@ public Builder clearDestination() { * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; @@ -839,8 +855,12 @@ public boolean hasGcsDestination() { * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -855,9 +875,9 @@ public boolean hasGcsDestination() { * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -867,7 +887,7 @@ public boolean hasGcsDestination() { * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; @@ -918,8 +938,12 @@ public com.google.cloud.translate.v3.GcsDestination getGcsDestination() { * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -934,9 +958,9 @@ public com.google.cloud.translate.v3.GcsDestination getGcsDestination() { * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -946,7 +970,7 @@ public com.google.cloud.translate.v3.GcsDestination getGcsDestination() { * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; @@ -994,8 +1018,12 @@ public Builder setGcsDestination(com.google.cloud.translate.v3.GcsDestination va * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -1010,9 +1038,9 @@ public Builder setGcsDestination(com.google.cloud.translate.v3.GcsDestination va * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -1022,7 +1050,7 @@ public Builder setGcsDestination(com.google.cloud.translate.v3.GcsDestination va * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; @@ -1068,8 +1096,12 @@ public Builder setGcsDestination( * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -1084,9 +1116,9 @@ public Builder setGcsDestination( * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -1096,7 +1128,7 @@ public Builder setGcsDestination( * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; @@ -1153,8 +1185,12 @@ public Builder mergeGcsDestination(com.google.cloud.translate.v3.GcsDestination * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -1169,9 +1205,9 @@ public Builder mergeGcsDestination(com.google.cloud.translate.v3.GcsDestination * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -1181,7 +1217,7 @@ public Builder mergeGcsDestination(com.google.cloud.translate.v3.GcsDestination * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; @@ -1232,8 +1268,12 @@ public Builder clearGcsDestination() { * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -1248,9 +1288,9 @@ public Builder clearGcsDestination() { * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -1260,7 +1300,7 @@ public Builder clearGcsDestination() { * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; @@ -1298,8 +1338,12 @@ public com.google.cloud.translate.v3.GcsDestination.Builder getGcsDestinationBui * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -1314,9 +1358,9 @@ public com.google.cloud.translate.v3.GcsDestination.Builder getGcsDestinationBui * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -1326,7 +1370,7 @@ public com.google.cloud.translate.v3.GcsDestination.Builder getGcsDestinationBui * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; @@ -1372,8 +1416,12 @@ public com.google.cloud.translate.v3.GcsDestinationOrBuilder getGcsDestinationOr * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -1388,9 +1436,9 @@ public com.google.cloud.translate.v3.GcsDestinationOrBuilder getGcsDestinationOr * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -1400,7 +1448,7 @@ public com.google.cloud.translate.v3.GcsDestinationOrBuilder getGcsDestinationOr * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/OutputConfigOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/OutputConfigOrBuilder.java index fb7b5f35..5f460bdf 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/OutputConfigOrBuilder.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/OutputConfigOrBuilder.java @@ -53,8 +53,12 @@ public interface OutputConfigOrBuilder * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -69,9 +73,9 @@ public interface OutputConfigOrBuilder * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -81,7 +85,7 @@ public interface OutputConfigOrBuilder * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; @@ -119,8 +123,12 @@ public interface OutputConfigOrBuilder * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -135,9 +143,9 @@ public interface OutputConfigOrBuilder * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -147,7 +155,7 @@ public interface OutputConfigOrBuilder * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; @@ -185,8 +193,12 @@ public interface OutputConfigOrBuilder * changes. Callers should also expect all the content in input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be keeping updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may avoid file updating. + * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) * The format of translations_file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_translations.[extension] * If the input file extension is tsv, the output has the following * columns: * Column 1: ID of the request provided in the input, if it's not @@ -201,9 +213,9 @@ public interface OutputConfigOrBuilder * If input file extension is a txt or html, the translation is directly * written to the output file. If glossary is requested, a separate * glossary_translations_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] * The format of errors file (for target language code 'trg') is: - * `gs://translation_test/a_b_c_'trg'_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_errors.[extension] * If the input file extension is tsv, errors_file contains the following: * Column 1: ID of the request provided in the input, if it's not * provided in the input, then the input row number is used (0-based). @@ -213,7 +225,7 @@ public interface OutputConfigOrBuilder * Error when applying the glossary. * If the input file extension is txt or html, glossary_error_file will be * generated that contains error details. glossary_error_file has format of - * `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + * gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] * * * .google.cloud.translation.v3.GcsDestination gcs_destination = 1; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateDocumentRequest.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateDocumentRequest.java new file mode 100644 index 00000000..42c40916 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateDocumentRequest.java @@ -0,0 +1,2700 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +/** + * + * + *
+ * A document translation request.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3.TranslateDocumentRequest} + */ +public final class TranslateDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3.TranslateDocumentRequest) + TranslateDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use TranslateDocumentRequest.newBuilder() to construct. + private TranslateDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TranslateDocumentRequest() { + parent_ = ""; + sourceLanguageCode_ = ""; + targetLanguageCode_ = ""; + model_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TranslateDocumentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TranslateDocumentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + sourceLanguageCode_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + targetLanguageCode_ = s; + break; + } + case 34: + { + com.google.cloud.translate.v3.DocumentInputConfig.Builder subBuilder = null; + if (documentInputConfig_ != null) { + subBuilder = documentInputConfig_.toBuilder(); + } + documentInputConfig_ = + input.readMessage( + com.google.cloud.translate.v3.DocumentInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(documentInputConfig_); + documentInputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.cloud.translate.v3.DocumentOutputConfig.Builder subBuilder = null; + if (documentOutputConfig_ != null) { + subBuilder = documentOutputConfig_.toBuilder(); + } + documentOutputConfig_ = + input.readMessage( + com.google.cloud.translate.v3.DocumentOutputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(documentOutputConfig_); + documentOutputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + model_ = s; + break; + } + case 58: + { + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder subBuilder = null; + if (glossaryConfig_ != null) { + subBuilder = glossaryConfig_.toBuilder(); + } + glossaryConfig_ = + input.readMessage( + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(glossaryConfig_); + glossaryConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_TranslateDocumentRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_TranslateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.TranslateDocumentRequest.class, + com.google.cloud.translate.v3.TranslateDocumentRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Location to make a regional call.
+   * Format: `projects/{project-number-or-id}/locations/{location-id}`.
+   * For global calls, use `projects/{project-number-or-id}/locations/global` or
+   * `projects/{project-number-or-id}`.
+   * Non-global location is required for requests using AutoML models or custom
+   * glossaries.
+   * Models and glossaries must be within the same region (have the same
+   * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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}`.
+   * For global calls, use `projects/{project-number-or-id}/locations/global` or
+   * `projects/{project-number-or-id}`.
+   * Non-global location is required for requests using AutoML models or custom
+   * glossaries.
+   * Models and glossaries must be within the same region (have the same
+   * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + private volatile java.lang.Object sourceLanguageCode_; + /** + * + * + *
+   * Optional. 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. If the source language isn't specified, the API attempts
+   * to identify the source language automatically and returns the source
+   * language within the response. Source language must be specified if the
+   * request contains a glossary or a custom model.
+   * 
+ * + * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. 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. If the source language isn't specified, the API attempts
+   * to identify the source language automatically and returns the source
+   * language within the response. Source language must be specified if the
+   * request contains a glossary or a custom model.
+   * 
+ * + * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object targetLanguageCode_; + /** + * + * + *
+   * Required. The BCP-47 language code to use for translation of the input
+   * document, set to one of the language codes listed in Language Support.
+   * 
+ * + * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetLanguageCode. + */ + @java.lang.Override + public java.lang.String getTargetLanguageCode() { + java.lang.Object ref = targetLanguageCode_; + 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(); + targetLanguageCode_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The BCP-47 language code to use for translation of the input
+   * document, set to one of the language codes listed in Language Support.
+   * 
+ * + * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetLanguageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetLanguageCodeBytes() { + java.lang.Object ref = targetLanguageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetLanguageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENT_INPUT_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.translate.v3.DocumentInputConfig documentInputConfig_; + /** + * + * + *
+   * Required. Input configurations.
+   * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the documentInputConfig field is set. + */ + @java.lang.Override + public boolean hasDocumentInputConfig() { + return documentInputConfig_ != null; + } + /** + * + * + *
+   * Required. Input configurations.
+   * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentInputConfig. + */ + @java.lang.Override + public com.google.cloud.translate.v3.DocumentInputConfig getDocumentInputConfig() { + return documentInputConfig_ == null + ? com.google.cloud.translate.v3.DocumentInputConfig.getDefaultInstance() + : documentInputConfig_; + } + /** + * + * + *
+   * Required. Input configurations.
+   * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3.DocumentInputConfigOrBuilder + getDocumentInputConfigOrBuilder() { + return getDocumentInputConfig(); + } + + public static final int DOCUMENT_OUTPUT_CONFIG_FIELD_NUMBER = 5; + private com.google.cloud.translate.v3.DocumentOutputConfig documentOutputConfig_; + /** + * + * + *
+   * Optional. Output configurations.
+   * Defines if the output file should be stored within Cloud Storage as well
+   * as the desired output format. If not provided the translated file will
+   * only be returned through a byte-stream and its output mime type will be
+   * the same as the input file's mime type.
+   * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentOutputConfig field is set. + */ + @java.lang.Override + public boolean hasDocumentOutputConfig() { + return documentOutputConfig_ != null; + } + /** + * + * + *
+   * Optional. Output configurations.
+   * Defines if the output file should be stored within Cloud Storage as well
+   * as the desired output format. If not provided the translated file will
+   * only be returned through a byte-stream and its output mime type will be
+   * the same as the input file's mime type.
+   * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentOutputConfig. + */ + @java.lang.Override + public com.google.cloud.translate.v3.DocumentOutputConfig getDocumentOutputConfig() { + return documentOutputConfig_ == null + ? com.google.cloud.translate.v3.DocumentOutputConfig.getDefaultInstance() + : documentOutputConfig_; + } + /** + * + * + *
+   * Optional. Output configurations.
+   * Defines if the output file should be stored within Cloud Storage as well
+   * as the desired output format. If not provided the translated file will
+   * only be returned through a byte-stream and its output mime type will be
+   * the same as the input file's mime type.
+   * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3.DocumentOutputConfigOrBuilder + getDocumentOutputConfigOrBuilder() { + return getDocumentOutputConfig(); + } + + public static final int MODEL_FIELD_NUMBER = 6; + private volatile java.lang.Object model_; + /** + * + * + *
+   * Optional. The `model` type requested for this translation.
+   * The 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 not provided, the default Google model (NMT) will be used for
+   * translation.
+   * 
+ * + * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + 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(); + model_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The `model` type requested for this translation.
+   * The 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 not provided, the default Google model (NMT) will be used for
+   * translation.
+   * 
+ * + * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GLOSSARY_CONFIG_FIELD_NUMBER = 7; + private com.google.cloud.translate.v3.TranslateTextGlossaryConfig glossaryConfig_; + /** + * + * + *
+   * Optional. Glossary to be applied. The glossary must be within the same
+   * region (have the same location-id) as the model, otherwise an
+   * INVALID_ARGUMENT (400) error is returned.
+   * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the glossaryConfig field is set. + */ + @java.lang.Override + public boolean hasGlossaryConfig() { + return glossaryConfig_ != null; + } + /** + * + * + *
+   * Optional. Glossary to be applied. The glossary must be within the same
+   * region (have the same location-id) as the model, otherwise an
+   * INVALID_ARGUMENT (400) error is returned.
+   * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The glossaryConfig. + */ + @java.lang.Override + public com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossaryConfig() { + return glossaryConfig_ == null + ? com.google.cloud.translate.v3.TranslateTextGlossaryConfig.getDefaultInstance() + : glossaryConfig_; + } + /** + * + * + *
+   * Optional. Glossary to be applied. The glossary must be within the same
+   * region (have the same location-id) as the model, otherwise an
+   * INVALID_ARGUMENT (400) error is returned.
+   * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder + getGlossaryConfigOrBuilder() { + return getGlossaryConfig(); + } + + public static final int LABELS_FIELD_NUMBER = 8; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_TranslateDocumentRequest_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Optional. The labels with user-defined metadata for the request.
+   * Label keys and values can be no longer than 63 characters (Unicode
+   * codepoints), can only contain lowercase letters, numeric characters,
+   * underscores and dashes. International characters are allowed. Label values
+   * are optional. Label keys must start with a letter.
+   * See https://cloud.google.com/translate/docs/advanced/labels for more
+   * information.
+   * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional. The labels with user-defined metadata for the request.
+   * Label keys and values can be no longer than 63 characters (Unicode
+   * codepoints), can only contain lowercase letters, numeric characters,
+   * underscores and dashes. International characters are allowed. Label values
+   * are optional. Label keys must start with a letter.
+   * See https://cloud.google.com/translate/docs/advanced/labels for more
+   * information.
+   * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. The labels with user-defined metadata for the request.
+   * Label keys and values can be no longer than 63 characters (Unicode
+   * codepoints), can only contain lowercase letters, numeric characters,
+   * underscores and dashes. International characters are allowed. Label values
+   * are optional. Label keys must start with a letter.
+   * See https://cloud.google.com/translate/docs/advanced/labels for more
+   * information.
+   * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The labels with user-defined metadata for the request.
+   * Label keys and values can be no longer than 63 characters (Unicode
+   * codepoints), can only contain lowercase letters, numeric characters,
+   * underscores and dashes. International characters are allowed. Label values
+   * are optional. Label keys must start with a letter.
+   * See https://cloud.google.com/translate/docs/advanced/labels for more
+   * information.
+   * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getSourceLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, sourceLanguageCode_); + } + if (!getTargetLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, targetLanguageCode_); + } + if (documentInputConfig_ != null) { + output.writeMessage(4, getDocumentInputConfig()); + } + if (documentOutputConfig_ != null) { + output.writeMessage(5, getDocumentOutputConfig()); + } + if (!getModelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, model_); + } + if (glossaryConfig_ != null) { + output.writeMessage(7, getGlossaryConfig()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 8); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getSourceLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, sourceLanguageCode_); + } + if (!getTargetLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, targetLanguageCode_); + } + if (documentInputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDocumentInputConfig()); + } + if (documentOutputConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDocumentOutputConfig()); + } + if (!getModelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, model_); + } + if (glossaryConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getGlossaryConfig()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, labels__); + } + size += unknownFields.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.v3.TranslateDocumentRequest)) { + return super.equals(obj); + } + com.google.cloud.translate.v3.TranslateDocumentRequest other = + (com.google.cloud.translate.v3.TranslateDocumentRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getSourceLanguageCode().equals(other.getSourceLanguageCode())) return false; + if (!getTargetLanguageCode().equals(other.getTargetLanguageCode())) return false; + if (hasDocumentInputConfig() != other.hasDocumentInputConfig()) return false; + if (hasDocumentInputConfig()) { + if (!getDocumentInputConfig().equals(other.getDocumentInputConfig())) return false; + } + if (hasDocumentOutputConfig() != other.hasDocumentOutputConfig()) return false; + if (hasDocumentOutputConfig()) { + if (!getDocumentOutputConfig().equals(other.getDocumentOutputConfig())) return false; + } + if (!getModel().equals(other.getModel())) return false; + if (hasGlossaryConfig() != other.hasGlossaryConfig()) return false; + if (hasGlossaryConfig()) { + if (!getGlossaryConfig().equals(other.getGlossaryConfig())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!unknownFields.equals(other.unknownFields)) 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(); + hash = (37 * hash) + TARGET_LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getTargetLanguageCode().hashCode(); + if (hasDocumentInputConfig()) { + hash = (37 * hash) + DOCUMENT_INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDocumentInputConfig().hashCode(); + } + if (hasDocumentOutputConfig()) { + hash = (37 * hash) + DOCUMENT_OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDocumentOutputConfig().hashCode(); + } + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + if (hasGlossaryConfig()) { + hash = (37 * hash) + GLOSSARY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getGlossaryConfig().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.translate.v3.TranslateDocumentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.TranslateDocumentRequest 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.v3.TranslateDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.TranslateDocumentRequest 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.v3.TranslateDocumentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.TranslateDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.translate.v3.TranslateDocumentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.TranslateDocumentRequest 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.v3.TranslateDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.TranslateDocumentRequest 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.v3.TranslateDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.TranslateDocumentRequest 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.v3.TranslateDocumentRequest 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; + } + /** + * + * + *
+   * A document translation request.
+   * 
+ * + * Protobuf type {@code google.cloud.translation.v3.TranslateDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3.TranslateDocumentRequest) + com.google.cloud.translate.v3.TranslateDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_TranslateDocumentRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 8: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_TranslateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.TranslateDocumentRequest.class, + com.google.cloud.translate.v3.TranslateDocumentRequest.Builder.class); + } + + // Construct using com.google.cloud.translate.v3.TranslateDocumentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + sourceLanguageCode_ = ""; + + targetLanguageCode_ = ""; + + if (documentInputConfigBuilder_ == null) { + documentInputConfig_ = null; + } else { + documentInputConfig_ = null; + documentInputConfigBuilder_ = null; + } + if (documentOutputConfigBuilder_ == null) { + documentOutputConfig_ = null; + } else { + documentOutputConfig_ = null; + documentOutputConfigBuilder_ = null; + } + model_ = ""; + + if (glossaryConfigBuilder_ == null) { + glossaryConfig_ = null; + } else { + glossaryConfig_ = null; + glossaryConfigBuilder_ = null; + } + internalGetMutableLabels().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_TranslateDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3.TranslateDocumentRequest getDefaultInstanceForType() { + return com.google.cloud.translate.v3.TranslateDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3.TranslateDocumentRequest build() { + com.google.cloud.translate.v3.TranslateDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3.TranslateDocumentRequest buildPartial() { + com.google.cloud.translate.v3.TranslateDocumentRequest result = + new com.google.cloud.translate.v3.TranslateDocumentRequest(this); + int from_bitField0_ = bitField0_; + result.parent_ = parent_; + result.sourceLanguageCode_ = sourceLanguageCode_; + result.targetLanguageCode_ = targetLanguageCode_; + if (documentInputConfigBuilder_ == null) { + result.documentInputConfig_ = documentInputConfig_; + } else { + result.documentInputConfig_ = documentInputConfigBuilder_.build(); + } + if (documentOutputConfigBuilder_ == null) { + result.documentOutputConfig_ = documentOutputConfig_; + } else { + result.documentOutputConfig_ = documentOutputConfigBuilder_.build(); + } + result.model_ = model_; + if (glossaryConfigBuilder_ == null) { + result.glossaryConfig_ = glossaryConfig_; + } else { + result.glossaryConfig_ = glossaryConfigBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + onBuilt(); + return result; + } + + @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.v3.TranslateDocumentRequest) { + return mergeFrom((com.google.cloud.translate.v3.TranslateDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3.TranslateDocumentRequest other) { + if (other == com.google.cloud.translate.v3.TranslateDocumentRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getSourceLanguageCode().isEmpty()) { + sourceLanguageCode_ = other.sourceLanguageCode_; + onChanged(); + } + if (!other.getTargetLanguageCode().isEmpty()) { + targetLanguageCode_ = other.targetLanguageCode_; + onChanged(); + } + if (other.hasDocumentInputConfig()) { + mergeDocumentInputConfig(other.getDocumentInputConfig()); + } + if (other.hasDocumentOutputConfig()) { + mergeDocumentOutputConfig(other.getDocumentOutputConfig()); + } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + onChanged(); + } + if (other.hasGlossaryConfig()) { + mergeGlossaryConfig(other.getGlossaryConfig()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.translate.v3.TranslateDocumentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3.TranslateDocumentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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}`.
+     * For global calls, use `projects/{project-number-or-id}/locations/global` or
+     * `projects/{project-number-or-id}`.
+     * Non-global location is required for requests using AutoML models or custom
+     * glossaries.
+     * Models and glossaries must be within the same region (have the same
+     * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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}`.
+     * For global calls, use `projects/{project-number-or-id}/locations/global` or
+     * `projects/{project-number-or-id}`.
+     * Non-global location is required for requests using AutoML models or custom
+     * glossaries.
+     * Models and glossaries must be within the same region (have the same
+     * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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}`.
+     * For global calls, use `projects/{project-number-or-id}/locations/global` or
+     * `projects/{project-number-or-id}`.
+     * Non-global location is required for requests using AutoML models or custom
+     * glossaries.
+     * Models and glossaries must be within the same region (have the same
+     * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Location to make a regional call.
+     * Format: `projects/{project-number-or-id}/locations/{location-id}`.
+     * For global calls, use `projects/{project-number-or-id}/locations/global` or
+     * `projects/{project-number-or-id}`.
+     * Non-global location is required for requests using AutoML models or custom
+     * glossaries.
+     * Models and glossaries must be within the same region (have the same
+     * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Location to make a regional call.
+     * Format: `projects/{project-number-or-id}/locations/{location-id}`.
+     * For global calls, use `projects/{project-number-or-id}/locations/global` or
+     * `projects/{project-number-or-id}`.
+     * Non-global location is required for requests using AutoML models or custom
+     * glossaries.
+     * Models and glossaries must be within the same region (have the same
+     * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + onChanged(); + return this; + } + + private java.lang.Object sourceLanguageCode_ = ""; + /** + * + * + *
+     * Optional. 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. If the source language isn't specified, the API attempts
+     * to identify the source language automatically and returns the source
+     * language within the response. Source language must be specified if the
+     * request contains a glossary or a custom model.
+     * 
+ * + * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. 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. If the source language isn't specified, the API attempts
+     * to identify the source language automatically and returns the source
+     * language within the response. Source language must be specified if the
+     * request contains a glossary or a custom model.
+     * 
+ * + * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. 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. If the source language isn't specified, the API attempts
+     * to identify the source language automatically and returns the source
+     * language within the response. Source language must be specified if the
+     * request contains a glossary or a custom model.
+     * 
+ * + * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. 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. If the source language isn't specified, the API attempts
+     * to identify the source language automatically and returns the source
+     * language within the response. Source language must be specified if the
+     * request contains a glossary or a custom model.
+     * 
+ * + * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearSourceLanguageCode() { + + sourceLanguageCode_ = getDefaultInstance().getSourceLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. 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. If the source language isn't specified, the API attempts
+     * to identify the source language automatically and returns the source
+     * language within the response. Source language must be specified if the
+     * request contains a glossary or a custom model.
+     * 
+ * + * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + onChanged(); + return this; + } + + private java.lang.Object targetLanguageCode_ = ""; + /** + * + * + *
+     * Required. The BCP-47 language code to use for translation of the input
+     * document, set to one of the language codes listed in Language Support.
+     * 
+ * + * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetLanguageCode. + */ + public java.lang.String getTargetLanguageCode() { + java.lang.Object ref = targetLanguageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetLanguageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The BCP-47 language code to use for translation of the input
+     * document, set to one of the language codes listed in Language Support.
+     * 
+ * + * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetLanguageCode. + */ + public com.google.protobuf.ByteString getTargetLanguageCodeBytes() { + java.lang.Object ref = targetLanguageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetLanguageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The BCP-47 language code to use for translation of the input
+     * document, set to one of the language codes listed in Language Support.
+     * 
+ * + * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The targetLanguageCode to set. + * @return This builder for chaining. + */ + public Builder setTargetLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + targetLanguageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BCP-47 language code to use for translation of the input
+     * document, set to one of the language codes listed in Language Support.
+     * 
+ * + * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTargetLanguageCode() { + + targetLanguageCode_ = getDefaultInstance().getTargetLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BCP-47 language code to use for translation of the input
+     * document, set to one of the language codes listed in Language Support.
+     * 
+ * + * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for targetLanguageCode to set. + * @return This builder for chaining. + */ + public Builder setTargetLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + targetLanguageCode_ = value; + onChanged(); + return this; + } + + private com.google.cloud.translate.v3.DocumentInputConfig documentInputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.DocumentInputConfig, + com.google.cloud.translate.v3.DocumentInputConfig.Builder, + com.google.cloud.translate.v3.DocumentInputConfigOrBuilder> + documentInputConfigBuilder_; + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the documentInputConfig field is set. + */ + public boolean hasDocumentInputConfig() { + return documentInputConfigBuilder_ != null || documentInputConfig_ != null; + } + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentInputConfig. + */ + public com.google.cloud.translate.v3.DocumentInputConfig getDocumentInputConfig() { + if (documentInputConfigBuilder_ == null) { + return documentInputConfig_ == null + ? com.google.cloud.translate.v3.DocumentInputConfig.getDefaultInstance() + : documentInputConfig_; + } else { + return documentInputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocumentInputConfig(com.google.cloud.translate.v3.DocumentInputConfig value) { + if (documentInputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentInputConfig_ = value; + onChanged(); + } else { + documentInputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocumentInputConfig( + com.google.cloud.translate.v3.DocumentInputConfig.Builder builderForValue) { + if (documentInputConfigBuilder_ == null) { + documentInputConfig_ = builderForValue.build(); + onChanged(); + } else { + documentInputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDocumentInputConfig( + com.google.cloud.translate.v3.DocumentInputConfig value) { + if (documentInputConfigBuilder_ == null) { + if (documentInputConfig_ != null) { + documentInputConfig_ = + com.google.cloud.translate.v3.DocumentInputConfig.newBuilder(documentInputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + documentInputConfig_ = value; + } + onChanged(); + } else { + documentInputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDocumentInputConfig() { + if (documentInputConfigBuilder_ == null) { + documentInputConfig_ = null; + onChanged(); + } else { + documentInputConfig_ = null; + documentInputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3.DocumentInputConfig.Builder + getDocumentInputConfigBuilder() { + + onChanged(); + return getDocumentInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3.DocumentInputConfigOrBuilder + getDocumentInputConfigOrBuilder() { + if (documentInputConfigBuilder_ != null) { + return documentInputConfigBuilder_.getMessageOrBuilder(); + } else { + return documentInputConfig_ == null + ? com.google.cloud.translate.v3.DocumentInputConfig.getDefaultInstance() + : documentInputConfig_; + } + } + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.DocumentInputConfig, + com.google.cloud.translate.v3.DocumentInputConfig.Builder, + com.google.cloud.translate.v3.DocumentInputConfigOrBuilder> + getDocumentInputConfigFieldBuilder() { + if (documentInputConfigBuilder_ == null) { + documentInputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.DocumentInputConfig, + com.google.cloud.translate.v3.DocumentInputConfig.Builder, + com.google.cloud.translate.v3.DocumentInputConfigOrBuilder>( + getDocumentInputConfig(), getParentForChildren(), isClean()); + documentInputConfig_ = null; + } + return documentInputConfigBuilder_; + } + + private com.google.cloud.translate.v3.DocumentOutputConfig documentOutputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.DocumentOutputConfig, + com.google.cloud.translate.v3.DocumentOutputConfig.Builder, + com.google.cloud.translate.v3.DocumentOutputConfigOrBuilder> + documentOutputConfigBuilder_; + /** + * + * + *
+     * Optional. Output configurations.
+     * Defines if the output file should be stored within Cloud Storage as well
+     * as the desired output format. If not provided the translated file will
+     * only be returned through a byte-stream and its output mime type will be
+     * the same as the input file's mime type.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentOutputConfig field is set. + */ + public boolean hasDocumentOutputConfig() { + return documentOutputConfigBuilder_ != null || documentOutputConfig_ != null; + } + /** + * + * + *
+     * Optional. Output configurations.
+     * Defines if the output file should be stored within Cloud Storage as well
+     * as the desired output format. If not provided the translated file will
+     * only be returned through a byte-stream and its output mime type will be
+     * the same as the input file's mime type.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentOutputConfig. + */ + public com.google.cloud.translate.v3.DocumentOutputConfig getDocumentOutputConfig() { + if (documentOutputConfigBuilder_ == null) { + return documentOutputConfig_ == null + ? com.google.cloud.translate.v3.DocumentOutputConfig.getDefaultInstance() + : documentOutputConfig_; + } else { + return documentOutputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Output configurations.
+     * Defines if the output file should be stored within Cloud Storage as well
+     * as the desired output format. If not provided the translated file will
+     * only be returned through a byte-stream and its output mime type will be
+     * the same as the input file's mime type.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentOutputConfig( + com.google.cloud.translate.v3.DocumentOutputConfig value) { + if (documentOutputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentOutputConfig_ = value; + onChanged(); + } else { + documentOutputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Output configurations.
+     * Defines if the output file should be stored within Cloud Storage as well
+     * as the desired output format. If not provided the translated file will
+     * only be returned through a byte-stream and its output mime type will be
+     * the same as the input file's mime type.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentOutputConfig( + com.google.cloud.translate.v3.DocumentOutputConfig.Builder builderForValue) { + if (documentOutputConfigBuilder_ == null) { + documentOutputConfig_ = builderForValue.build(); + onChanged(); + } else { + documentOutputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Output configurations.
+     * Defines if the output file should be stored within Cloud Storage as well
+     * as the desired output format. If not provided the translated file will
+     * only be returned through a byte-stream and its output mime type will be
+     * the same as the input file's mime type.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDocumentOutputConfig( + com.google.cloud.translate.v3.DocumentOutputConfig value) { + if (documentOutputConfigBuilder_ == null) { + if (documentOutputConfig_ != null) { + documentOutputConfig_ = + com.google.cloud.translate.v3.DocumentOutputConfig.newBuilder(documentOutputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + documentOutputConfig_ = value; + } + onChanged(); + } else { + documentOutputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Output configurations.
+     * Defines if the output file should be stored within Cloud Storage as well
+     * as the desired output format. If not provided the translated file will
+     * only be returned through a byte-stream and its output mime type will be
+     * the same as the input file's mime type.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDocumentOutputConfig() { + if (documentOutputConfigBuilder_ == null) { + documentOutputConfig_ = null; + onChanged(); + } else { + documentOutputConfig_ = null; + documentOutputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Output configurations.
+     * Defines if the output file should be stored within Cloud Storage as well
+     * as the desired output format. If not provided the translated file will
+     * only be returned through a byte-stream and its output mime type will be
+     * the same as the input file's mime type.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.translate.v3.DocumentOutputConfig.Builder + getDocumentOutputConfigBuilder() { + + onChanged(); + return getDocumentOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Output configurations.
+     * Defines if the output file should be stored within Cloud Storage as well
+     * as the desired output format. If not provided the translated file will
+     * only be returned through a byte-stream and its output mime type will be
+     * the same as the input file's mime type.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.translate.v3.DocumentOutputConfigOrBuilder + getDocumentOutputConfigOrBuilder() { + if (documentOutputConfigBuilder_ != null) { + return documentOutputConfigBuilder_.getMessageOrBuilder(); + } else { + return documentOutputConfig_ == null + ? com.google.cloud.translate.v3.DocumentOutputConfig.getDefaultInstance() + : documentOutputConfig_; + } + } + /** + * + * + *
+     * Optional. Output configurations.
+     * Defines if the output file should be stored within Cloud Storage as well
+     * as the desired output format. If not provided the translated file will
+     * only be returned through a byte-stream and its output mime type will be
+     * the same as the input file's mime type.
+     * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.DocumentOutputConfig, + com.google.cloud.translate.v3.DocumentOutputConfig.Builder, + com.google.cloud.translate.v3.DocumentOutputConfigOrBuilder> + getDocumentOutputConfigFieldBuilder() { + if (documentOutputConfigBuilder_ == null) { + documentOutputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.DocumentOutputConfig, + com.google.cloud.translate.v3.DocumentOutputConfig.Builder, + com.google.cloud.translate.v3.DocumentOutputConfigOrBuilder>( + getDocumentOutputConfig(), getParentForChildren(), isClean()); + documentOutputConfig_ = null; + } + return documentOutputConfigBuilder_; + } + + private java.lang.Object model_ = ""; + /** + * + * + *
+     * Optional. The `model` type requested for this translation.
+     * The 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 not provided, the default Google model (NMT) will be used for
+     * translation.
+     * 
+ * + * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The `model` type requested for this translation.
+     * The 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 not provided, the default Google model (NMT) will be used for
+     * translation.
+     * 
+ * + * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for model. + */ + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The `model` type requested for this translation.
+     * The 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 not provided, the default Google model (NMT) will be used for
+     * translation.
+     * 
+ * + * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + model_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The `model` type requested for this translation.
+     * The 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 not provided, the default Google model (NMT) will be used for
+     * translation.
+     * 
+ * + * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearModel() { + + model_ = getDefaultInstance().getModel(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The `model` type requested for this translation.
+     * The 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 not provided, the default Google model (NMT) will be used for
+     * translation.
+     * 
+ * + * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + model_ = value; + onChanged(); + return this; + } + + private com.google.cloud.translate.v3.TranslateTextGlossaryConfig glossaryConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.TranslateTextGlossaryConfig, + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder, + com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder> + glossaryConfigBuilder_; + /** + * + * + *
+     * Optional. Glossary to be applied. The glossary must be within the same
+     * region (have the same location-id) as the model, otherwise an
+     * INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the glossaryConfig field is set. + */ + public boolean hasGlossaryConfig() { + return glossaryConfigBuilder_ != null || glossaryConfig_ != null; + } + /** + * + * + *
+     * Optional. Glossary to be applied. The glossary must be within the same
+     * region (have the same location-id) as the model, otherwise an
+     * INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The glossaryConfig. + */ + public com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossaryConfig() { + if (glossaryConfigBuilder_ == null) { + return glossaryConfig_ == null + ? com.google.cloud.translate.v3.TranslateTextGlossaryConfig.getDefaultInstance() + : glossaryConfig_; + } else { + return glossaryConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Glossary to be applied. The glossary must be within the same
+     * region (have the same location-id) as the model, otherwise an
+     * INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGlossaryConfig( + com.google.cloud.translate.v3.TranslateTextGlossaryConfig value) { + if (glossaryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + glossaryConfig_ = value; + onChanged(); + } else { + glossaryConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Glossary to be applied. The glossary must be within the same
+     * region (have the same location-id) as the model, otherwise an
+     * INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGlossaryConfig( + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder builderForValue) { + if (glossaryConfigBuilder_ == null) { + glossaryConfig_ = builderForValue.build(); + onChanged(); + } else { + glossaryConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Glossary to be applied. The glossary must be within the same
+     * region (have the same location-id) as the model, otherwise an
+     * INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeGlossaryConfig( + com.google.cloud.translate.v3.TranslateTextGlossaryConfig value) { + if (glossaryConfigBuilder_ == null) { + if (glossaryConfig_ != null) { + glossaryConfig_ = + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.newBuilder(glossaryConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + glossaryConfig_ = value; + } + onChanged(); + } else { + glossaryConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Glossary to be applied. The glossary must be within the same
+     * region (have the same location-id) as the model, otherwise an
+     * INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearGlossaryConfig() { + if (glossaryConfigBuilder_ == null) { + glossaryConfig_ = null; + onChanged(); + } else { + glossaryConfig_ = null; + glossaryConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Glossary to be applied. The glossary must be within the same
+     * region (have the same location-id) as the model, otherwise an
+     * INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder + getGlossaryConfigBuilder() { + + onChanged(); + return getGlossaryConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Glossary to be applied. The glossary must be within the same
+     * region (have the same location-id) as the model, otherwise an
+     * INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder + getGlossaryConfigOrBuilder() { + if (glossaryConfigBuilder_ != null) { + return glossaryConfigBuilder_.getMessageOrBuilder(); + } else { + return glossaryConfig_ == null + ? com.google.cloud.translate.v3.TranslateTextGlossaryConfig.getDefaultInstance() + : glossaryConfig_; + } + } + /** + * + * + *
+     * Optional. Glossary to be applied. The glossary must be within the same
+     * region (have the same location-id) as the model, otherwise an
+     * INVALID_ARGUMENT (400) error is returned.
+     * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.TranslateTextGlossaryConfig, + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder, + com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder> + getGlossaryConfigFieldBuilder() { + if (glossaryConfigBuilder_ == null) { + glossaryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.TranslateTextGlossaryConfig, + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder, + com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder>( + getGlossaryConfig(), getParentForChildren(), isClean()); + glossaryConfig_ = null; + } + return glossaryConfigBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata for the request.
+     * Label keys and values can be no longer than 63 characters (Unicode
+     * codepoints), can only contain lowercase letters, numeric characters,
+     * underscores and dashes. International characters are allowed. Label values
+     * are optional. Label keys must start with a letter.
+     * See https://cloud.google.com/translate/docs/advanced/labels for more
+     * information.
+     * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata for the request.
+     * Label keys and values can be no longer than 63 characters (Unicode
+     * codepoints), can only contain lowercase letters, numeric characters,
+     * underscores and dashes. International characters are allowed. Label values
+     * are optional. Label keys must start with a letter.
+     * See https://cloud.google.com/translate/docs/advanced/labels for more
+     * information.
+     * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata for the request.
+     * Label keys and values can be no longer than 63 characters (Unicode
+     * codepoints), can only contain lowercase letters, numeric characters,
+     * underscores and dashes. International characters are allowed. Label values
+     * are optional. Label keys must start with a letter.
+     * See https://cloud.google.com/translate/docs/advanced/labels for more
+     * information.
+     * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata for the request.
+     * Label keys and values can be no longer than 63 characters (Unicode
+     * codepoints), can only contain lowercase letters, numeric characters,
+     * underscores and dashes. International characters are allowed. Label values
+     * are optional. Label keys must start with a letter.
+     * See https://cloud.google.com/translate/docs/advanced/labels for more
+     * information.
+     * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata for the request.
+     * Label keys and values can be no longer than 63 characters (Unicode
+     * codepoints), can only contain lowercase letters, numeric characters,
+     * underscores and dashes. International characters are allowed. Label values
+     * are optional. Label keys must start with a letter.
+     * See https://cloud.google.com/translate/docs/advanced/labels for more
+     * information.
+     * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata for the request.
+     * Label keys and values can be no longer than 63 characters (Unicode
+     * codepoints), can only contain lowercase letters, numeric characters,
+     * underscores and dashes. International characters are allowed. Label values
+     * are optional. Label keys must start with a letter.
+     * See https://cloud.google.com/translate/docs/advanced/labels for more
+     * information.
+     * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. The labels with user-defined metadata for the request.
+     * Label keys and values can be no longer than 63 characters (Unicode
+     * codepoints), can only contain lowercase letters, numeric characters,
+     * underscores and dashes. International characters are allowed. Label values
+     * are optional. Label keys must start with a letter.
+     * See https://cloud.google.com/translate/docs/advanced/labels for more
+     * information.
+     * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + 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.v3.TranslateDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3.TranslateDocumentRequest) + private static final com.google.cloud.translate.v3.TranslateDocumentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3.TranslateDocumentRequest(); + } + + public static com.google.cloud.translate.v3.TranslateDocumentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TranslateDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TranslateDocumentRequest(input, extensionRegistry); + } + }; + + 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.v3.TranslateDocumentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateDocumentRequestOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateDocumentRequestOrBuilder.java new file mode 100644 index 00000000..5ee3b875 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateDocumentRequestOrBuilder.java @@ -0,0 +1,390 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +public interface TranslateDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3.TranslateDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Location to make a regional call.
+   * Format: `projects/{project-number-or-id}/locations/{location-id}`.
+   * For global calls, use `projects/{project-number-or-id}/locations/global` or
+   * `projects/{project-number-or-id}`.
+   * Non-global location is required for requests using AutoML models or custom
+   * glossaries.
+   * Models and glossaries must be within the same region (have the same
+   * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Location to make a regional call.
+   * Format: `projects/{project-number-or-id}/locations/{location-id}`.
+   * For global calls, use `projects/{project-number-or-id}/locations/global` or
+   * `projects/{project-number-or-id}`.
+   * Non-global location is required for requests using AutoML models or custom
+   * glossaries.
+   * Models and glossaries must be within the same region (have the same
+   * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. 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. If the source language isn't specified, the API attempts
+   * to identify the source language automatically and returns the source
+   * language within the response. Source language must be specified if the
+   * request contains a glossary or a custom model.
+   * 
+ * + * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The sourceLanguageCode. + */ + java.lang.String getSourceLanguageCode(); + /** + * + * + *
+   * Optional. 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. If the source language isn't specified, the API attempts
+   * to identify the source language automatically and returns the source
+   * language within the response. Source language must be specified if the
+   * request contains a glossary or a custom model.
+   * 
+ * + * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for sourceLanguageCode. + */ + com.google.protobuf.ByteString getSourceLanguageCodeBytes(); + + /** + * + * + *
+   * Required. The BCP-47 language code to use for translation of the input
+   * document, set to one of the language codes listed in Language Support.
+   * 
+ * + * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetLanguageCode. + */ + java.lang.String getTargetLanguageCode(); + /** + * + * + *
+   * Required. The BCP-47 language code to use for translation of the input
+   * document, set to one of the language codes listed in Language Support.
+   * 
+ * + * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetLanguageCode. + */ + com.google.protobuf.ByteString getTargetLanguageCodeBytes(); + + /** + * + * + *
+   * Required. Input configurations.
+   * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the documentInputConfig field is set. + */ + boolean hasDocumentInputConfig(); + /** + * + * + *
+   * Required. Input configurations.
+   * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentInputConfig. + */ + com.google.cloud.translate.v3.DocumentInputConfig getDocumentInputConfig(); + /** + * + * + *
+   * Required. Input configurations.
+   * 
+ * + * + * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.translate.v3.DocumentInputConfigOrBuilder getDocumentInputConfigOrBuilder(); + + /** + * + * + *
+   * Optional. Output configurations.
+   * Defines if the output file should be stored within Cloud Storage as well
+   * as the desired output format. If not provided the translated file will
+   * only be returned through a byte-stream and its output mime type will be
+   * the same as the input file's mime type.
+   * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the documentOutputConfig field is set. + */ + boolean hasDocumentOutputConfig(); + /** + * + * + *
+   * Optional. Output configurations.
+   * Defines if the output file should be stored within Cloud Storage as well
+   * as the desired output format. If not provided the translated file will
+   * only be returned through a byte-stream and its output mime type will be
+   * the same as the input file's mime type.
+   * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentOutputConfig. + */ + com.google.cloud.translate.v3.DocumentOutputConfig getDocumentOutputConfig(); + /** + * + * + *
+   * Optional. Output configurations.
+   * Defines if the output file should be stored within Cloud Storage as well
+   * as the desired output format. If not provided the translated file will
+   * only be returned through a byte-stream and its output mime type will be
+   * the same as the input file's mime type.
+   * 
+ * + * + * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.translate.v3.DocumentOutputConfigOrBuilder getDocumentOutputConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The `model` type requested for this translation.
+   * The 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 not provided, the default Google model (NMT) will be used for
+   * translation.
+   * 
+ * + * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The model. + */ + java.lang.String getModel(); + /** + * + * + *
+   * Optional. The `model` type requested for this translation.
+   * The 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 not provided, the default Google model (NMT) will be used for
+   * translation.
+   * 
+ * + * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for model. + */ + com.google.protobuf.ByteString getModelBytes(); + + /** + * + * + *
+   * Optional. Glossary to be applied. The glossary must be within the same
+   * region (have the same location-id) as the model, otherwise an
+   * INVALID_ARGUMENT (400) error is returned.
+   * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the glossaryConfig field is set. + */ + boolean hasGlossaryConfig(); + /** + * + * + *
+   * Optional. Glossary to be applied. The glossary must be within the same
+   * region (have the same location-id) as the model, otherwise an
+   * INVALID_ARGUMENT (400) error is returned.
+   * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The glossaryConfig. + */ + com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossaryConfig(); + /** + * + * + *
+   * Optional. Glossary to be applied. The glossary must be within the same
+   * region (have the same location-id) as the model, otherwise an
+   * INVALID_ARGUMENT (400) error is returned.
+   * 
+ * + * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder getGlossaryConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The labels with user-defined metadata for the request.
+   * Label keys and values can be no longer than 63 characters (Unicode
+   * codepoints), can only contain lowercase letters, numeric characters,
+   * underscores and dashes. International characters are allowed. Label values
+   * are optional. Label keys must start with a letter.
+   * See https://cloud.google.com/translate/docs/advanced/labels for more
+   * information.
+   * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. The labels with user-defined metadata for the request.
+   * Label keys and values can be no longer than 63 characters (Unicode
+   * codepoints), can only contain lowercase letters, numeric characters,
+   * underscores and dashes. International characters are allowed. Label values
+   * are optional. Label keys must start with a letter.
+   * See https://cloud.google.com/translate/docs/advanced/labels for more
+   * information.
+   * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. The labels with user-defined metadata for the request.
+   * Label keys and values can be no longer than 63 characters (Unicode
+   * codepoints), can only contain lowercase letters, numeric characters,
+   * underscores and dashes. International characters are allowed. Label values
+   * are optional. Label keys must start with a letter.
+   * See https://cloud.google.com/translate/docs/advanced/labels for more
+   * information.
+   * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. The labels with user-defined metadata for the request.
+   * Label keys and values can be no longer than 63 characters (Unicode
+   * codepoints), can only contain lowercase letters, numeric characters,
+   * underscores and dashes. International characters are allowed. Label values
+   * are optional. Label keys must start with a letter.
+   * See https://cloud.google.com/translate/docs/advanced/labels for more
+   * information.
+   * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Optional. The labels with user-defined metadata for the request.
+   * Label keys and values can be no longer than 63 characters (Unicode
+   * codepoints), can only contain lowercase letters, numeric characters,
+   * underscores and dashes. International characters are allowed. Label values
+   * are optional. Label keys must start with a letter.
+   * See https://cloud.google.com/translate/docs/advanced/labels for more
+   * information.
+   * 
+ * + * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateDocumentResponse.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateDocumentResponse.java new file mode 100644 index 00000000..dee70b06 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateDocumentResponse.java @@ -0,0 +1,1570 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +/** + * + * + *
+ * A translated document response message.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3.TranslateDocumentResponse} + */ +public final class TranslateDocumentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3.TranslateDocumentResponse) + TranslateDocumentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use TranslateDocumentResponse.newBuilder() to construct. + private TranslateDocumentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TranslateDocumentResponse() { + model_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TranslateDocumentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TranslateDocumentResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.translate.v3.DocumentTranslation.Builder subBuilder = null; + if (documentTranslation_ != null) { + subBuilder = documentTranslation_.toBuilder(); + } + documentTranslation_ = + input.readMessage( + com.google.cloud.translate.v3.DocumentTranslation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(documentTranslation_); + documentTranslation_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.translate.v3.DocumentTranslation.Builder subBuilder = null; + if (glossaryDocumentTranslation_ != null) { + subBuilder = glossaryDocumentTranslation_.toBuilder(); + } + glossaryDocumentTranslation_ = + input.readMessage( + com.google.cloud.translate.v3.DocumentTranslation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(glossaryDocumentTranslation_); + glossaryDocumentTranslation_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + model_ = s; + break; + } + case 34: + { + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder subBuilder = null; + if (glossaryConfig_ != null) { + subBuilder = glossaryConfig_.toBuilder(); + } + glossaryConfig_ = + input.readMessage( + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(glossaryConfig_); + glossaryConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_TranslateDocumentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_TranslateDocumentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.TranslateDocumentResponse.class, + com.google.cloud.translate.v3.TranslateDocumentResponse.Builder.class); + } + + public static final int DOCUMENT_TRANSLATION_FIELD_NUMBER = 1; + private com.google.cloud.translate.v3.DocumentTranslation documentTranslation_; + /** + * + * + *
+   * Translated document.
+   * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + * + * @return Whether the documentTranslation field is set. + */ + @java.lang.Override + public boolean hasDocumentTranslation() { + return documentTranslation_ != null; + } + /** + * + * + *
+   * Translated document.
+   * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + * + * @return The documentTranslation. + */ + @java.lang.Override + public com.google.cloud.translate.v3.DocumentTranslation getDocumentTranslation() { + return documentTranslation_ == null + ? com.google.cloud.translate.v3.DocumentTranslation.getDefaultInstance() + : documentTranslation_; + } + /** + * + * + *
+   * Translated document.
+   * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + */ + @java.lang.Override + public com.google.cloud.translate.v3.DocumentTranslationOrBuilder + getDocumentTranslationOrBuilder() { + return getDocumentTranslation(); + } + + public static final int GLOSSARY_DOCUMENT_TRANSLATION_FIELD_NUMBER = 2; + private com.google.cloud.translate.v3.DocumentTranslation glossaryDocumentTranslation_; + /** + * + * + *
+   * The document's translation output if a glossary is provided in the request.
+   * This can be the same as [TranslateDocumentResponse.document_translation]
+   * if no glossary terms apply.
+   * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + * + * @return Whether the glossaryDocumentTranslation field is set. + */ + @java.lang.Override + public boolean hasGlossaryDocumentTranslation() { + return glossaryDocumentTranslation_ != null; + } + /** + * + * + *
+   * The document's translation output if a glossary is provided in the request.
+   * This can be the same as [TranslateDocumentResponse.document_translation]
+   * if no glossary terms apply.
+   * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + * + * @return The glossaryDocumentTranslation. + */ + @java.lang.Override + public com.google.cloud.translate.v3.DocumentTranslation getGlossaryDocumentTranslation() { + return glossaryDocumentTranslation_ == null + ? com.google.cloud.translate.v3.DocumentTranslation.getDefaultInstance() + : glossaryDocumentTranslation_; + } + /** + * + * + *
+   * The document's translation output if a glossary is provided in the request.
+   * This can be the same as [TranslateDocumentResponse.document_translation]
+   * if no glossary terms apply.
+   * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3.DocumentTranslationOrBuilder + getGlossaryDocumentTranslationOrBuilder() { + return getGlossaryDocumentTranslation(); + } + + public static final int MODEL_FIELD_NUMBER = 3; + private volatile java.lang.Object model_; + /** + * + * + *
+   * Only present when 'model' is present in the request.
+   * 'model' is normalized to have a project number.
+   * For example:
+   * If the 'model' field in TranslateDocumentRequest is:
+   * `projects/{project-id}/locations/{location-id}/models/general/nmt` then
+   * `model` here would be normalized to
+   * `projects/{project-number}/locations/{location-id}/models/general/nmt`.
+   * 
+ * + * string model = 3; + * + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + 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(); + model_ = s; + return s; + } + } + /** + * + * + *
+   * Only present when 'model' is present in the request.
+   * 'model' is normalized to have a project number.
+   * For example:
+   * If the 'model' field in TranslateDocumentRequest is:
+   * `projects/{project-id}/locations/{location-id}/models/general/nmt` then
+   * `model` here would be normalized to
+   * `projects/{project-number}/locations/{location-id}/models/general/nmt`.
+   * 
+ * + * string model = 3; + * + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GLOSSARY_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.translate.v3.TranslateTextGlossaryConfig glossaryConfig_; + /** + * + * + *
+   * The `glossary_config` used for this translation.
+   * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + * + * @return Whether the glossaryConfig field is set. + */ + @java.lang.Override + public boolean hasGlossaryConfig() { + return glossaryConfig_ != null; + } + /** + * + * + *
+   * The `glossary_config` used for this translation.
+   * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + * + * @return The glossaryConfig. + */ + @java.lang.Override + public com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossaryConfig() { + return glossaryConfig_ == null + ? com.google.cloud.translate.v3.TranslateTextGlossaryConfig.getDefaultInstance() + : glossaryConfig_; + } + /** + * + * + *
+   * The `glossary_config` used for this translation.
+   * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + */ + @java.lang.Override + public com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder + getGlossaryConfigOrBuilder() { + return getGlossaryConfig(); + } + + 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 (documentTranslation_ != null) { + output.writeMessage(1, getDocumentTranslation()); + } + if (glossaryDocumentTranslation_ != null) { + output.writeMessage(2, getGlossaryDocumentTranslation()); + } + if (!getModelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, model_); + } + if (glossaryConfig_ != null) { + output.writeMessage(4, getGlossaryConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (documentTranslation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocumentTranslation()); + } + if (glossaryDocumentTranslation_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getGlossaryDocumentTranslation()); + } + if (!getModelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, model_); + } + if (glossaryConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getGlossaryConfig()); + } + size += unknownFields.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.v3.TranslateDocumentResponse)) { + return super.equals(obj); + } + com.google.cloud.translate.v3.TranslateDocumentResponse other = + (com.google.cloud.translate.v3.TranslateDocumentResponse) obj; + + if (hasDocumentTranslation() != other.hasDocumentTranslation()) return false; + if (hasDocumentTranslation()) { + if (!getDocumentTranslation().equals(other.getDocumentTranslation())) return false; + } + if (hasGlossaryDocumentTranslation() != other.hasGlossaryDocumentTranslation()) return false; + if (hasGlossaryDocumentTranslation()) { + if (!getGlossaryDocumentTranslation().equals(other.getGlossaryDocumentTranslation())) + return false; + } + if (!getModel().equals(other.getModel())) return false; + if (hasGlossaryConfig() != other.hasGlossaryConfig()) return false; + if (hasGlossaryConfig()) { + if (!getGlossaryConfig().equals(other.getGlossaryConfig())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDocumentTranslation()) { + hash = (37 * hash) + DOCUMENT_TRANSLATION_FIELD_NUMBER; + hash = (53 * hash) + getDocumentTranslation().hashCode(); + } + if (hasGlossaryDocumentTranslation()) { + hash = (37 * hash) + GLOSSARY_DOCUMENT_TRANSLATION_FIELD_NUMBER; + hash = (53 * hash) + getGlossaryDocumentTranslation().hashCode(); + } + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + if (hasGlossaryConfig()) { + hash = (37 * hash) + GLOSSARY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getGlossaryConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.translate.v3.TranslateDocumentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.TranslateDocumentResponse 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.v3.TranslateDocumentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.TranslateDocumentResponse 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.v3.TranslateDocumentResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3.TranslateDocumentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.translate.v3.TranslateDocumentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.TranslateDocumentResponse 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.v3.TranslateDocumentResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.TranslateDocumentResponse 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.v3.TranslateDocumentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3.TranslateDocumentResponse 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.v3.TranslateDocumentResponse 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; + } + /** + * + * + *
+   * A translated document response message.
+   * 
+ * + * Protobuf type {@code google.cloud.translation.v3.TranslateDocumentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3.TranslateDocumentResponse) + com.google.cloud.translate.v3.TranslateDocumentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_TranslateDocumentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_TranslateDocumentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3.TranslateDocumentResponse.class, + com.google.cloud.translate.v3.TranslateDocumentResponse.Builder.class); + } + + // Construct using com.google.cloud.translate.v3.TranslateDocumentResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (documentTranslationBuilder_ == null) { + documentTranslation_ = null; + } else { + documentTranslation_ = null; + documentTranslationBuilder_ = null; + } + if (glossaryDocumentTranslationBuilder_ == null) { + glossaryDocumentTranslation_ = null; + } else { + glossaryDocumentTranslation_ = null; + glossaryDocumentTranslationBuilder_ = null; + } + model_ = ""; + + if (glossaryConfigBuilder_ == null) { + glossaryConfig_ = null; + } else { + glossaryConfig_ = null; + glossaryConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.translate.v3.TranslationServiceProto + .internal_static_google_cloud_translation_v3_TranslateDocumentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3.TranslateDocumentResponse getDefaultInstanceForType() { + return com.google.cloud.translate.v3.TranslateDocumentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3.TranslateDocumentResponse build() { + com.google.cloud.translate.v3.TranslateDocumentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3.TranslateDocumentResponse buildPartial() { + com.google.cloud.translate.v3.TranslateDocumentResponse result = + new com.google.cloud.translate.v3.TranslateDocumentResponse(this); + if (documentTranslationBuilder_ == null) { + result.documentTranslation_ = documentTranslation_; + } else { + result.documentTranslation_ = documentTranslationBuilder_.build(); + } + if (glossaryDocumentTranslationBuilder_ == null) { + result.glossaryDocumentTranslation_ = glossaryDocumentTranslation_; + } else { + result.glossaryDocumentTranslation_ = glossaryDocumentTranslationBuilder_.build(); + } + result.model_ = model_; + if (glossaryConfigBuilder_ == null) { + result.glossaryConfig_ = glossaryConfig_; + } else { + result.glossaryConfig_ = glossaryConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.v3.TranslateDocumentResponse) { + return mergeFrom((com.google.cloud.translate.v3.TranslateDocumentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3.TranslateDocumentResponse other) { + if (other == com.google.cloud.translate.v3.TranslateDocumentResponse.getDefaultInstance()) + return this; + if (other.hasDocumentTranslation()) { + mergeDocumentTranslation(other.getDocumentTranslation()); + } + if (other.hasGlossaryDocumentTranslation()) { + mergeGlossaryDocumentTranslation(other.getGlossaryDocumentTranslation()); + } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + onChanged(); + } + if (other.hasGlossaryConfig()) { + mergeGlossaryConfig(other.getGlossaryConfig()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.translate.v3.TranslateDocumentResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3.TranslateDocumentResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.translate.v3.DocumentTranslation documentTranslation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.DocumentTranslation, + com.google.cloud.translate.v3.DocumentTranslation.Builder, + com.google.cloud.translate.v3.DocumentTranslationOrBuilder> + documentTranslationBuilder_; + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + * + * @return Whether the documentTranslation field is set. + */ + public boolean hasDocumentTranslation() { + return documentTranslationBuilder_ != null || documentTranslation_ != null; + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + * + * @return The documentTranslation. + */ + public com.google.cloud.translate.v3.DocumentTranslation getDocumentTranslation() { + if (documentTranslationBuilder_ == null) { + return documentTranslation_ == null + ? com.google.cloud.translate.v3.DocumentTranslation.getDefaultInstance() + : documentTranslation_; + } else { + return documentTranslationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + */ + public Builder setDocumentTranslation(com.google.cloud.translate.v3.DocumentTranslation value) { + if (documentTranslationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentTranslation_ = value; + onChanged(); + } else { + documentTranslationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + */ + public Builder setDocumentTranslation( + com.google.cloud.translate.v3.DocumentTranslation.Builder builderForValue) { + if (documentTranslationBuilder_ == null) { + documentTranslation_ = builderForValue.build(); + onChanged(); + } else { + documentTranslationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + */ + public Builder mergeDocumentTranslation( + com.google.cloud.translate.v3.DocumentTranslation value) { + if (documentTranslationBuilder_ == null) { + if (documentTranslation_ != null) { + documentTranslation_ = + com.google.cloud.translate.v3.DocumentTranslation.newBuilder(documentTranslation_) + .mergeFrom(value) + .buildPartial(); + } else { + documentTranslation_ = value; + } + onChanged(); + } else { + documentTranslationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + */ + public Builder clearDocumentTranslation() { + if (documentTranslationBuilder_ == null) { + documentTranslation_ = null; + onChanged(); + } else { + documentTranslation_ = null; + documentTranslationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + */ + public com.google.cloud.translate.v3.DocumentTranslation.Builder + getDocumentTranslationBuilder() { + + onChanged(); + return getDocumentTranslationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + */ + public com.google.cloud.translate.v3.DocumentTranslationOrBuilder + getDocumentTranslationOrBuilder() { + if (documentTranslationBuilder_ != null) { + return documentTranslationBuilder_.getMessageOrBuilder(); + } else { + return documentTranslation_ == null + ? com.google.cloud.translate.v3.DocumentTranslation.getDefaultInstance() + : documentTranslation_; + } + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.DocumentTranslation, + com.google.cloud.translate.v3.DocumentTranslation.Builder, + com.google.cloud.translate.v3.DocumentTranslationOrBuilder> + getDocumentTranslationFieldBuilder() { + if (documentTranslationBuilder_ == null) { + documentTranslationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.DocumentTranslation, + com.google.cloud.translate.v3.DocumentTranslation.Builder, + com.google.cloud.translate.v3.DocumentTranslationOrBuilder>( + getDocumentTranslation(), getParentForChildren(), isClean()); + documentTranslation_ = null; + } + return documentTranslationBuilder_; + } + + private com.google.cloud.translate.v3.DocumentTranslation glossaryDocumentTranslation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.DocumentTranslation, + com.google.cloud.translate.v3.DocumentTranslation.Builder, + com.google.cloud.translate.v3.DocumentTranslationOrBuilder> + glossaryDocumentTranslationBuilder_; + /** + * + * + *
+     * The document's translation output if a glossary is provided in the request.
+     * This can be the same as [TranslateDocumentResponse.document_translation]
+     * if no glossary terms apply.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + * + * @return Whether the glossaryDocumentTranslation field is set. + */ + public boolean hasGlossaryDocumentTranslation() { + return glossaryDocumentTranslationBuilder_ != null || glossaryDocumentTranslation_ != null; + } + /** + * + * + *
+     * The document's translation output if a glossary is provided in the request.
+     * This can be the same as [TranslateDocumentResponse.document_translation]
+     * if no glossary terms apply.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + * + * @return The glossaryDocumentTranslation. + */ + public com.google.cloud.translate.v3.DocumentTranslation getGlossaryDocumentTranslation() { + if (glossaryDocumentTranslationBuilder_ == null) { + return glossaryDocumentTranslation_ == null + ? com.google.cloud.translate.v3.DocumentTranslation.getDefaultInstance() + : glossaryDocumentTranslation_; + } else { + return glossaryDocumentTranslationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The document's translation output if a glossary is provided in the request.
+     * This can be the same as [TranslateDocumentResponse.document_translation]
+     * if no glossary terms apply.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + */ + public Builder setGlossaryDocumentTranslation( + com.google.cloud.translate.v3.DocumentTranslation value) { + if (glossaryDocumentTranslationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + glossaryDocumentTranslation_ = value; + onChanged(); + } else { + glossaryDocumentTranslationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The document's translation output if a glossary is provided in the request.
+     * This can be the same as [TranslateDocumentResponse.document_translation]
+     * if no glossary terms apply.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + */ + public Builder setGlossaryDocumentTranslation( + com.google.cloud.translate.v3.DocumentTranslation.Builder builderForValue) { + if (glossaryDocumentTranslationBuilder_ == null) { + glossaryDocumentTranslation_ = builderForValue.build(); + onChanged(); + } else { + glossaryDocumentTranslationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The document's translation output if a glossary is provided in the request.
+     * This can be the same as [TranslateDocumentResponse.document_translation]
+     * if no glossary terms apply.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + */ + public Builder mergeGlossaryDocumentTranslation( + com.google.cloud.translate.v3.DocumentTranslation value) { + if (glossaryDocumentTranslationBuilder_ == null) { + if (glossaryDocumentTranslation_ != null) { + glossaryDocumentTranslation_ = + com.google.cloud.translate.v3.DocumentTranslation.newBuilder( + glossaryDocumentTranslation_) + .mergeFrom(value) + .buildPartial(); + } else { + glossaryDocumentTranslation_ = value; + } + onChanged(); + } else { + glossaryDocumentTranslationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The document's translation output if a glossary is provided in the request.
+     * This can be the same as [TranslateDocumentResponse.document_translation]
+     * if no glossary terms apply.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + */ + public Builder clearGlossaryDocumentTranslation() { + if (glossaryDocumentTranslationBuilder_ == null) { + glossaryDocumentTranslation_ = null; + onChanged(); + } else { + glossaryDocumentTranslation_ = null; + glossaryDocumentTranslationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The document's translation output if a glossary is provided in the request.
+     * This can be the same as [TranslateDocumentResponse.document_translation]
+     * if no glossary terms apply.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + */ + public com.google.cloud.translate.v3.DocumentTranslation.Builder + getGlossaryDocumentTranslationBuilder() { + + onChanged(); + return getGlossaryDocumentTranslationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The document's translation output if a glossary is provided in the request.
+     * This can be the same as [TranslateDocumentResponse.document_translation]
+     * if no glossary terms apply.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + */ + public com.google.cloud.translate.v3.DocumentTranslationOrBuilder + getGlossaryDocumentTranslationOrBuilder() { + if (glossaryDocumentTranslationBuilder_ != null) { + return glossaryDocumentTranslationBuilder_.getMessageOrBuilder(); + } else { + return glossaryDocumentTranslation_ == null + ? com.google.cloud.translate.v3.DocumentTranslation.getDefaultInstance() + : glossaryDocumentTranslation_; + } + } + /** + * + * + *
+     * The document's translation output if a glossary is provided in the request.
+     * This can be the same as [TranslateDocumentResponse.document_translation]
+     * if no glossary terms apply.
+     * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.DocumentTranslation, + com.google.cloud.translate.v3.DocumentTranslation.Builder, + com.google.cloud.translate.v3.DocumentTranslationOrBuilder> + getGlossaryDocumentTranslationFieldBuilder() { + if (glossaryDocumentTranslationBuilder_ == null) { + glossaryDocumentTranslationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.DocumentTranslation, + com.google.cloud.translate.v3.DocumentTranslation.Builder, + com.google.cloud.translate.v3.DocumentTranslationOrBuilder>( + getGlossaryDocumentTranslation(), getParentForChildren(), isClean()); + glossaryDocumentTranslation_ = null; + } + return glossaryDocumentTranslationBuilder_; + } + + private java.lang.Object model_ = ""; + /** + * + * + *
+     * Only present when 'model' is present in the request.
+     * 'model' is normalized to have a project number.
+     * For example:
+     * If the 'model' field in TranslateDocumentRequest is:
+     * `projects/{project-id}/locations/{location-id}/models/general/nmt` then
+     * `model` here would be normalized to
+     * `projects/{project-number}/locations/{location-id}/models/general/nmt`.
+     * 
+ * + * string model = 3; + * + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Only present when 'model' is present in the request.
+     * 'model' is normalized to have a project number.
+     * For example:
+     * If the 'model' field in TranslateDocumentRequest is:
+     * `projects/{project-id}/locations/{location-id}/models/general/nmt` then
+     * `model` here would be normalized to
+     * `projects/{project-number}/locations/{location-id}/models/general/nmt`.
+     * 
+ * + * string model = 3; + * + * @return The bytes for model. + */ + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Only present when 'model' is present in the request.
+     * 'model' is normalized to have a project number.
+     * For example:
+     * If the 'model' field in TranslateDocumentRequest is:
+     * `projects/{project-id}/locations/{location-id}/models/general/nmt` then
+     * `model` here would be normalized to
+     * `projects/{project-number}/locations/{location-id}/models/general/nmt`.
+     * 
+ * + * string model = 3; + * + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + model_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Only present when 'model' is present in the request.
+     * 'model' is normalized to have a project number.
+     * For example:
+     * If the 'model' field in TranslateDocumentRequest is:
+     * `projects/{project-id}/locations/{location-id}/models/general/nmt` then
+     * `model` here would be normalized to
+     * `projects/{project-number}/locations/{location-id}/models/general/nmt`.
+     * 
+ * + * string model = 3; + * + * @return This builder for chaining. + */ + public Builder clearModel() { + + model_ = getDefaultInstance().getModel(); + onChanged(); + return this; + } + /** + * + * + *
+     * Only present when 'model' is present in the request.
+     * 'model' is normalized to have a project number.
+     * For example:
+     * If the 'model' field in TranslateDocumentRequest is:
+     * `projects/{project-id}/locations/{location-id}/models/general/nmt` then
+     * `model` here would be normalized to
+     * `projects/{project-number}/locations/{location-id}/models/general/nmt`.
+     * 
+ * + * string model = 3; + * + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + model_ = value; + onChanged(); + return this; + } + + private com.google.cloud.translate.v3.TranslateTextGlossaryConfig glossaryConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.TranslateTextGlossaryConfig, + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder, + com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder> + glossaryConfigBuilder_; + /** + * + * + *
+     * The `glossary_config` used for this translation.
+     * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + * + * @return Whether the glossaryConfig field is set. + */ + public boolean hasGlossaryConfig() { + return glossaryConfigBuilder_ != null || glossaryConfig_ != null; + } + /** + * + * + *
+     * The `glossary_config` used for this translation.
+     * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + * + * @return The glossaryConfig. + */ + public com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossaryConfig() { + if (glossaryConfigBuilder_ == null) { + return glossaryConfig_ == null + ? com.google.cloud.translate.v3.TranslateTextGlossaryConfig.getDefaultInstance() + : glossaryConfig_; + } else { + return glossaryConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The `glossary_config` used for this translation.
+     * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + */ + public Builder setGlossaryConfig( + com.google.cloud.translate.v3.TranslateTextGlossaryConfig value) { + if (glossaryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + glossaryConfig_ = value; + onChanged(); + } else { + glossaryConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The `glossary_config` used for this translation.
+     * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + */ + public Builder setGlossaryConfig( + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder builderForValue) { + if (glossaryConfigBuilder_ == null) { + glossaryConfig_ = builderForValue.build(); + onChanged(); + } else { + glossaryConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The `glossary_config` used for this translation.
+     * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + */ + public Builder mergeGlossaryConfig( + com.google.cloud.translate.v3.TranslateTextGlossaryConfig value) { + if (glossaryConfigBuilder_ == null) { + if (glossaryConfig_ != null) { + glossaryConfig_ = + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.newBuilder(glossaryConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + glossaryConfig_ = value; + } + onChanged(); + } else { + glossaryConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The `glossary_config` used for this translation.
+     * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + */ + public Builder clearGlossaryConfig() { + if (glossaryConfigBuilder_ == null) { + glossaryConfig_ = null; + onChanged(); + } else { + glossaryConfig_ = null; + glossaryConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The `glossary_config` used for this translation.
+     * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + */ + public com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder + getGlossaryConfigBuilder() { + + onChanged(); + return getGlossaryConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The `glossary_config` used for this translation.
+     * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + */ + public com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder + getGlossaryConfigOrBuilder() { + if (glossaryConfigBuilder_ != null) { + return glossaryConfigBuilder_.getMessageOrBuilder(); + } else { + return glossaryConfig_ == null + ? com.google.cloud.translate.v3.TranslateTextGlossaryConfig.getDefaultInstance() + : glossaryConfig_; + } + } + /** + * + * + *
+     * The `glossary_config` used for this translation.
+     * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.TranslateTextGlossaryConfig, + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder, + com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder> + getGlossaryConfigFieldBuilder() { + if (glossaryConfigBuilder_ == null) { + glossaryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3.TranslateTextGlossaryConfig, + com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder, + com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder>( + getGlossaryConfig(), getParentForChildren(), isClean()); + glossaryConfig_ = null; + } + return glossaryConfigBuilder_; + } + + @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.v3.TranslateDocumentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3.TranslateDocumentResponse) + private static final com.google.cloud.translate.v3.TranslateDocumentResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3.TranslateDocumentResponse(); + } + + public static com.google.cloud.translate.v3.TranslateDocumentResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TranslateDocumentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TranslateDocumentResponse(input, extensionRegistry); + } + }; + + 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.v3.TranslateDocumentResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateDocumentResponseOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateDocumentResponseOrBuilder.java new file mode 100644 index 00000000..fbd5e73d --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateDocumentResponseOrBuilder.java @@ -0,0 +1,177 @@ +/* + * Copyright 2020 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/v3/translation_service.proto + +package com.google.cloud.translate.v3; + +public interface TranslateDocumentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3.TranslateDocumentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Translated document.
+   * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + * + * @return Whether the documentTranslation field is set. + */ + boolean hasDocumentTranslation(); + /** + * + * + *
+   * Translated document.
+   * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + * + * @return The documentTranslation. + */ + com.google.cloud.translate.v3.DocumentTranslation getDocumentTranslation(); + /** + * + * + *
+   * Translated document.
+   * 
+ * + * .google.cloud.translation.v3.DocumentTranslation document_translation = 1; + */ + com.google.cloud.translate.v3.DocumentTranslationOrBuilder getDocumentTranslationOrBuilder(); + + /** + * + * + *
+   * The document's translation output if a glossary is provided in the request.
+   * This can be the same as [TranslateDocumentResponse.document_translation]
+   * if no glossary terms apply.
+   * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + * + * @return Whether the glossaryDocumentTranslation field is set. + */ + boolean hasGlossaryDocumentTranslation(); + /** + * + * + *
+   * The document's translation output if a glossary is provided in the request.
+   * This can be the same as [TranslateDocumentResponse.document_translation]
+   * if no glossary terms apply.
+   * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + * + * @return The glossaryDocumentTranslation. + */ + com.google.cloud.translate.v3.DocumentTranslation getGlossaryDocumentTranslation(); + /** + * + * + *
+   * The document's translation output if a glossary is provided in the request.
+   * This can be the same as [TranslateDocumentResponse.document_translation]
+   * if no glossary terms apply.
+   * 
+ * + * .google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2; + * + */ + com.google.cloud.translate.v3.DocumentTranslationOrBuilder + getGlossaryDocumentTranslationOrBuilder(); + + /** + * + * + *
+   * Only present when 'model' is present in the request.
+   * 'model' is normalized to have a project number.
+   * For example:
+   * If the 'model' field in TranslateDocumentRequest is:
+   * `projects/{project-id}/locations/{location-id}/models/general/nmt` then
+   * `model` here would be normalized to
+   * `projects/{project-number}/locations/{location-id}/models/general/nmt`.
+   * 
+ * + * string model = 3; + * + * @return The model. + */ + java.lang.String getModel(); + /** + * + * + *
+   * Only present when 'model' is present in the request.
+   * 'model' is normalized to have a project number.
+   * For example:
+   * If the 'model' field in TranslateDocumentRequest is:
+   * `projects/{project-id}/locations/{location-id}/models/general/nmt` then
+   * `model` here would be normalized to
+   * `projects/{project-number}/locations/{location-id}/models/general/nmt`.
+   * 
+ * + * string model = 3; + * + * @return The bytes for model. + */ + com.google.protobuf.ByteString getModelBytes(); + + /** + * + * + *
+   * The `glossary_config` used for this translation.
+   * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + * + * @return Whether the glossaryConfig field is set. + */ + boolean hasGlossaryConfig(); + /** + * + * + *
+   * The `glossary_config` used for this translation.
+   * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + * + * @return The glossaryConfig. + */ + com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossaryConfig(); + /** + * + * + *
+   * The `glossary_config` used for this translation.
+   * 
+ * + * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4; + */ + com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder getGlossaryConfigOrBuilder(); +} diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextGlossaryConfig.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextGlossaryConfig.java index 7043e021..aeee3232 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextGlossaryConfig.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextGlossaryConfig.java @@ -123,8 +123,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. Specifies the glossary used for this translation. Use
-   * this format: projects/*/locations/*/glossaries/*
+   * Required. The `glossary` to be applied for this translation.
+   * The format depends on glossary:
+   * - User provided custom glossary:
+   *   `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
    * 
* * string glossary = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -147,8 +149,10 @@ public java.lang.String getGlossary() { * * *
-   * Required. Specifies the glossary used for this translation. Use
-   * this format: projects/*/locations/*/glossaries/*
+   * Required. The `glossary` to be applied for this translation.
+   * The format depends on glossary:
+   * - User provided custom glossary:
+   *   `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
    * 
* * string glossary = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -527,8 +531,10 @@ public Builder mergeFrom( * * *
-     * Required. Specifies the glossary used for this translation. Use
-     * this format: projects/*/locations/*/glossaries/*
+     * Required. The `glossary` to be applied for this translation.
+     * The format depends on glossary:
+     * - User provided custom glossary:
+     *   `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
      * 
* * string glossary = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -550,8 +556,10 @@ public java.lang.String getGlossary() { * * *
-     * Required. Specifies the glossary used for this translation. Use
-     * this format: projects/*/locations/*/glossaries/*
+     * Required. The `glossary` to be applied for this translation.
+     * The format depends on glossary:
+     * - User provided custom glossary:
+     *   `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
      * 
* * string glossary = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -573,8 +581,10 @@ public com.google.protobuf.ByteString getGlossaryBytes() { * * *
-     * Required. Specifies the glossary used for this translation. Use
-     * this format: projects/*/locations/*/glossaries/*
+     * Required. The `glossary` to be applied for this translation.
+     * The format depends on glossary:
+     * - User provided custom glossary:
+     *   `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
      * 
* * string glossary = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -595,8 +605,10 @@ public Builder setGlossary(java.lang.String value) { * * *
-     * Required. Specifies the glossary used for this translation. Use
-     * this format: projects/*/locations/*/glossaries/*
+     * Required. The `glossary` to be applied for this translation.
+     * The format depends on glossary:
+     * - User provided custom glossary:
+     *   `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
      * 
* * string glossary = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -613,8 +625,10 @@ public Builder clearGlossary() { * * *
-     * Required. Specifies the glossary used for this translation. Use
-     * this format: projects/*/locations/*/glossaries/*
+     * Required. The `glossary` to be applied for this translation.
+     * The format depends on glossary:
+     * - User provided custom glossary:
+     *   `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
      * 
* * string glossary = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextGlossaryConfigOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextGlossaryConfigOrBuilder.java index 085a82be..d4a47362 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextGlossaryConfigOrBuilder.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextGlossaryConfigOrBuilder.java @@ -27,8 +27,10 @@ public interface TranslateTextGlossaryConfigOrBuilder * * *
-   * Required. Specifies the glossary used for this translation. Use
-   * this format: projects/*/locations/*/glossaries/*
+   * Required. The `glossary` to be applied for this translation.
+   * The format depends on glossary:
+   * - User provided custom glossary:
+   *   `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
    * 
* * string glossary = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -40,8 +42,10 @@ public interface TranslateTextGlossaryConfigOrBuilder * * *
-   * Required. Specifies the glossary used for this translation. Use
-   * this format: projects/*/locations/*/glossaries/*
+   * Required. The `glossary` to be applied for this translation.
+   * The format depends on glossary:
+   * - User provided custom glossary:
+   *   `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
    * 
* * string glossary = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextRequest.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextRequest.java index da6a484a..926bcc23 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextRequest.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextRequest.java @@ -206,7 +206,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { * *
    * Required. The content of the input in string format.
-   * We recommend the total content be less than 30k codepoints.
+   * We recommend the total content be less than 30k codepoints. The max length
+   * of this field is 1024.
    * Use BatchTranslateText for larger text.
    * 
* @@ -222,7 +223,8 @@ public com.google.protobuf.ProtocolStringList getContentsList() { * *
    * Required. The content of the input in string format.
-   * We recommend the total content be less than 30k codepoints.
+   * We recommend the total content be less than 30k codepoints. The max length
+   * of this field is 1024.
    * Use BatchTranslateText for larger text.
    * 
* @@ -238,7 +240,8 @@ public int getContentsCount() { * *
    * Required. The content of the input in string format.
-   * We recommend the total content be less than 30k codepoints.
+   * We recommend the total content be less than 30k codepoints. The max length
+   * of this field is 1024.
    * Use BatchTranslateText for larger text.
    * 
* @@ -255,7 +258,8 @@ public java.lang.String getContents(int index) { * *
    * Required. The content of the input in string format.
-   * We recommend the total content be less than 30k codepoints.
+   * We recommend the total content be less than 30k codepoints. The max length
+   * of this field is 1024.
    * Use BatchTranslateText for larger text.
    * 
* @@ -510,11 +514,10 @@ public com.google.protobuf.ByteString getParentBytes() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * For global (non-regionalized) requests, use `location-id` `global`. * For example, * `projects/{project-number-or-id}/locations/global/models/general/nmt`. - * If missing, the system decides which google base model to use. + * If not provided, the default Google model (NMT) will be used. * * * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -543,11 +546,10 @@ public java.lang.String getModel() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * For global (non-regionalized) requests, use `location-id` `global`. * For example, * `projects/{project-number-or-id}/locations/global/models/general/nmt`. - * If missing, the system decides which google base model to use. + * If not provided, the default Google model (NMT) will be used. * * * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -662,7 +664,8 @@ public int getLabelsCount() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -689,7 +692,8 @@ public java.util.Map getLabels() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -707,7 +711,8 @@ public java.util.Map getLabelsMap() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -729,7 +734,8 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -1247,7 +1253,8 @@ private void ensureContentsIsMutable() { * *
      * Required. The content of the input in string format.
-     * We recommend the total content be less than 30k codepoints.
+     * We recommend the total content be less than 30k codepoints. The max length
+     * of this field is 1024.
      * Use BatchTranslateText for larger text.
      * 
* @@ -1263,7 +1270,8 @@ public com.google.protobuf.ProtocolStringList getContentsList() { * *
      * Required. The content of the input in string format.
-     * We recommend the total content be less than 30k codepoints.
+     * We recommend the total content be less than 30k codepoints. The max length
+     * of this field is 1024.
      * Use BatchTranslateText for larger text.
      * 
* @@ -1279,7 +1287,8 @@ public int getContentsCount() { * *
      * Required. The content of the input in string format.
-     * We recommend the total content be less than 30k codepoints.
+     * We recommend the total content be less than 30k codepoints. The max length
+     * of this field is 1024.
      * Use BatchTranslateText for larger text.
      * 
* @@ -1296,7 +1305,8 @@ public java.lang.String getContents(int index) { * *
      * Required. The content of the input in string format.
-     * We recommend the total content be less than 30k codepoints.
+     * We recommend the total content be less than 30k codepoints. The max length
+     * of this field is 1024.
      * Use BatchTranslateText for larger text.
      * 
* @@ -1313,7 +1323,8 @@ public com.google.protobuf.ByteString getContentsBytes(int index) { * *
      * Required. The content of the input in string format.
-     * We recommend the total content be less than 30k codepoints.
+     * We recommend the total content be less than 30k codepoints. The max length
+     * of this field is 1024.
      * Use BatchTranslateText for larger text.
      * 
* @@ -1337,7 +1348,8 @@ public Builder setContents(int index, java.lang.String value) { * *
      * Required. The content of the input in string format.
-     * We recommend the total content be less than 30k codepoints.
+     * We recommend the total content be less than 30k codepoints. The max length
+     * of this field is 1024.
      * Use BatchTranslateText for larger text.
      * 
* @@ -1360,7 +1372,8 @@ public Builder addContents(java.lang.String value) { * *
      * Required. The content of the input in string format.
-     * We recommend the total content be less than 30k codepoints.
+     * We recommend the total content be less than 30k codepoints. The max length
+     * of this field is 1024.
      * Use BatchTranslateText for larger text.
      * 
* @@ -1380,7 +1393,8 @@ public Builder addAllContents(java.lang.Iterable values) { * *
      * Required. The content of the input in string format.
-     * We recommend the total content be less than 30k codepoints.
+     * We recommend the total content be less than 30k codepoints. The max length
+     * of this field is 1024.
      * Use BatchTranslateText for larger text.
      * 
* @@ -1399,7 +1413,8 @@ public Builder clearContents() { * *
      * Required. The content of the input in string format.
-     * We recommend the total content be less than 30k codepoints.
+     * We recommend the total content be less than 30k codepoints. The max length
+     * of this field is 1024.
      * Use BatchTranslateText for larger text.
      * 
* @@ -1939,11 +1954,10 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * For global (non-regionalized) requests, use `location-id` `global`. * For example, * `projects/{project-number-or-id}/locations/global/models/general/nmt`. - * If missing, the system decides which google base model to use. + * If not provided, the default Google model (NMT) will be used. * * * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -1971,11 +1985,10 @@ public java.lang.String getModel() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * For global (non-regionalized) requests, use `location-id` `global`. * For example, * `projects/{project-number-or-id}/locations/global/models/general/nmt`. - * If missing, the system decides which google base model to use. + * If not provided, the default Google model (NMT) will be used. * * * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -2003,11 +2016,10 @@ public com.google.protobuf.ByteString getModelBytes() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * For global (non-regionalized) requests, use `location-id` `global`. * For example, * `projects/{project-number-or-id}/locations/global/models/general/nmt`. - * If missing, the system decides which google base model to use. + * If not provided, the default Google model (NMT) will be used. * * * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -2034,11 +2046,10 @@ public Builder setModel(java.lang.String value) { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * For global (non-regionalized) requests, use `location-id` `global`. * For example, * `projects/{project-number-or-id}/locations/global/models/general/nmt`. - * If missing, the system decides which google base model to use. + * If not provided, the default Google model (NMT) will be used. * * * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -2061,11 +2072,10 @@ public Builder clearModel() { * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * For global (non-regionalized) requests, use `location-id` `global`. * For example, * `projects/{project-number-or-id}/locations/global/models/general/nmt`. - * If missing, the system decides which google base model to use. + * If not provided, the default Google model (NMT) will be used. * * * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -2344,7 +2354,8 @@ public int getLabelsCount() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -2371,7 +2382,8 @@ public java.util.Map getLabels() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -2389,7 +2401,8 @@ public java.util.Map getLabelsMap() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -2412,7 +2425,8 @@ public java.lang.String getLabelsOrDefault( * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -2442,7 +2456,8 @@ public Builder clearLabels() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -2468,7 +2483,8 @@ public java.util.Map getMutableLabels() { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -2492,7 +2508,8 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextRequestOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextRequestOrBuilder.java index f0d8b497..cac410ea 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextRequestOrBuilder.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslateTextRequestOrBuilder.java @@ -28,7 +28,8 @@ public interface TranslateTextRequestOrBuilder * *
    * Required. The content of the input in string format.
-   * We recommend the total content be less than 30k codepoints.
+   * We recommend the total content be less than 30k codepoints. The max length
+   * of this field is 1024.
    * Use BatchTranslateText for larger text.
    * 
* @@ -42,7 +43,8 @@ public interface TranslateTextRequestOrBuilder * *
    * Required. The content of the input in string format.
-   * We recommend the total content be less than 30k codepoints.
+   * We recommend the total content be less than 30k codepoints. The max length
+   * of this field is 1024.
    * Use BatchTranslateText for larger text.
    * 
* @@ -56,7 +58,8 @@ public interface TranslateTextRequestOrBuilder * *
    * Required. The content of the input in string format.
-   * We recommend the total content be less than 30k codepoints.
+   * We recommend the total content be less than 30k codepoints. The max length
+   * of this field is 1024.
    * Use BatchTranslateText for larger text.
    * 
* @@ -71,7 +74,8 @@ public interface TranslateTextRequestOrBuilder * *
    * Required. The content of the input in string format.
-   * We recommend the total content be less than 30k codepoints.
+   * We recommend the total content be less than 30k codepoints. The max length
+   * of this field is 1024.
    * Use BatchTranslateText for larger text.
    * 
* @@ -226,11 +230,10 @@ public interface TranslateTextRequestOrBuilder * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * For global (non-regionalized) requests, use `location-id` `global`. * For example, * `projects/{project-number-or-id}/locations/global/models/general/nmt`. - * If missing, the system decides which google base model to use. + * If not provided, the default Google model (NMT) will be used. * * * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -248,11 +251,10 @@ public interface TranslateTextRequestOrBuilder * `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`, - * `projects/{project-number-or-id}/locations/{location-id}/models/general/base` * For global (non-regionalized) requests, use `location-id` `global`. * For example, * `projects/{project-number-or-id}/locations/global/models/general/nmt`. - * If missing, the system decides which google base model to use. + * If not provided, the default Google model (NMT) will be used. * * * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; @@ -317,7 +319,8 @@ public interface TranslateTextRequestOrBuilder * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -332,7 +335,8 @@ public interface TranslateTextRequestOrBuilder * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -350,7 +354,8 @@ public interface TranslateTextRequestOrBuilder * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -365,7 +370,8 @@ public interface TranslateTextRequestOrBuilder * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; @@ -380,7 +386,8 @@ public interface TranslateTextRequestOrBuilder * (Unicode codepoints), can only contain lowercase letters, numeric * characters, underscores and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. - * See https://cloud.google.com/translate/docs/labels for more information. + * See https://cloud.google.com/translate/docs/advanced/labels for more + * information. * * * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/Translation.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/Translation.java index 3f1da21b..ac1df570 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/Translation.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/Translation.java @@ -151,6 +151,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Text translated into the target language.
+   * If an error occurs during translation, this field might be excluded from
+   * the response.
    * 
* * string translated_text = 1; @@ -174,6 +176,8 @@ public java.lang.String getTranslatedText() { * *
    * Text translated into the target language.
+   * If an error occurs during translation, this field might be excluded from
+   * the response.
    * 
* * string translated_text = 1; @@ -740,6 +744,8 @@ public Builder mergeFrom( * *
      * Text translated into the target language.
+     * If an error occurs during translation, this field might be excluded from
+     * the response.
      * 
* * string translated_text = 1; @@ -762,6 +768,8 @@ public java.lang.String getTranslatedText() { * *
      * Text translated into the target language.
+     * If an error occurs during translation, this field might be excluded from
+     * the response.
      * 
* * string translated_text = 1; @@ -784,6 +792,8 @@ public com.google.protobuf.ByteString getTranslatedTextBytes() { * *
      * Text translated into the target language.
+     * If an error occurs during translation, this field might be excluded from
+     * the response.
      * 
* * string translated_text = 1; @@ -805,6 +815,8 @@ public Builder setTranslatedText(java.lang.String value) { * *
      * Text translated into the target language.
+     * If an error occurs during translation, this field might be excluded from
+     * the response.
      * 
* * string translated_text = 1; @@ -822,6 +834,8 @@ public Builder clearTranslatedText() { * *
      * Text translated into the target language.
+     * If an error occurs during translation, this field might be excluded from
+     * the response.
      * 
* * string translated_text = 1; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationOrBuilder.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationOrBuilder.java index ebe1a280..5bddec80 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationOrBuilder.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationOrBuilder.java @@ -28,6 +28,8 @@ public interface TranslationOrBuilder * *
    * Text translated into the target language.
+   * If an error occurs during translation, this field might be excluded from
+   * the response.
    * 
* * string translated_text = 1; @@ -40,6 +42,8 @@ public interface TranslationOrBuilder * *
    * Text translated into the target language.
+   * If an error occurs during translation, this field might be excluded from
+   * the response.
    * 
* * string translated_text = 1; diff --git a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationServiceProto.java b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationServiceProto.java index 43d3ff53..a910f6fb 100644 --- a/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationServiceProto.java +++ b/proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationServiceProto.java @@ -91,6 +91,30 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_translation_v3_OutputConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_translation_v3_OutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_DocumentInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_DocumentInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_DocumentOutputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_DocumentOutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_TranslateDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_TranslateDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_TranslateDocumentRequest_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_TranslateDocumentRequest_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_DocumentTranslation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_DocumentTranslation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_TranslateDocumentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_TranslateDocumentResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_translation_v3_BatchTranslateTextRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -163,6 +187,38 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_translation_v3_DeleteGlossaryResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_translation_v3_DeleteGlossaryResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_ModelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_ModelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_GlossariesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_GlossariesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_FormatConversionsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_FormatConversionsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_BatchDocumentInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_BatchDocumentInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_BatchDocumentOutputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_BatchDocumentOutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_BatchTranslateDocumentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_BatchTranslateDocumentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3_BatchTranslateDocumentMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3_BatchTranslateDocumentMetadata_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -177,196 +233,287 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "v3\032\034google/api/annotations.proto\032\027google" + "/api/client.proto\032\037google/api/field_beha" + "vior.proto\032\031google/api/resource.proto\032#g" - + "oogle/longrunning/operations.proto\032\037goog" - + "le/protobuf/timestamp.proto\"N\n\033Translate" - + "TextGlossaryConfig\022\025\n\010glossary\030\001 \001(\tB\003\340A" - + "\002\022\030\n\013ignore_case\030\002 \001(\010B\003\340A\001\"\265\003\n\024Translat" - + "eTextRequest\022\025\n\010contents\030\001 \003(\tB\003\340A\002\022\026\n\tm" - + "ime_type\030\003 \001(\tB\003\340A\001\022!\n\024source_language_c" - + "ode\030\004 \001(\tB\003\340A\001\022!\n\024target_language_code\030\005" - + " \001(\tB\003\340A\002\0229\n\006parent\030\010 \001(\tB)\340A\002\372A#\n!locat" - + "ions.googleapis.com/Location\022\022\n\005model\030\006 " - + "\001(\tB\003\340A\001\022V\n\017glossary_config\030\007 \001(\01328.goog" - + "le.cloud.translation.v3.TranslateTextGlo" - + "ssaryConfigB\003\340A\001\022R\n\006labels\030\n \003(\0132=.googl" - + "e.cloud.translation.v3.TranslateTextRequ" - + "est.LabelsEntryB\003\340A\001\032-\n\013LabelsEntry\022\013\n\003k" - + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\240\001\n\025Translat" - + "eTextResponse\022>\n\014translations\030\001 \003(\0132(.go" - + "ogle.cloud.translation.v3.Translation\022G\n" - + "\025glossary_translations\030\003 \003(\0132(.google.cl" - + "oud.translation.v3.Translation\"\250\001\n\013Trans" - + "lation\022\027\n\017translated_text\030\001 \001(\t\022\r\n\005model" - + "\030\002 \001(\t\022\036\n\026detected_language_code\030\004 \001(\t\022Q" - + "\n\017glossary_config\030\003 \001(\01328.google.cloud.t" - + "ranslation.v3.TranslateTextGlossaryConfi" - + "g\"\237\002\n\025DetectLanguageRequest\0229\n\006parent\030\005 " - + "\001(\tB)\340A\002\372A#\n!locations.googleapis.com/Lo" - + "cation\022\022\n\005model\030\004 \001(\tB\003\340A\001\022\021\n\007content\030\001 " - + "\001(\tH\000\022\026\n\tmime_type\030\003 \001(\tB\003\340A\001\022S\n\006labels\030" - + "\006 \003(\0132>.google.cloud.translation.v3.Dete" - + "ctLanguageRequest.LabelsEntryB\003\340A\001\032-\n\013La" + + "oogle/longrunning/operations.proto\032\033goog" + + "le/protobuf/empty.proto\032\037google/protobuf" + + "/timestamp.proto\032\027google/rpc/status.prot" + + "o\"N\n\033TranslateTextGlossaryConfig\022\025\n\010glos" + + "sary\030\001 \001(\tB\003\340A\002\022\030\n\013ignore_case\030\002 \001(\010B\003\340A" + + "\001\"\265\003\n\024TranslateTextRequest\022\025\n\010contents\030\001" + + " \003(\tB\003\340A\002\022\026\n\tmime_type\030\003 \001(\tB\003\340A\001\022!\n\024sou" + + "rce_language_code\030\004 \001(\tB\003\340A\001\022!\n\024target_l" + + "anguage_code\030\005 \001(\tB\003\340A\002\0229\n\006parent\030\010 \001(\tB" + + ")\340A\002\372A#\n!locations.googleapis.com/Locati" + + "on\022\022\n\005model\030\006 \001(\tB\003\340A\001\022V\n\017glossary_confi" + + "g\030\007 \001(\01328.google.cloud.translation.v3.Tr" + + "anslateTextGlossaryConfigB\003\340A\001\022R\n\006labels" + + "\030\n \003(\0132=.google.cloud.translation.v3.Tra" + + "nslateTextRequest.LabelsEntryB\003\340A\001\032-\n\013La" + "belsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" - + "\001B\010\n\006source\"=\n\020DetectedLanguage\022\025\n\rlangu" - + "age_code\030\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002\"Z\n\026De" - + "tectLanguageResponse\022@\n\tlanguages\030\001 \003(\0132" - + "-.google.cloud.translation.v3.DetectedLa" - + "nguage\"\221\001\n\034GetSupportedLanguagesRequest\022" - + "9\n\006parent\030\003 \001(\tB)\340A\002\372A#\n!locations.googl" - + "eapis.com/Location\022\"\n\025display_language_c" - + "ode\030\001 \001(\tB\003\340A\001\022\022\n\005model\030\002 \001(\tB\003\340A\001\"W\n\022Su" - + "pportedLanguages\022A\n\tlanguages\030\001 \003(\0132..go" - + "ogle.cloud.translation.v3.SupportedLangu" - + "age\"p\n\021SupportedLanguage\022\025\n\rlanguage_cod" - + "e\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022\026\n\016support" - + "_source\030\003 \001(\010\022\026\n\016support_target\030\004 \001(\010\"\036\n" - + "\tGcsSource\022\021\n\tinput_uri\030\001 \001(\t\"m\n\013InputCo" - + "nfig\022\026\n\tmime_type\030\001 \001(\tB\003\340A\001\022<\n\ngcs_sour" - + "ce\030\002 \001(\0132&.google.cloud.translation.v3.G" - + "csSourceH\000B\010\n\006source\"+\n\016GcsDestination\022\031" - + "\n\021output_uri_prefix\030\001 \001(\t\"e\n\014OutputConfi" - + "g\022F\n\017gcs_destination\030\001 \001(\0132+.google.clou" - + "d.translation.v3.GcsDestinationH\000B\r\n\013des" - + "tination\"\210\006\n\031BatchTranslateTextRequest\0229" - + "\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations.google" - + "apis.com/Location\022!\n\024source_language_cod" - + "e\030\002 \001(\tB\003\340A\002\022\"\n\025target_language_codes\030\003 " - + "\003(\tB\003\340A\002\022W\n\006models\030\004 \003(\0132B.google.cloud." - + "translation.v3.BatchTranslateTextRequest" - + ".ModelsEntryB\003\340A\001\022D\n\rinput_configs\030\005 \003(\013" - + "2(.google.cloud.translation.v3.InputConf" - + "igB\003\340A\002\022E\n\routput_config\030\006 \001(\0132).google." - + "cloud.translation.v3.OutputConfigB\003\340A\002\022_" - + "\n\nglossaries\030\007 \003(\0132F.google.cloud.transl" - + "ation.v3.BatchTranslateTextRequest.Gloss" - + "ariesEntryB\003\340A\001\022W\n\006labels\030\t \003(\0132B.google" - + ".cloud.translation.v3.BatchTranslateText" - + "Request.LabelsEntryB\003\340A\001\032-\n\013ModelsEntry\022" - + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032k\n\017Gloss" - + "ariesEntry\022\013\n\003key\030\001 \001(\t\022G\n\005value\030\002 \001(\01328" - + ".google.cloud.translation.v3.TranslateTe" - + "xtGlossaryConfig:\0028\001\032-\n\013LabelsEntry\022\013\n\003k" - + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\316\002\n\026BatchTra" - + "nslateMetadata\022H\n\005state\030\001 \001(\01629.google.c" - + "loud.translation.v3.BatchTranslateMetada" - + "ta.State\022\035\n\025translated_characters\030\002 \001(\003\022" - + "\031\n\021failed_characters\030\003 \001(\003\022\030\n\020total_char" - + "acters\030\004 \001(\003\022/\n\013submit_time\030\005 \001(\0132\032.goog" - + "le.protobuf.Timestamp\"e\n\005State\022\025\n\021STATE_" - + "UNSPECIFIED\020\000\022\013\n\007RUNNING\020\001\022\r\n\tSUCCEEDED\020" - + "\002\022\n\n\006FAILED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCANCELL" - + "ED\020\005\"\313\001\n\026BatchTranslateResponse\022\030\n\020total" - + "_characters\030\001 \001(\003\022\035\n\025translated_characte" - + "rs\030\002 \001(\003\022\031\n\021failed_characters\030\003 \001(\003\022/\n\013s" - + "ubmit_time\030\004 \001(\0132\032.google.protobuf.Times" - + "tamp\022,\n\010end_time\030\005 \001(\0132\032.google.protobuf" - + ".Timestamp\"]\n\023GlossaryInputConfig\022<\n\ngcs" - + "_source\030\001 \001(\0132&.google.cloud.translation" - + ".v3.GcsSourceH\000B\010\n\006source\"\372\004\n\010Glossary\022\014" - + "\n\004name\030\001 \001(\t\022O\n\rlanguage_pair\030\003 \001(\01326.go" - + "ogle.cloud.translation.v3.Glossary.Langu" - + "ageCodePairH\000\022T\n\022language_codes_set\030\004 \001(" - + "\01326.google.cloud.translation.v3.Glossary" - + ".LanguageCodesSetH\000\022F\n\014input_config\030\005 \001(" - + "\01320.google.cloud.translation.v3.Glossary" - + "InputConfig\022\030\n\013entry_count\030\006 \001(\005B\003\340A\003\0224\n" - + "\013submit_time\030\007 \001(\0132\032.google.protobuf.Tim" - + "estampB\003\340A\003\0221\n\010end_time\030\010 \001(\0132\032.google.p" - + "rotobuf.TimestampB\003\340A\003\032N\n\020LanguageCodePa" - + "ir\022\034\n\024source_language_code\030\001 \001(\t\022\034\n\024targ" - + "et_language_code\030\002 \001(\t\032*\n\020LanguageCodesS" - + "et\022\026\n\016language_codes\030\001 \003(\t:e\352Ab\n!transla" - + "te.googleapis.com/Glossary\022=projects/{pr" - + "oject}/locations/{location}/glossaries/{" - + "glossary}B\013\n\tlanguages\"\220\001\n\025CreateGlossar" - + "yRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locati" - + "ons.googleapis.com/Location\022<\n\010glossary\030" - + "\002 \001(\0132%.google.cloud.translation.v3.Glos" - + "saryB\003\340A\002\"M\n\022GetGlossaryRequest\0227\n\004name\030" - + "\001 \001(\tB)\340A\002\372A#\n!translate.googleapis.com/" - + "Glossary\"P\n\025DeleteGlossaryRequest\0227\n\004nam" - + "e\030\001 \001(\tB)\340A\002\372A#\n!translate.googleapis.co" - + "m/Glossary\"\230\001\n\025ListGlossariesRequest\0229\n\006" - + "parent\030\001 \001(\tB)\340A\002\372A#\n!locations.googleap" - + "is.com/Location\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022" - + "\027\n\npage_token\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001(\t" - + "B\003\340A\001\"l\n\026ListGlossariesResponse\0229\n\ngloss" - + "aries\030\001 \003(\0132%.google.cloud.translation.v" - + "3.Glossary\022\027\n\017next_page_token\030\002 \001(\t\"\210\002\n\026" - + "CreateGlossaryMetadata\022\014\n\004name\030\001 \001(\t\022H\n\005" - + "state\030\002 \001(\01629.google.cloud.translation.v" - + "3.CreateGlossaryMetadata.State\022/\n\013submit" - + "_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"" - + "e\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007RUNNI" - + "NG\020\001\022\r\n\tSUCCEEDED\020\002\022\n\n\006FAILED\020\003\022\016\n\nCANCE" - + "LLING\020\004\022\r\n\tCANCELLED\020\005\"\210\002\n\026DeleteGlossar" - + "yMetadata\022\014\n\004name\030\001 \001(\t\022H\n\005state\030\002 \001(\01629" - + ".google.cloud.translation.v3.DeleteGloss" - + "aryMetadata.State\022/\n\013submit_time\030\003 \001(\0132\032" - + ".google.protobuf.Timestamp\"e\n\005State\022\025\n\021S" - + "TATE_UNSPECIFIED\020\000\022\013\n\007RUNNING\020\001\022\r\n\tSUCCE" - + "EDED\020\002\022\n\n\006FAILED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCA" - + "NCELLED\020\005\"\205\001\n\026DeleteGlossaryResponse\022\014\n\004" - + "name\030\001 \001(\t\022/\n\013submit_time\030\002 \001(\0132\032.google" - + ".protobuf.Timestamp\022,\n\010end_time\030\003 \001(\0132\032." - + "google.protobuf.Timestamp2\216\020\n\022Translatio" - + "nService\022\324\002\n\rTranslateText\0221.google.clou" - + "d.translation.v3.TranslateTextRequest\0322." + + "\001\"\240\001\n\025TranslateTextResponse\022>\n\014translati" + + "ons\030\001 \003(\0132(.google.cloud.translation.v3." + + "Translation\022G\n\025glossary_translations\030\003 \003" + + "(\0132(.google.cloud.translation.v3.Transla" + + "tion\"\250\001\n\013Translation\022\027\n\017translated_text\030" + + "\001 \001(\t\022\r\n\005model\030\002 \001(\t\022\036\n\026detected_languag" + + "e_code\030\004 \001(\t\022Q\n\017glossary_config\030\003 \001(\01328." + "google.cloud.translation.v3.TranslateTex" - + "tResponse\"\333\001\202\323\344\223\002b\"1/v3/{parent=projects" - + "/*/locations/*}:translateText:\001*Z*\"%/v3/" - + "{parent=projects/*}:translateText:\001*\332A$p" - + "arent,target_language_code,contents\332AIpa" - + "rent,model,mime_type,source_language_cod" - + "e,target_language_code,contents\022\207\002\n\016Dete" - + "ctLanguage\0222.google.cloud.translation.v3" - + ".DetectLanguageRequest\0323.google.cloud.tr" - + "anslation.v3.DetectLanguageResponse\"\213\001\202\323" - + "\344\223\002d\"2/v3/{parent=projects/*/locations/*" - + "}:detectLanguage:\001*Z+\"&/v3/{parent=proje" - + "cts/*}:detectLanguage:\001*\332A\036parent,model," - + "mime_type,content\022\227\002\n\025GetSupportedLangua" - + "ges\0229.google.cloud.translation.v3.GetSup" - + "portedLanguagesRequest\032/.google.cloud.tr" - + "anslation.v3.SupportedLanguages\"\221\001\202\323\344\223\002f" - + "\0226/v3/{parent=projects/*/locations/*}/su" - + "pportedLanguagesZ,\022*/v3/{parent=projects" - + "/*}/supportedLanguages\332A\"parent,model,di" - + "splay_language_code\022\341\001\n\022BatchTranslateTe" - + "xt\0226.google.cloud.translation.v3.BatchTr" - + "anslateTextRequest\032\035.google.longrunning." - + "Operation\"t\202\323\344\223\002;\"6/v3/{parent=projects/" - + "*/locations/*}:batchTranslateText:\001*\312A0\n" - + "\026BatchTranslateResponse\022\026BatchTranslateM" - + "etadata\022\334\001\n\016CreateGlossary\0222.google.clou" - + "d.translation.v3.CreateGlossaryRequest\032\035" - + ".google.longrunning.Operation\"w\202\323\344\223\002:\"./" - + "v3/{parent=projects/*/locations/*}/gloss" - + "aries:\010glossary\332A\017parent,glossary\312A\"\n\010Gl" - + "ossary\022\026CreateGlossaryMetadata\022\272\001\n\016ListG" - + "lossaries\0222.google.cloud.translation.v3." - + "ListGlossariesRequest\0323.google.cloud.tra" - + "nslation.v3.ListGlossariesResponse\"?\202\323\344\223" - + "\0020\022./v3/{parent=projects/*/locations/*}/" - + "glossaries\332A\006parent\022\244\001\n\013GetGlossary\022/.go" - + "ogle.cloud.translation.v3.GetGlossaryReq" - + "uest\032%.google.cloud.translation.v3.Gloss" - + "ary\"=\202\323\344\223\0020\022./v3/{name=projects/*/locati" - + "ons/*/glossaries/*}\332A\004name\022\325\001\n\016DeleteGlo" - + "ssary\0222.google.cloud.translation.v3.Dele" - + "teGlossaryRequest\032\035.google.longrunning.O" - + "peration\"p\202\323\344\223\0020*./v3/{name=projects/*/l" - + "ocations/*/glossaries/*}\332A\004name\312A0\n\026Dele" - + "teGlossaryResponse\022\026DeleteGlossaryMetada" - + "ta\032~\312A\030translate.googleapis.com\322A`https:" - + "//www.googleapis.com/auth/cloud-platform" - + ",https://www.googleapis.com/auth/cloud-t" - + "ranslationB\330\001\n\035com.google.cloud.translat" - + "e.v3B\027TranslationServiceProtoP\001ZBgoogle." - + "golang.org/genproto/googleapis/cloud/tra" - + "nslate/v3;translate\370\001\001\252\002\031Google.Cloud.Tr" - + "anslate.V3\312\002\031Google\\Cloud\\Translate\\V3\352\002" - + "\034Google::Cloud::Translate::V3b\006proto3" + + "tGlossaryConfig\"\237\002\n\025DetectLanguageReques" + + "t\0229\n\006parent\030\005 \001(\tB)\340A\002\372A#\n!locations.goo" + + "gleapis.com/Location\022\022\n\005model\030\004 \001(\tB\003\340A\001" + + "\022\021\n\007content\030\001 \001(\tH\000\022\026\n\tmime_type\030\003 \001(\tB\003" + + "\340A\001\022S\n\006labels\030\006 \003(\0132>.google.cloud.trans" + + "lation.v3.DetectLanguageRequest.LabelsEn" + + "tryB\003\340A\001\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + + "value\030\002 \001(\t:\0028\001B\010\n\006source\"=\n\020DetectedLan" + + "guage\022\025\n\rlanguage_code\030\001 \001(\t\022\022\n\nconfiden" + + "ce\030\002 \001(\002\"Z\n\026DetectLanguageResponse\022@\n\tla" + + "nguages\030\001 \003(\0132-.google.cloud.translation" + + ".v3.DetectedLanguage\"\221\001\n\034GetSupportedLan" + + "guagesRequest\0229\n\006parent\030\003 \001(\tB)\340A\002\372A#\n!l" + + "ocations.googleapis.com/Location\022\"\n\025disp" + + "lay_language_code\030\001 \001(\tB\003\340A\001\022\022\n\005model\030\002 " + + "\001(\tB\003\340A\001\"W\n\022SupportedLanguages\022A\n\tlangua" + + "ges\030\001 \003(\0132..google.cloud.translation.v3." + + "SupportedLanguage\"p\n\021SupportedLanguage\022\025" + + "\n\rlanguage_code\030\001 \001(\t\022\024\n\014display_name\030\002 " + + "\001(\t\022\026\n\016support_source\030\003 \001(\010\022\026\n\016support_t" + + "arget\030\004 \001(\010\"#\n\tGcsSource\022\026\n\tinput_uri\030\001 " + + "\001(\tB\003\340A\002\"m\n\013InputConfig\022\026\n\tmime_type\030\001 \001" + + "(\tB\003\340A\001\022<\n\ngcs_source\030\002 \001(\0132&.google.clo" + + "ud.translation.v3.GcsSourceH\000B\010\n\006source\"" + + "0\n\016GcsDestination\022\036\n\021output_uri_prefix\030\001" + + " \001(\tB\003\340A\002\"e\n\014OutputConfig\022F\n\017gcs_destina" + + "tion\030\001 \001(\0132+.google.cloud.translation.v3" + + ".GcsDestinationH\000B\r\n\013destination\"\203\001\n\023Doc" + + "umentInputConfig\022\021\n\007content\030\001 \001(\014H\000\022<\n\ng" + + "cs_source\030\002 \001(\0132&.google.cloud.translati" + + "on.v3.GcsSourceH\000\022\021\n\tmime_type\030\004 \001(\tB\010\n\006" + + "source\"\212\001\n\024DocumentOutputConfig\022K\n\017gcs_d" + + "estination\030\001 \001(\0132+.google.cloud.translat" + + "ion.v3.GcsDestinationB\003\340A\001H\000\022\026\n\tmime_typ" + + "e\030\003 \001(\tB\003\340A\001B\r\n\013destination\"\226\004\n\030Translat" + + "eDocumentRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022!\n" + + "\024source_language_code\030\002 \001(\tB\003\340A\001\022!\n\024targ" + + "et_language_code\030\003 \001(\tB\003\340A\002\022T\n\025document_" + + "input_config\030\004 \001(\01320.google.cloud.transl" + + "ation.v3.DocumentInputConfigB\003\340A\002\022V\n\026doc" + + "ument_output_config\030\005 \001(\01321.google.cloud" + + ".translation.v3.DocumentOutputConfigB\003\340A" + + "\001\022\022\n\005model\030\006 \001(\tB\003\340A\001\022V\n\017glossary_config" + + "\030\007 \001(\01328.google.cloud.translation.v3.Tra" + + "nslateTextGlossaryConfigB\003\340A\001\022V\n\006labels\030" + + "\010 \003(\0132A.google.cloud.translation.v3.Tran" + + "slateDocumentRequest.LabelsEntryB\003\340A\001\032-\n" + + "\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" + + ":\0028\001\"e\n\023DocumentTranslation\022\033\n\023byte_stre" + + "am_outputs\030\001 \003(\014\022\021\n\tmime_type\030\002 \001(\t\022\036\n\026d" + + "etected_language_code\030\003 \001(\t\"\246\002\n\031Translat" + + "eDocumentResponse\022N\n\024document_translatio" + + "n\030\001 \001(\01320.google.cloud.translation.v3.Do" + + "cumentTranslation\022W\n\035glossary_document_t" + + "ranslation\030\002 \001(\01320.google.cloud.translat" + + "ion.v3.DocumentTranslation\022\r\n\005model\030\003 \001(" + + "\t\022Q\n\017glossary_config\030\004 \001(\01328.google.clou" + + "d.translation.v3.TranslateTextGlossaryCo" + + "nfig\"\210\006\n\031BatchTranslateTextRequest\0229\n\006pa" + + "rent\030\001 \001(\tB)\340A\002\372A#\n!locations.googleapis" + + ".com/Location\022!\n\024source_language_code\030\002 " + + "\001(\tB\003\340A\002\022\"\n\025target_language_codes\030\003 \003(\tB" + + "\003\340A\002\022W\n\006models\030\004 \003(\0132B.google.cloud.tran" + + "slation.v3.BatchTranslateTextRequest.Mod" + + "elsEntryB\003\340A\001\022D\n\rinput_configs\030\005 \003(\0132(.g" + + "oogle.cloud.translation.v3.InputConfigB\003" + + "\340A\002\022E\n\routput_config\030\006 \001(\0132).google.clou" + + "d.translation.v3.OutputConfigB\003\340A\002\022_\n\ngl" + + "ossaries\030\007 \003(\0132F.google.cloud.translatio" + + "n.v3.BatchTranslateTextRequest.Glossarie" + + "sEntryB\003\340A\001\022W\n\006labels\030\t \003(\0132B.google.clo" + + "ud.translation.v3.BatchTranslateTextRequ" + + "est.LabelsEntryB\003\340A\001\032-\n\013ModelsEntry\022\013\n\003k" + + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032k\n\017Glossarie" + + "sEntry\022\013\n\003key\030\001 \001(\t\022G\n\005value\030\002 \001(\01328.goo" + + "gle.cloud.translation.v3.TranslateTextGl" + + "ossaryConfig:\0028\001\032-\n\013LabelsEntry\022\013\n\003key\030\001" + + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\316\002\n\026BatchTransla" + + "teMetadata\022H\n\005state\030\001 \001(\01629.google.cloud" + + ".translation.v3.BatchTranslateMetadata.S" + + "tate\022\035\n\025translated_characters\030\002 \001(\003\022\031\n\021f" + + "ailed_characters\030\003 \001(\003\022\030\n\020total_characte" + + "rs\030\004 \001(\003\022/\n\013submit_time\030\005 \001(\0132\032.google.p" + + "rotobuf.Timestamp\"e\n\005State\022\025\n\021STATE_UNSP" + + "ECIFIED\020\000\022\013\n\007RUNNING\020\001\022\r\n\tSUCCEEDED\020\002\022\n\n" + + "\006FAILED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCANCELLED\020\005" + + "\"\313\001\n\026BatchTranslateResponse\022\030\n\020total_cha" + + "racters\030\001 \001(\003\022\035\n\025translated_characters\030\002" + + " \001(\003\022\031\n\021failed_characters\030\003 \001(\003\022/\n\013submi" + + "t_time\030\004 \001(\0132\032.google.protobuf.Timestamp" + + "\022,\n\010end_time\030\005 \001(\0132\032.google.protobuf.Tim" + + "estamp\"]\n\023GlossaryInputConfig\022<\n\ngcs_sou" + + "rce\030\001 \001(\0132&.google.cloud.translation.v3." + + "GcsSourceH\000B\010\n\006source\"\377\004\n\010Glossary\022\021\n\004na" + + "me\030\001 \001(\tB\003\340A\002\022O\n\rlanguage_pair\030\003 \001(\01326.g" + + "oogle.cloud.translation.v3.Glossary.Lang" + + "uageCodePairH\000\022T\n\022language_codes_set\030\004 \001" + + "(\01326.google.cloud.translation.v3.Glossar" + + "y.LanguageCodesSetH\000\022F\n\014input_config\030\005 \001" + + "(\01320.google.cloud.translation.v3.Glossar" + + "yInputConfig\022\030\n\013entry_count\030\006 \001(\005B\003\340A\003\0224" + + "\n\013submit_time\030\007 \001(\0132\032.google.protobuf.Ti" + + "mestampB\003\340A\003\0221\n\010end_time\030\010 \001(\0132\032.google." + + "protobuf.TimestampB\003\340A\003\032N\n\020LanguageCodeP" + + "air\022\034\n\024source_language_code\030\001 \001(\t\022\034\n\024tar" + + "get_language_code\030\002 \001(\t\032*\n\020LanguageCodes" + + "Set\022\026\n\016language_codes\030\001 \003(\t:e\352Ab\n!transl" + + "ate.googleapis.com/Glossary\022=projects/{p" + + "roject}/locations/{location}/glossaries/" + + "{glossary}B\013\n\tlanguages\"\220\001\n\025CreateGlossa" + + "ryRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locat" + + "ions.googleapis.com/Location\022<\n\010glossary" + + "\030\002 \001(\0132%.google.cloud.translation.v3.Glo" + + "ssaryB\003\340A\002\"M\n\022GetGlossaryRequest\0227\n\004name" + + "\030\001 \001(\tB)\340A\002\372A#\n!translate.googleapis.com" + + "/Glossary\"P\n\025DeleteGlossaryRequest\0227\n\004na" + + "me\030\001 \001(\tB)\340A\002\372A#\n!translate.googleapis.c" + + "om/Glossary\"\230\001\n\025ListGlossariesRequest\0229\n" + + "\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations.googlea" + + "pis.com/Location\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001" + + "\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001(" + + "\tB\003\340A\001\"l\n\026ListGlossariesResponse\0229\n\nglos" + + "saries\030\001 \003(\0132%.google.cloud.translation." + + "v3.Glossary\022\027\n\017next_page_token\030\002 \001(\t\"\210\002\n" + + "\026CreateGlossaryMetadata\022\014\n\004name\030\001 \001(\t\022H\n" + + "\005state\030\002 \001(\01629.google.cloud.translation." + + "v3.CreateGlossaryMetadata.State\022/\n\013submi" + + "t_time\030\003 \001(\0132\032.google.protobuf.Timestamp" + + "\"e\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007RUNN" + + "ING\020\001\022\r\n\tSUCCEEDED\020\002\022\n\n\006FAILED\020\003\022\016\n\nCANC" + + "ELLING\020\004\022\r\n\tCANCELLED\020\005\"\210\002\n\026DeleteGlossa" + + "ryMetadata\022\014\n\004name\030\001 \001(\t\022H\n\005state\030\002 \001(\0162" + + "9.google.cloud.translation.v3.DeleteGlos" + + "saryMetadata.State\022/\n\013submit_time\030\003 \001(\0132" + + "\032.google.protobuf.Timestamp\"e\n\005State\022\025\n\021" + + "STATE_UNSPECIFIED\020\000\022\013\n\007RUNNING\020\001\022\r\n\tSUCC" + + "EEDED\020\002\022\n\n\006FAILED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tC" + + "ANCELLED\020\005\"\205\001\n\026DeleteGlossaryResponse\022\014\n" + + "\004name\030\001 \001(\t\022/\n\013submit_time\030\002 \001(\0132\032.googl" + + "e.protobuf.Timestamp\022,\n\010end_time\030\003 \001(\0132\032" + + ".google.protobuf.Timestamp\"\324\006\n\035BatchTran" + + "slateDocumentRequest\0229\n\006parent\030\001 \001(\tB)\340A" + + "\002\372A#\n!locations.googleapis.com/Location\022" + + "!\n\024source_language_code\030\002 \001(\tB\003\340A\002\022\"\n\025ta" + + "rget_language_codes\030\003 \003(\tB\003\340A\002\022Q\n\rinput_" + + "configs\030\004 \003(\01325.google.cloud.translation" + + ".v3.BatchDocumentInputConfigB\003\340A\002\022R\n\rout" + + "put_config\030\005 \001(\01326.google.cloud.translat" + + "ion.v3.BatchDocumentOutputConfigB\003\340A\002\022[\n" + + "\006models\030\006 \003(\0132F.google.cloud.translation" + + ".v3.BatchTranslateDocumentRequest.Models" + + "EntryB\003\340A\001\022c\n\nglossaries\030\007 \003(\0132J.google." + + "cloud.translation.v3.BatchTranslateDocum" + + "entRequest.GlossariesEntryB\003\340A\001\022r\n\022forma" + + "t_conversions\030\010 \003(\0132Q.google.cloud.trans" + + "lation.v3.BatchTranslateDocumentRequest." + + "FormatConversionsEntryB\003\340A\001\032-\n\013ModelsEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032k\n\017Gl" + + "ossariesEntry\022\013\n\003key\030\001 \001(\t\022G\n\005value\030\002 \001(" + + "\01328.google.cloud.translation.v3.Translat" + + "eTextGlossaryConfig:\0028\001\0328\n\026FormatConvers" + + "ionsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" + + "\001\"b\n\030BatchDocumentInputConfig\022<\n\ngcs_sou" + + "rce\030\001 \001(\0132&.google.cloud.translation.v3." + + "GcsSourceH\000B\010\n\006source\"r\n\031BatchDocumentOu" + + "tputConfig\022F\n\017gcs_destination\030\001 \001(\0132+.go" + + "ogle.cloud.translation.v3.GcsDestination" + + "H\000B\r\n\013destination\"\331\002\n\036BatchTranslateDocu" + + "mentResponse\022\023\n\013total_pages\030\001 \001(\003\022\030\n\020tra" + + "nslated_pages\030\002 \001(\003\022\024\n\014failed_pages\030\003 \001(" + + "\003\022\034\n\024total_billable_pages\030\004 \001(\003\022\030\n\020total" + + "_characters\030\005 \001(\003\022\035\n\025translated_characte" + + "rs\030\006 \001(\003\022\031\n\021failed_characters\030\007 \001(\003\022!\n\031t" + + "otal_billable_characters\030\010 \001(\003\022/\n\013submit" + + "_time\030\t \001(\0132\032.google.protobuf.Timestamp\022" + + ",\n\010end_time\030\n \001(\0132\032.google.protobuf.Time" + + "stamp\"\344\003\n\036BatchTranslateDocumentMetadata" + + "\022P\n\005state\030\001 \001(\0162A.google.cloud.translati" + + "on.v3.BatchTranslateDocumentMetadata.Sta" + + "te\022\023\n\013total_pages\030\002 \001(\003\022\030\n\020translated_pa" + + "ges\030\003 \001(\003\022\024\n\014failed_pages\030\004 \001(\003\022\034\n\024total" + + "_billable_pages\030\005 \001(\003\022\030\n\020total_character" + + "s\030\006 \001(\003\022\035\n\025translated_characters\030\007 \001(\003\022\031" + + "\n\021failed_characters\030\010 \001(\003\022!\n\031total_billa" + + "ble_characters\030\t \001(\003\022/\n\013submit_time\030\n \001(" + + "\0132\032.google.protobuf.Timestamp\"e\n\005State\022\025" + + "\n\021STATE_UNSPECIFIED\020\000\022\013\n\007RUNNING\020\001\022\r\n\tSU" + + "CCEEDED\020\002\022\n\n\006FAILED\020\003\022\016\n\nCANCELLING\020\004\022\r\n" + + "\tCANCELLED\020\0052\326\023\n\022TranslationService\022\324\002\n\r" + + "TranslateText\0221.google.cloud.translation" + + ".v3.TranslateTextRequest\0322.google.cloud." + + "translation.v3.TranslateTextResponse\"\333\001\202" + + "\323\344\223\002b\"1/v3/{parent=projects/*/locations/" + + "*}:translateText:\001*Z*\"%/v3/{parent=proje" + + "cts/*}:translateText:\001*\332A$parent,target_" + + "language_code,contents\332AIparent,model,mi" + + "me_type,source_language_code,target_lang" + + "uage_code,contents\022\207\002\n\016DetectLanguage\0222." + + "google.cloud.translation.v3.DetectLangua" + + "geRequest\0323.google.cloud.translation.v3." + + "DetectLanguageResponse\"\213\001\202\323\344\223\002d\"2/v3/{pa" + + "rent=projects/*/locations/*}:detectLangu" + + "age:\001*Z+\"&/v3/{parent=projects/*}:detect" + + "Language:\001*\332A\036parent,model,mime_type,con" + + "tent\022\227\002\n\025GetSupportedLanguages\0229.google." + + "cloud.translation.v3.GetSupportedLanguag" + + "esRequest\032/.google.cloud.translation.v3." + + "SupportedLanguages\"\221\001\202\323\344\223\002f\0226/v3/{parent" + + "=projects/*/locations/*}/supportedLangua" + + "gesZ,\022*/v3/{parent=projects/*}/supported" + + "Languages\332A\"parent,model,display_languag" + + "e_code\022\304\001\n\021TranslateDocument\0225.google.cl" + + "oud.translation.v3.TranslateDocumentRequ" + + "est\0326.google.cloud.translation.v3.Transl" + + "ateDocumentResponse\"@\202\323\344\223\002:\"5/v3/{parent" + + "=projects/*/locations/*}:translateDocume" + + "nt:\001*\022\341\001\n\022BatchTranslateText\0226.google.cl" + + "oud.translation.v3.BatchTranslateTextReq" + + "uest\032\035.google.longrunning.Operation\"t\202\323\344" + + "\223\002;\"6/v3/{parent=projects/*/locations/*}" + + ":batchTranslateText:\001*\312A0\n\026BatchTranslat" + + "eResponse\022\026BatchTranslateMetadata\022\376\001\n\026Ba" + + "tchTranslateDocument\022:.google.cloud.tran" + + "slation.v3.BatchTranslateDocumentRequest" + + "\032\035.google.longrunning.Operation\"\210\001\202\323\344\223\002?" + + "\":/v3/{parent=projects/*/locations/*}:ba" + + "tchTranslateDocument:\001*\312A@\n\036BatchTransla" + + "teDocumentResponse\022\036BatchTranslateDocume" + + "ntMetadata\022\334\001\n\016CreateGlossary\0222.google.c" + + "loud.translation.v3.CreateGlossaryReques" + + "t\032\035.google.longrunning.Operation\"w\202\323\344\223\002:" + + "\"./v3/{parent=projects/*/locations/*}/gl" + + "ossaries:\010glossary\332A\017parent,glossary\312A\"\n" + + "\010Glossary\022\026CreateGlossaryMetadata\022\272\001\n\016Li" + + "stGlossaries\0222.google.cloud.translation." + + "v3.ListGlossariesRequest\0323.google.cloud." + + "translation.v3.ListGlossariesResponse\"?\202" + + "\323\344\223\0020\022./v3/{parent=projects/*/locations/" + + "*}/glossaries\332A\006parent\022\244\001\n\013GetGlossary\022/" + + ".google.cloud.translation.v3.GetGlossary" + + "Request\032%.google.cloud.translation.v3.Gl" + + "ossary\"=\202\323\344\223\0020\022./v3/{name=projects/*/loc" + + "ations/*/glossaries/*}\332A\004name\022\325\001\n\016Delete" + + "Glossary\0222.google.cloud.translation.v3.D" + + "eleteGlossaryRequest\032\035.google.longrunnin" + + "g.Operation\"p\202\323\344\223\0020*./v3/{name=projects/" + + "*/locations/*/glossaries/*}\332A\004name\312A0\n\026D" + + "eleteGlossaryResponse\022\026DeleteGlossaryMet" + + "adata\032~\312A\030translate.googleapis.com\322A`htt" + + "ps://www.googleapis.com/auth/cloud-platf" + + "orm,https://www.googleapis.com/auth/clou" + + "d-translationB\330\001\n\035com.google.cloud.trans" + + "late.v3B\027TranslationServiceProtoP\001ZBgoog" + + "le.golang.org/genproto/googleapis/cloud/" + + "translate/v3;translate\370\001\001\252\002\031Google.Cloud" + + ".Translate.V3\312\002\031Google\\Cloud\\Translate\\V" + + "3\352\002\034Google::Cloud::Translate::V3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -377,7 +524,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), }); internal_static_google_cloud_translation_v3_TranslateTextGlossaryConfig_descriptor = getDescriptor().getMessageTypes().get(0); @@ -518,8 +667,65 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "GcsDestination", "Destination", }); - internal_static_google_cloud_translation_v3_BatchTranslateTextRequest_descriptor = + internal_static_google_cloud_translation_v3_DocumentInputConfig_descriptor = getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_translation_v3_DocumentInputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_DocumentInputConfig_descriptor, + new java.lang.String[] { + "Content", "GcsSource", "MimeType", "Source", + }); + internal_static_google_cloud_translation_v3_DocumentOutputConfig_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_translation_v3_DocumentOutputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_DocumentOutputConfig_descriptor, + new java.lang.String[] { + "GcsDestination", "MimeType", "Destination", + }); + internal_static_google_cloud_translation_v3_TranslateDocumentRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_translation_v3_TranslateDocumentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_TranslateDocumentRequest_descriptor, + new java.lang.String[] { + "Parent", + "SourceLanguageCode", + "TargetLanguageCode", + "DocumentInputConfig", + "DocumentOutputConfig", + "Model", + "GlossaryConfig", + "Labels", + }); + internal_static_google_cloud_translation_v3_TranslateDocumentRequest_LabelsEntry_descriptor = + internal_static_google_cloud_translation_v3_TranslateDocumentRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_translation_v3_TranslateDocumentRequest_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_TranslateDocumentRequest_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_translation_v3_DocumentTranslation_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_translation_v3_DocumentTranslation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_DocumentTranslation_descriptor, + new java.lang.String[] { + "ByteStreamOutputs", "MimeType", "DetectedLanguageCode", + }); + internal_static_google_cloud_translation_v3_TranslateDocumentResponse_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_translation_v3_TranslateDocumentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_TranslateDocumentResponse_descriptor, + new java.lang.String[] { + "DocumentTranslation", "GlossaryDocumentTranslation", "Model", "GlossaryConfig", + }); + internal_static_google_cloud_translation_v3_BatchTranslateTextRequest_descriptor = + getDescriptor().getMessageTypes().get(19); internal_static_google_cloud_translation_v3_BatchTranslateTextRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3_BatchTranslateTextRequest_descriptor, @@ -564,7 +770,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_translation_v3_BatchTranslateMetadata_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(20); internal_static_google_cloud_translation_v3_BatchTranslateMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3_BatchTranslateMetadata_descriptor, @@ -572,7 +778,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "State", "TranslatedCharacters", "FailedCharacters", "TotalCharacters", "SubmitTime", }); internal_static_google_cloud_translation_v3_BatchTranslateResponse_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(21); internal_static_google_cloud_translation_v3_BatchTranslateResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3_BatchTranslateResponse_descriptor, @@ -584,7 +790,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EndTime", }); internal_static_google_cloud_translation_v3_GlossaryInputConfig_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(22); internal_static_google_cloud_translation_v3_GlossaryInputConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3_GlossaryInputConfig_descriptor, @@ -592,7 +798,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "GcsSource", "Source", }); internal_static_google_cloud_translation_v3_Glossary_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(23); internal_static_google_cloud_translation_v3_Glossary_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3_Glossary_descriptor, @@ -623,7 +829,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "LanguageCodes", }); internal_static_google_cloud_translation_v3_CreateGlossaryRequest_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(24); internal_static_google_cloud_translation_v3_CreateGlossaryRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3_CreateGlossaryRequest_descriptor, @@ -631,7 +837,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Glossary", }); internal_static_google_cloud_translation_v3_GetGlossaryRequest_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(25); internal_static_google_cloud_translation_v3_GetGlossaryRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3_GetGlossaryRequest_descriptor, @@ -639,7 +845,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_translation_v3_DeleteGlossaryRequest_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(26); internal_static_google_cloud_translation_v3_DeleteGlossaryRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3_DeleteGlossaryRequest_descriptor, @@ -647,7 +853,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_translation_v3_ListGlossariesRequest_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(27); internal_static_google_cloud_translation_v3_ListGlossariesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3_ListGlossariesRequest_descriptor, @@ -655,7 +861,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", "Filter", }); internal_static_google_cloud_translation_v3_ListGlossariesResponse_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(28); internal_static_google_cloud_translation_v3_ListGlossariesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3_ListGlossariesResponse_descriptor, @@ -663,7 +869,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Glossaries", "NextPageToken", }); internal_static_google_cloud_translation_v3_CreateGlossaryMetadata_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(29); internal_static_google_cloud_translation_v3_CreateGlossaryMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3_CreateGlossaryMetadata_descriptor, @@ -671,7 +877,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "State", "SubmitTime", }); internal_static_google_cloud_translation_v3_DeleteGlossaryMetadata_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(30); internal_static_google_cloud_translation_v3_DeleteGlossaryMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3_DeleteGlossaryMetadata_descriptor, @@ -679,13 +885,108 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "State", "SubmitTime", }); internal_static_google_cloud_translation_v3_DeleteGlossaryResponse_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(31); internal_static_google_cloud_translation_v3_DeleteGlossaryResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3_DeleteGlossaryResponse_descriptor, new java.lang.String[] { "Name", "SubmitTime", "EndTime", }); + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_descriptor, + new java.lang.String[] { + "Parent", + "SourceLanguageCode", + "TargetLanguageCodes", + "InputConfigs", + "OutputConfig", + "Models", + "Glossaries", + "FormatConversions", + }); + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_ModelsEntry_descriptor = + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_ModelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_ModelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_GlossariesEntry_descriptor = + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_GlossariesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_GlossariesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_FormatConversionsEntry_descriptor = + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_FormatConversionsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_BatchTranslateDocumentRequest_FormatConversionsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_translation_v3_BatchDocumentInputConfig_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_google_cloud_translation_v3_BatchDocumentInputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_BatchDocumentInputConfig_descriptor, + new java.lang.String[] { + "GcsSource", "Source", + }); + internal_static_google_cloud_translation_v3_BatchDocumentOutputConfig_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_google_cloud_translation_v3_BatchDocumentOutputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_BatchDocumentOutputConfig_descriptor, + new java.lang.String[] { + "GcsDestination", "Destination", + }); + internal_static_google_cloud_translation_v3_BatchTranslateDocumentResponse_descriptor = + getDescriptor().getMessageTypes().get(35); + internal_static_google_cloud_translation_v3_BatchTranslateDocumentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_BatchTranslateDocumentResponse_descriptor, + new java.lang.String[] { + "TotalPages", + "TranslatedPages", + "FailedPages", + "TotalBillablePages", + "TotalCharacters", + "TranslatedCharacters", + "FailedCharacters", + "TotalBillableCharacters", + "SubmitTime", + "EndTime", + }); + internal_static_google_cloud_translation_v3_BatchTranslateDocumentMetadata_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_google_cloud_translation_v3_BatchTranslateDocumentMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3_BatchTranslateDocumentMetadata_descriptor, + new java.lang.String[] { + "State", + "TotalPages", + "TranslatedPages", + "FailedPages", + "TotalBillablePages", + "TotalCharacters", + "TranslatedCharacters", + "FailedCharacters", + "TotalBillableCharacters", + "SubmitTime", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); @@ -703,7 +1004,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-translate-v3/src/main/proto/google/cloud/location/locations.proto b/proto-google-cloud-translate-v3/src/main/proto/google/cloud/location/locations.proto new file mode 100644 index 00000000..a91766c9 --- /dev/null +++ b/proto-google-cloud-translate-v3/src/main/proto/google/cloud/location/locations.proto @@ -0,0 +1,108 @@ +// Copyright 2020 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.location; + +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "google/api/client.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/location;location"; +option java_multiple_files = true; +option java_outer_classname = "LocationsProto"; +option java_package = "com.google.cloud.location"; + +// An abstract interface that provides location-related information for +// a service. Service-specific metadata is provided through the +// [Location.metadata][google.cloud.location.Location.metadata] field. +service Locations { + option (google.api.default_host) = "cloud.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists information about the supported locations for this service. + rpc ListLocations(ListLocationsRequest) returns (ListLocationsResponse) { + option (google.api.http) = { + get: "/v1/{name=locations}" + additional_bindings { + get: "/v1/{name=projects/*}/locations" + } + }; + } + + // Gets information about a location. + rpc GetLocation(GetLocationRequest) returns (Location) { + option (google.api.http) = { + get: "/v1/{name=locations/*}" + additional_bindings { + get: "/v1/{name=projects/*/locations/*}" + } + }; + } +} + +// The request message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations]. +message ListLocationsRequest { + // The resource that owns the locations collection, if applicable. + string name = 1; + + // The standard list filter. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + string page_token = 4; +} + +// The response message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations]. +message ListLocationsResponse { + // A list of locations that matches the specified filter in the request. + repeated Location locations = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// The request message for [Locations.GetLocation][google.cloud.location.Locations.GetLocation]. +message GetLocationRequest { + // Resource name for the location. + string name = 1; +} + +// A resource that represents Google Cloud Platform location. +message Location { + // Resource name for the location, which may vary between implementations. + // For example: `"projects/example-project/locations/us-east1"` + string name = 1; + + // The canonical id for this location. For example: `"us-east1"`. + string location_id = 4; + + // The friendly name for this location, typically a nearby city name. + // For example, "Tokyo". + string display_name = 5; + + // Cross-service attributes for the location. For example + // + // {"cloud.googleapis.com/region": "us-east1"} + map labels = 2; + + // Service-specific metadata. For example the available capacity at the given + // location. + google.protobuf.Any metadata = 3; +} diff --git a/proto-google-cloud-translate-v3/src/main/proto/google/cloud/translate/v3/translation_service.proto b/proto-google-cloud-translate-v3/src/main/proto/google/cloud/translate/v3/translation_service.proto index 3e939a5d..070786ce 100644 --- a/proto-google-cloud-translate-v3/src/main/proto/google/cloud/translate/v3/translation_service.proto +++ b/proto-google-cloud-translate-v3/src/main/proto/google/cloud/translate/v3/translation_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // 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. -// syntax = "proto3"; @@ -22,7 +21,9 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Translate.V3"; @@ -81,6 +82,15 @@ service TranslationService { option (google.api.method_signature) = "parent,model,display_language_code"; } + // Translates documents in synchronous mode. + rpc TranslateDocument(TranslateDocumentRequest) + returns (TranslateDocumentResponse) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*}:translateDocument" + body: "*" + }; + } + // Translates a large volume of text in asynchronous batch mode. // This function provides real-time output as the inputs are being processed. // If caller cancels a request, the partial results (for an input file, it's @@ -100,6 +110,25 @@ service TranslationService { }; } + // Translates a large volume of document in asynchronous batch mode. + // This function provides real-time output as the inputs are being processed. + // If caller cancels a request, the partial results (for an input file, it's + // all or nothing) may still be available on the specified output location. + // + // This call returns immediately and you can use + // google.longrunning.Operation.name to poll the status of the call. + rpc BatchTranslateDocument(BatchTranslateDocumentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*}:batchTranslateDocument" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "BatchTranslateDocumentResponse" + metadata_type: "BatchTranslateDocumentMetadata" + }; + } + // Creates a glossary and returns the long-running operation. Returns // NOT_FOUND, if the project doesn't exist. rpc CreateGlossary(CreateGlossaryRequest) @@ -152,8 +181,12 @@ service TranslationService { // Configures which glossary should be used for a specific target language, // and defines options for applying that glossary. message TranslateTextGlossaryConfig { - // Required. Specifies the glossary used for this translation. Use - // this format: projects/*/locations/*/glossaries/* + // Required. The `glossary` to be applied for this translation. + // + // The format depends on glossary: + // + // - User provided custom glossary: + // `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}` string glossary = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Indicates match is case-insensitive. @@ -164,7 +197,8 @@ message TranslateTextGlossaryConfig { // The request message for synchronous translation. message TranslateTextRequest { // Required. The content of the input in string format. - // We recommend the total content be less than 30k codepoints. + // We recommend the total content be less than 30k codepoints. The max length + // of this field is 1024. // Use BatchTranslateText for larger text. repeated string contents = 1 [(google.api.field_behavior) = REQUIRED]; @@ -213,14 +247,13 @@ message TranslateTextRequest { // // - General (built-in) models: // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // For global (non-regionalized) requests, use `location-id` `global`. // For example, // `projects/{project-number-or-id}/locations/global/models/general/nmt`. // - // If missing, the system decides which google base model to use. + // If not provided, the default Google model (NMT) will be used. string model = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. Glossary to be applied. The glossary must be @@ -236,7 +269,8 @@ message TranslateTextRequest { // characters, underscores and dashes. International characters are allowed. // Label values are optional. Label keys must start with a letter. // - // See https://cloud.google.com/translate/docs/labels for more information. + // See https://cloud.google.com/translate/docs/advanced/labels for more + // information. map labels = 10 [(google.api.field_behavior) = OPTIONAL]; } @@ -257,6 +291,8 @@ message TranslateTextResponse { // A single translation response. message Translation { // Text translated into the target language. + // If an error occurs during translation, this field might be excluded from + // the response. string translated_text = 1; // Only present when `model` is present in the request. @@ -327,7 +363,8 @@ message DetectLanguageRequest { // characters, underscores and dashes. International characters are allowed. // Label values are optional. Label keys must start with a letter. // - // See https://cloud.google.com/translate/docs/labels for more information. + // See https://cloud.google.com/translate/docs/advanced/labels for more + // information. map labels = 6 [(google.api.field_behavior) = OPTIONAL]; } @@ -343,8 +380,8 @@ message DetectedLanguage { // The response message for language detection. message DetectLanguageResponse { - // A list of detected languages sorted by detection confidence in descending - // order. The most probable language first. + // The most probable language detected by the Translation API. For each + // request, the Translation API will always return only one result. repeated DetectedLanguage languages = 1; } @@ -384,11 +421,10 @@ message GetSupportedLanguagesRequest { // // - General (built-in) models: // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // Returns languages supported by the specified model. - // If missing, we get supported languages of Google general base (PBMT) model. + // If missing, we get supported languages of Google general NMT model. string model = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -422,7 +458,7 @@ message SupportedLanguage { // The Google Cloud Storage location for the input content. message GcsSource { // Required. Source data URI. For example, `gs://my_bucket/my_object`. - string input_uri = 1; + string input_uri = 1 [(google.api.field_behavior) = REQUIRED]; } // Input configuration for BatchTranslateText request. @@ -459,10 +495,12 @@ message InputConfig { // The Google Cloud Storage location for the output content. message GcsDestination { - // Required. There must be no files under 'output_uri_prefix'. - // 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an - // INVALID_ARGUMENT (400) error is returned. - string output_uri_prefix = 1; + // Required. The bucket used in 'output_uri_prefix' must exist and there must + // be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with + // "/" and start with "gs://". One 'output_uri_prefix' can only be used by one + // batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error + // is returned. + string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; } // Output configuration for BatchTranslateText request. @@ -501,8 +539,13 @@ message OutputConfig { // processed and ready to be consumed (that is, no partial output file is // written). // + // Since index.csv will be keeping updated during the process, please make + // sure there is no custom retention policy applied on the output bucket + // that may avoid file updating. + // (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) + // // The format of translations_file (for target language code 'trg') is: - // `gs://translation_test/a_b_c_'trg'_translations.[extension]` + // gs://translation_test/a_b_c_'trg'_translations.[extension] // // If the input file extension is tsv, the output has the following // columns: @@ -519,10 +562,10 @@ message OutputConfig { // If input file extension is a txt or html, the translation is directly // written to the output file. If glossary is requested, a separate // glossary_translations_file has format of - // `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + // gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] // // The format of errors file (for target language code 'trg') is: - // `gs://translation_test/a_b_c_'trg'_errors.[extension]` + // gs://translation_test/a_b_c_'trg'_errors.[extension] // // If the input file extension is tsv, errors_file contains the following: // Column 1: ID of the request provided in the input, if it's not @@ -534,11 +577,224 @@ message OutputConfig { // // If the input file extension is txt or html, glossary_error_file will be // generated that contains error details. glossary_error_file has format of - // `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + // gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] GcsDestination gcs_destination = 1; } } +// A document translation request input config. +message DocumentInputConfig { + // Specifies the source for the document's content. + // The input file size should be <= 20MB for + // - application/vnd.openxmlformats-officedocument.wordprocessingml.document + // - application/vnd.openxmlformats-officedocument.presentationml.presentation + // - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + // The input file size should be <= 20MB and the maximum page limit is 20 for + // - application/pdf + oneof source { + // Document's content represented as a stream of bytes. + bytes content = 1; + + // Google Cloud Storage location. This must be a single file. + // For example: gs://example_bucket/example_file.pdf + GcsSource gcs_source = 2; + } + + // Specifies the input document's mime_type. + // + // If not specified it will be determined using the file extension for + // gcs_source provided files. For a file provided through bytes content the + // mime_type must be provided. + // Currently supported mime types are: + // - application/pdf + // - application/vnd.openxmlformats-officedocument.wordprocessingml.document + // - application/vnd.openxmlformats-officedocument.presentationml.presentation + // - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + string mime_type = 4; +} + +// A document translation request output config. +message DocumentOutputConfig { + // A URI destination for the translated document. + // It is optional to provide a destination. If provided the results from + // TranslateDocument will be stored in the destination. + // Whether a destination is provided or not, the translated documents will be + // returned within TranslateDocumentResponse.document_translation and + // TranslateDocumentResponse.glossary_document_translation. + oneof destination { + // Optional. Google Cloud Storage destination for the translation output, + // e.g., `gs://my_bucket/my_directory/`. + // + // The destination directory provided does not have to be empty, but the + // bucket must exist. If a file with the same name as the output file + // already exists in the destination an error will be returned. + // + // For a DocumentInputConfig.contents provided document, the output file + // will have the name "output_[trg]_translations.[ext]", where + // - [trg] corresponds to the translated file's language code, + // - [ext] corresponds to the translated file's extension according to its + // mime type. + // + // + // For a DocumentInputConfig.gcs_uri provided document, the output file will + // have a name according to its URI. For example: an input file with URI: + // "gs://a/b/c.[extension]" stored in a gcs_destination bucket with name + // "my_bucket" will have an output URI: + // "gs://my_bucket/a_b_c_[trg]_translations.[ext]", where + // - [trg] corresponds to the translated file's language code, + // - [ext] corresponds to the translated file's extension according to its + // mime type. + // + // + // If the document was directly provided through the request, then the + // output document will have the format: + // "gs://my_bucket/translated_document_[trg]_translations.[ext], where + // - [trg] corresponds to the translated file's language code, + // - [ext] corresponds to the translated file's extension according to its + // mime type. + // + // If a glossary was provided, then the output URI for the glossary + // translation will be equal to the default output URI but have + // `glossary_translations` instead of `translations`. For the previous + // example, its glossary URI would be: + // "gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]". + // + // Thus the max number of output files will be 2 (Translated document, + // Glossary translated document). + // + // Callers should expect no partial outputs. If there is any error during + // document translation, no output will be stored in the Cloud Storage + // bucket. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Specifies the translated document's mime_type. + // If not specified, the translated file's mime type will be the same as the + // input file's mime type. + // Currently only support the output mime type to be the same as input mime + // type. + // - application/pdf + // - application/vnd.openxmlformats-officedocument.wordprocessingml.document + // - application/vnd.openxmlformats-officedocument.presentationml.presentation + // - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + string mime_type = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A document translation request. +message TranslateDocumentRequest { + // Required. Location to make a regional call. + // + // Format: `projects/{project-number-or-id}/locations/{location-id}`. + // + // For global calls, use `projects/{project-number-or-id}/locations/global` or + // `projects/{project-number-or-id}`. + // + // Non-global location is required for requests using AutoML models or custom + // glossaries. + // + // Models and glossaries must be within the same region (have the same + // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. 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. If the source language isn't specified, the API attempts + // to identify the source language automatically and returns the source + // language within the response. Source language must be specified if the + // request contains a glossary or a custom model. + string source_language_code = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The BCP-47 language code to use for translation of the input + // document, set to one of the language codes listed in Language Support. + string target_language_code = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input configurations. + DocumentInputConfig document_input_config = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Output configurations. + // Defines if the output file should be stored within Cloud Storage as well + // as the desired output format. If not provided the translated file will + // only be returned through a byte-stream and its output mime type will be + // the same as the input file's mime type. + DocumentOutputConfig document_output_config = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The `model` type requested for this translation. + // + // The 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 not provided, the default Google model (NMT) will be used for + // translation. + string model = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Glossary to be applied. The glossary must be within the same + // region (have the same location-id) as the model, otherwise an + // INVALID_ARGUMENT (400) error is returned. + TranslateTextGlossaryConfig glossary_config = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels with user-defined metadata for the request. + // + // Label keys and values can be no longer than 63 characters (Unicode + // codepoints), can only contain lowercase letters, numeric characters, + // underscores and dashes. International characters are allowed. Label values + // are optional. Label keys must start with a letter. + // + // See https://cloud.google.com/translate/docs/advanced/labels for more + // information. + map labels = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// A translated document message. +message DocumentTranslation { + // The array of translated documents. It is expected to be size 1 for now. We + // may produce multiple translated documents in the future for other type of + // file formats. + repeated bytes byte_stream_outputs = 1; + + // The translated document's mime type. + string mime_type = 2; + + // The detected language for the input document. + // If the user did not provide the source language for the input document, + // this field will have the language code automatically detected. If the + // source language was passed, auto-detection of the language does not occur + // and this field is empty. + string detected_language_code = 3; +} + +// A translated document response message. +message TranslateDocumentResponse { + // Translated document. + DocumentTranslation document_translation = 1; + + // The document's translation output if a glossary is provided in the request. + // This can be the same as [TranslateDocumentResponse.document_translation] + // if no glossary terms apply. + DocumentTranslation glossary_document_translation = 2; + + // Only present when 'model' is present in the request. + // 'model' is normalized to have a project number. + // + // For example: + // If the 'model' field in TranslateDocumentRequest is: + // `projects/{project-id}/locations/{location-id}/models/general/nmt` then + // `model` here would be normalized to + // `projects/{project-number}/locations/{location-id}/models/general/nmt`. + string model = 3; + + // The `glossary_config` used for this translation. + TranslateTextGlossaryConfig glossary_config = 4; +} + // The batch translation request. message BatchTranslateTextRequest { // Required. Location to make a call. Must refer to a caller's project. @@ -575,7 +831,6 @@ message BatchTranslateTextRequest { // // - General (built-in) models: // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` // // // If the map is empty or a specific model is @@ -583,7 +838,7 @@ message BatchTranslateTextRequest { map models = 4 [(google.api.field_behavior) = OPTIONAL]; // Required. Input configurations. - // The total number of files matched should be <= 1000. + // The total number of files matched should be <= 100. // The total content size should be <= 100M Unicode codepoints. // The files must use UTF-8 encoding. repeated InputConfig input_configs = 5 @@ -606,7 +861,8 @@ message BatchTranslateTextRequest { // characters, underscores and dashes. International characters are allowed. // Label values are optional. Label keys must start with a letter. // - // See https://cloud.google.com/translate/docs/labels for more information. + // See https://cloud.google.com/translate/docs/advanced/labels for more + // information. map labels = 9 [(google.api.field_behavior) = OPTIONAL]; } @@ -702,9 +958,8 @@ message GlossaryInputConfig { // For equivalent term sets glossaries: // // - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - // in multiple languages. The format is defined for Google Translation - // Toolkit and documented in [Use a - // glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). + // in multiple languages. See documentation for more information - + // [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). GcsSource gcs_source = 1; } } @@ -737,7 +992,7 @@ message Glossary { // Required. The resource name of the glossary. Glossary names have the form // `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. - string name = 1; + string name = 1 [(google.api.field_behavior) = REQUIRED]; // Languages supported by the glossary. oneof languages { @@ -821,7 +1076,20 @@ message ListGlossariesRequest { string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Filter specifying constraints of a list operation. - // Filtering is not supported yet, and the parameter currently has no effect. + // Specify the constraint by the format of "key=value", where key must be + // "src" or "tgt", and the value must be a valid language code. + // For multiple restrictions, concatenate them by "AND" (uppercase only), + // such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + // here, which means using 'en-US' and 'en' can lead to different results, + // which depends on the language code you used when you create the glossary. + // For the unidirectional glossaries, the "src" and "tgt" add restrictions + // on the source and target language code separately. + // For the equivalent term set glossaries, the "src" and/or "tgt" add + // restrictions on the term set. + // For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + // glossaries which exactly match the source language code as "en-US" and the + // target language code "zh-CN", but all equivalent term set glossaries which + // contain "en-US" and "zh-CN" in their language set will be picked. // If missing, no filtering is performed. string filter = 4 [(google.api.field_behavior) = OPTIONAL]; } @@ -924,3 +1192,269 @@ message DeleteGlossaryResponse { // set to true. google.protobuf.Timestamp end_time = 3; } + +// The BatchTranslateDocument request. +message BatchTranslateDocumentRequest { + // 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) = { + type: "locations.googleapis.com/Location" + } + ]; + + // 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]; + + // 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]; + + // 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 BatchDocumentInputConfig input_configs = 4 + [(google.api.field_behavior) = REQUIRED]; + + // 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. + BatchDocumentOutputConfig output_config = 5 + [(google.api.field_behavior) = REQUIRED]; + + // 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 models = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Glossaries to be applied. It's keyed by target language code. + map glossaries = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // 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 format_conversions = 8 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Input configuration for BatchTranslateDocument request. +message BatchDocumentInputConfig { + // Specify the input. + oneof source { + // Google Cloud Storage location for the source input. + // This can be a single file (for example, + // `gs://translation-test/input.docx`) or a wildcard (for example, + // `gs://translation-test/*`). + // + // File mime type is determined based on extension. Supported mime type + // includes: + // - `pdf`, application/pdf + // - `docx`, + // application/vnd.openxmlformats-officedocument.wordprocessingml.document + // - `pptx`, + // application/vnd.openxmlformats-officedocument.presentationml.presentation + // - `xlsx`, + // application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + // + // The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB. + // The max file size to support for `.pdf` is 1GB and the max page limit is + // 1000 pages. + // The max file size to support for all input documents is 1GB. + GcsSource gcs_source = 1; + } +} + +// Output configuration for BatchTranslateDocument request. +message BatchDocumentOutputConfig { + // The destination of output. The destination directory provided must exist + // and be empty. + oneof destination { + // Google Cloud Storage destination for output content. + // For every single input document (for example, gs://a/b/c.[extension]), we + // generate at most 2 * n output files. (n is the # of target_language_codes + // in the BatchTranslateDocumentRequest). + // + // While the input documents are being processed, we write/update an index + // file `index.csv` under `gcs_destination.output_uri_prefix` (for example, + // gs://translation_output/index.csv) The index file is generated/updated as + // new files are being translated. The format is: + // + // input_document,target_language_code,translation_output,error_output, + // glossary_translation_output,glossary_error_output + // + // `input_document` is one file we matched using gcs_source.input_uri. + // `target_language_code` is provided in the request. + // `translation_output` contains the translations. (details provided below) + // `error_output` contains the error message during processing of the file. + // Both translations_file and errors_file could be empty strings if we have + // no content to output. + // `glossary_translation_output` and `glossary_error_output` are the + // translated output/error when we apply glossaries. They could also be + // empty if we have no content to output. + // + // Once a row is present in index.csv, the input/output matching never + // changes. Callers should also expect all the content in input_file are + // processed and ready to be consumed (that is, no partial output file is + // written). + // + // Since index.csv will be keeping updated during the process, please make + // sure there is no custom retention policy applied on the output bucket + // that may avoid file updating. + // (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) + // + // The naming format of translation output files follows (for target + // language code [trg]): `translation_output`: + // gs://translation_output/a_b_c_[trg]_translation.[extension] + // `glossary_translation_output`: + // gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The + // output document will maintain the same file format as the input document. + // + // The naming format of error output files follows (for target language code + // [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt + // `glossary_error_output`: + // gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error + // output is a txt file containing error details. + GcsDestination gcs_destination = 1; + } +} + +// Stored in the +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field returned by BatchTranslateDocument if at least one document is +// translated successfully. +message BatchTranslateDocumentResponse { + // Total number of pages to translate in all documents. Documents without + // clear page definition (such as XLSX) are not counted. + int64 total_pages = 1; + + // Number of successfully translated pages in all documents. Documents without + // clear page definition (such as XLSX) are not counted. + int64 translated_pages = 2; + + // Number of pages that failed to process in all documents. Documents without + // clear page definition (such as XLSX) are not counted. + int64 failed_pages = 3; + + // Number of billable pages in documents with clear page definition (such as + // PDF, DOCX, PPTX) + int64 total_billable_pages = 4; + + // Total number of characters (Unicode codepoints) in all documents. + int64 total_characters = 5; + + // Number of successfully translated characters (Unicode codepoints) in all + // documents. + int64 translated_characters = 6; + + // Number of characters that have failed to process (Unicode codepoints) in + // all documents. + int64 failed_characters = 7; + + // Number of billable characters (Unicode codepoints) in documents without + // clear page definition, such as XLSX. + int64 total_billable_characters = 8; + + // Time when the operation was submitted. + google.protobuf.Timestamp submit_time = 9; + + // The time when the operation is finished and + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is + // set to true. + google.protobuf.Timestamp end_time = 10; +} + +// State metadata for the batch translation operation. +message BatchTranslateDocumentMetadata { + // State of the job. + enum State { + // Invalid. + STATE_UNSPECIFIED = 0; + + // Request is being processed. + RUNNING = 1; + + // The batch is processed, and at least one item was successfully processed. + SUCCEEDED = 2; + + // The batch is done and no item was successfully processed. + FAILED = 3; + + // Request is in the process of being canceled after caller invoked + // longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4; + + // The batch is done after the user has called the + // longrunning.Operations.CancelOperation. Any records processed before the + // cancel command are output as specified in the request. + CANCELLED = 5; + } + + // The state of the operation. + State state = 1; + + // Total number of pages to translate in all documents so far. Documents + // without clear page definition (such as XLSX) are not counted. + int64 total_pages = 2; + + // Number of successfully translated pages in all documents so far. Documents + // without clear page definition (such as XLSX) are not counted. + int64 translated_pages = 3; + + // Number of pages that failed to process in all documents so far. Documents + // without clear page definition (such as XLSX) are not counted. + int64 failed_pages = 4; + + // Number of billable pages in documents with clear page definition (such as + // PDF, DOCX, PPTX) so far. + int64 total_billable_pages = 5; + + // Total number of characters (Unicode codepoints) in all documents so far. + int64 total_characters = 6; + + // Number of successfully translated characters (Unicode codepoints) in all + // documents so far. + int64 translated_characters = 7; + + // Number of characters that have failed to process (Unicode codepoints) in + // all documents so far. + int64 failed_characters = 8; + + // Number of billable characters (Unicode codepoints) in documents without + // clear page definition (such as XLSX) so far. + int64 total_billable_characters = 9; + + // Time when the operation was submitted. + google.protobuf.Timestamp submit_time = 10; +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/GetLocationRequest.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/GetLocationRequest.java new file mode 100644 index 00000000..6b7c7e0a --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/GetLocationRequest.java @@ -0,0 +1,634 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +/** + * + * + *
+ * The request message for [Locations.GetLocation][google.cloud.location.Locations.GetLocation].
+ * 
+ * + * Protobuf type {@code google.cloud.location.GetLocationRequest} + */ +public final class GetLocationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.location.GetLocationRequest) + GetLocationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetLocationRequest.newBuilder() to construct. + private GetLocationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetLocationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetLocationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetLocationRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_GetLocationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_GetLocationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.GetLocationRequest.class, + com.google.cloud.location.GetLocationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name for the location.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name for the location.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.location.GetLocationRequest)) { + return super.equals(obj); + } + com.google.cloud.location.GetLocationRequest other = + (com.google.cloud.location.GetLocationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.location.GetLocationRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.GetLocationRequest 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.location.GetLocationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.GetLocationRequest 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.location.GetLocationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.GetLocationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.location.GetLocationRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.GetLocationRequest 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.location.GetLocationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.location.GetLocationRequest 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.location.GetLocationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.GetLocationRequest 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.location.GetLocationRequest 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 request message for [Locations.GetLocation][google.cloud.location.Locations.GetLocation].
+   * 
+ * + * Protobuf type {@code google.cloud.location.GetLocationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.location.GetLocationRequest) + com.google.cloud.location.GetLocationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_GetLocationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_GetLocationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.GetLocationRequest.class, + com.google.cloud.location.GetLocationRequest.Builder.class); + } + + // Construct using com.google.cloud.location.GetLocationRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_GetLocationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.location.GetLocationRequest getDefaultInstanceForType() { + return com.google.cloud.location.GetLocationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.location.GetLocationRequest build() { + com.google.cloud.location.GetLocationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.location.GetLocationRequest buildPartial() { + com.google.cloud.location.GetLocationRequest result = + new com.google.cloud.location.GetLocationRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @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.location.GetLocationRequest) { + return mergeFrom((com.google.cloud.location.GetLocationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.location.GetLocationRequest other) { + if (other == com.google.cloud.location.GetLocationRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.location.GetLocationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.location.GetLocationRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name for the location.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name for the location.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name for the location.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for the location.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for the location.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + 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.location.GetLocationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.location.GetLocationRequest) + private static final com.google.cloud.location.GetLocationRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.location.GetLocationRequest(); + } + + public static com.google.cloud.location.GetLocationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetLocationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetLocationRequest(input, extensionRegistry); + } + }; + + 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.location.GetLocationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/GetLocationRequestOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/GetLocationRequestOrBuilder.java new file mode 100644 index 00000000..a8f3d0f9 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/GetLocationRequestOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +public interface GetLocationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.location.GetLocationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name for the location.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name for the location.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/ListLocationsRequest.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/ListLocationsRequest.java new file mode 100644 index 00000000..e1b3af7f --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/ListLocationsRequest.java @@ -0,0 +1,1082 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +/** + * + * + *
+ * The request message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
+ * 
+ * + * Protobuf type {@code google.cloud.location.ListLocationsRequest} + */ +public final class ListLocationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.location.ListLocationsRequest) + ListLocationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListLocationsRequest.newBuilder() to construct. + private ListLocationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLocationsRequest() { + name_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLocationsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListLocationsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.ListLocationsRequest.class, + com.google.cloud.location.ListLocationsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource that owns the locations collection, if applicable.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource that owns the locations collection, if applicable.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The standard list filter.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The standard list filter.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The standard list page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The standard list page token.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The standard list page token.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.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.location.ListLocationsRequest)) { + return super.equals(obj); + } + com.google.cloud.location.ListLocationsRequest other = + (com.google.cloud.location.ListLocationsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.location.ListLocationsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.ListLocationsRequest 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.location.ListLocationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.ListLocationsRequest 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.location.ListLocationsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.ListLocationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.location.ListLocationsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.ListLocationsRequest 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.location.ListLocationsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.location.ListLocationsRequest 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.location.ListLocationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.ListLocationsRequest 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.location.ListLocationsRequest 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 request message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
+   * 
+ * + * Protobuf type {@code google.cloud.location.ListLocationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.location.ListLocationsRequest) + com.google.cloud.location.ListLocationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.ListLocationsRequest.class, + com.google.cloud.location.ListLocationsRequest.Builder.class); + } + + // Construct using com.google.cloud.location.ListLocationsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.location.ListLocationsRequest getDefaultInstanceForType() { + return com.google.cloud.location.ListLocationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.location.ListLocationsRequest build() { + com.google.cloud.location.ListLocationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.location.ListLocationsRequest buildPartial() { + com.google.cloud.location.ListLocationsRequest result = + new com.google.cloud.location.ListLocationsRequest(this); + result.name_ = name_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @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.location.ListLocationsRequest) { + return mergeFrom((com.google.cloud.location.ListLocationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.location.ListLocationsRequest other) { + if (other == com.google.cloud.location.ListLocationsRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.location.ListLocationsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.location.ListLocationsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource that owns the locations collection, if applicable.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource that owns the locations collection, if applicable.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource that owns the locations collection, if applicable.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource that owns the locations collection, if applicable.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource that owns the locations collection, if applicable.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The standard list filter.
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The standard list filter.
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The standard list filter.
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The standard list filter.
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard list filter.
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The standard list page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The standard list page size.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The standard list page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The standard list page token.
+     * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The standard list page token.
+     * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The standard list page token.
+     * 
+ * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The standard list page token.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard list page token.
+     * 
+ * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + 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.location.ListLocationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.location.ListLocationsRequest) + private static final com.google.cloud.location.ListLocationsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.location.ListLocationsRequest(); + } + + public static com.google.cloud.location.ListLocationsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLocationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListLocationsRequest(input, extensionRegistry); + } + }; + + 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.location.ListLocationsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/ListLocationsRequestOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/ListLocationsRequestOrBuilder.java new file mode 100644 index 00000000..3a3f39a7 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/ListLocationsRequestOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +public interface ListLocationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.location.ListLocationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource that owns the locations collection, if applicable.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource that owns the locations collection, if applicable.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The standard list filter.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The standard list filter.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The standard list page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The standard list page token.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The standard list page token.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/ListLocationsResponse.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/ListLocationsResponse.java new file mode 100644 index 00000000..8e7553c0 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/ListLocationsResponse.java @@ -0,0 +1,1126 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +/** + * + * + *
+ * The response message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
+ * 
+ * + * Protobuf type {@code google.cloud.location.ListLocationsResponse} + */ +public final class ListLocationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.location.ListLocationsResponse) + ListLocationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListLocationsResponse.newBuilder() to construct. + private ListLocationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLocationsResponse() { + locations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLocationsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListLocationsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + locations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + locations_.add( + input.readMessage( + com.google.cloud.location.Location.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + locations_ = java.util.Collections.unmodifiableList(locations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.ListLocationsResponse.class, + com.google.cloud.location.ListLocationsResponse.Builder.class); + } + + public static final int LOCATIONS_FIELD_NUMBER = 1; + private java.util.List locations_; + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + @java.lang.Override + public java.util.List getLocationsList() { + return locations_; + } + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + @java.lang.Override + public java.util.List + getLocationsOrBuilderList() { + return locations_; + } + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + @java.lang.Override + public int getLocationsCount() { + return locations_.size(); + } + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + @java.lang.Override + public com.google.cloud.location.Location getLocations(int index) { + return locations_.get(index); + } + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + @java.lang.Override + public com.google.cloud.location.LocationOrBuilder getLocationsOrBuilder(int index) { + return locations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The standard List next-page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The standard List next-page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 { + for (int i = 0; i < locations_.size(); i++) { + output.writeMessage(1, locations_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < locations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, locations_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.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.location.ListLocationsResponse)) { + return super.equals(obj); + } + com.google.cloud.location.ListLocationsResponse other = + (com.google.cloud.location.ListLocationsResponse) obj; + + if (!getLocationsList().equals(other.getLocationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLocationsCount() > 0) { + hash = (37 * hash) + LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getLocationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.location.ListLocationsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.ListLocationsResponse 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.location.ListLocationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.ListLocationsResponse 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.location.ListLocationsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.ListLocationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.location.ListLocationsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.ListLocationsResponse 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.location.ListLocationsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.location.ListLocationsResponse 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.location.ListLocationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.ListLocationsResponse 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.location.ListLocationsResponse 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 response message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
+   * 
+ * + * Protobuf type {@code google.cloud.location.ListLocationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.location.ListLocationsResponse) + com.google.cloud.location.ListLocationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.ListLocationsResponse.class, + com.google.cloud.location.ListLocationsResponse.Builder.class); + } + + // Construct using com.google.cloud.location.ListLocationsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getLocationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (locationsBuilder_ == null) { + locations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + locationsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_ListLocationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.location.ListLocationsResponse getDefaultInstanceForType() { + return com.google.cloud.location.ListLocationsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.location.ListLocationsResponse build() { + com.google.cloud.location.ListLocationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.location.ListLocationsResponse buildPartial() { + com.google.cloud.location.ListLocationsResponse result = + new com.google.cloud.location.ListLocationsResponse(this); + int from_bitField0_ = bitField0_; + if (locationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + locations_ = java.util.Collections.unmodifiableList(locations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.locations_ = locations_; + } else { + result.locations_ = locationsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @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.location.ListLocationsResponse) { + return mergeFrom((com.google.cloud.location.ListLocationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.location.ListLocationsResponse other) { + if (other == com.google.cloud.location.ListLocationsResponse.getDefaultInstance()) + return this; + if (locationsBuilder_ == null) { + if (!other.locations_.isEmpty()) { + if (locations_.isEmpty()) { + locations_ = other.locations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLocationsIsMutable(); + locations_.addAll(other.locations_); + } + onChanged(); + } + } else { + if (!other.locations_.isEmpty()) { + if (locationsBuilder_.isEmpty()) { + locationsBuilder_.dispose(); + locationsBuilder_ = null; + locations_ = other.locations_; + bitField0_ = (bitField0_ & ~0x00000001); + locationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLocationsFieldBuilder() + : null; + } else { + locationsBuilder_.addAllMessages(other.locations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.location.ListLocationsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.location.ListLocationsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List locations_ = + java.util.Collections.emptyList(); + + private void ensureLocationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + locations_ = new java.util.ArrayList(locations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.location.Location, + com.google.cloud.location.Location.Builder, + com.google.cloud.location.LocationOrBuilder> + locationsBuilder_; + + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public java.util.List getLocationsList() { + if (locationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(locations_); + } else { + return locationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public int getLocationsCount() { + if (locationsBuilder_ == null) { + return locations_.size(); + } else { + return locationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public com.google.cloud.location.Location getLocations(int index) { + if (locationsBuilder_ == null) { + return locations_.get(index); + } else { + return locationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder setLocations(int index, com.google.cloud.location.Location value) { + if (locationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationsIsMutable(); + locations_.set(index, value); + onChanged(); + } else { + locationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder setLocations( + int index, com.google.cloud.location.Location.Builder builderForValue) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + locations_.set(index, builderForValue.build()); + onChanged(); + } else { + locationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder addLocations(com.google.cloud.location.Location value) { + if (locationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationsIsMutable(); + locations_.add(value); + onChanged(); + } else { + locationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder addLocations(int index, com.google.cloud.location.Location value) { + if (locationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationsIsMutable(); + locations_.add(index, value); + onChanged(); + } else { + locationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder addLocations(com.google.cloud.location.Location.Builder builderForValue) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + locations_.add(builderForValue.build()); + onChanged(); + } else { + locationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder addLocations( + int index, com.google.cloud.location.Location.Builder builderForValue) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + locations_.add(index, builderForValue.build()); + onChanged(); + } else { + locationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder addAllLocations( + java.lang.Iterable values) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, locations_); + onChanged(); + } else { + locationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder clearLocations() { + if (locationsBuilder_ == null) { + locations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + locationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public Builder removeLocations(int index) { + if (locationsBuilder_ == null) { + ensureLocationsIsMutable(); + locations_.remove(index); + onChanged(); + } else { + locationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public com.google.cloud.location.Location.Builder getLocationsBuilder(int index) { + return getLocationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public com.google.cloud.location.LocationOrBuilder getLocationsOrBuilder(int index) { + if (locationsBuilder_ == null) { + return locations_.get(index); + } else { + return locationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public java.util.List + getLocationsOrBuilderList() { + if (locationsBuilder_ != null) { + return locationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(locations_); + } + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public com.google.cloud.location.Location.Builder addLocationsBuilder() { + return getLocationsFieldBuilder() + .addBuilder(com.google.cloud.location.Location.getDefaultInstance()); + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public com.google.cloud.location.Location.Builder addLocationsBuilder(int index) { + return getLocationsFieldBuilder() + .addBuilder(index, com.google.cloud.location.Location.getDefaultInstance()); + } + /** + * + * + *
+     * A list of locations that matches the specified filter in the request.
+     * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + public java.util.List getLocationsBuilderList() { + return getLocationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.location.Location, + com.google.cloud.location.Location.Builder, + com.google.cloud.location.LocationOrBuilder> + getLocationsFieldBuilder() { + if (locationsBuilder_ == null) { + locationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.location.Location, + com.google.cloud.location.Location.Builder, + com.google.cloud.location.LocationOrBuilder>( + locations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + locations_ = null; + } + return locationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + 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.location.ListLocationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.location.ListLocationsResponse) + private static final com.google.cloud.location.ListLocationsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.location.ListLocationsResponse(); + } + + public static com.google.cloud.location.ListLocationsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLocationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListLocationsResponse(input, extensionRegistry); + } + }; + + 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.location.ListLocationsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/ListLocationsResponseOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/ListLocationsResponseOrBuilder.java new file mode 100644 index 00000000..704771cc --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/ListLocationsResponseOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +public interface ListLocationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.location.ListLocationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + java.util.List getLocationsList(); + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + com.google.cloud.location.Location getLocations(int index); + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + int getLocationsCount(); + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + java.util.List getLocationsOrBuilderList(); + /** + * + * + *
+   * A list of locations that matches the specified filter in the request.
+   * 
+ * + * repeated .google.cloud.location.Location locations = 1; + */ + com.google.cloud.location.LocationOrBuilder getLocationsOrBuilder(int index); + + /** + * + * + *
+   * The standard List next-page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The standard List next-page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/Location.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/Location.java new file mode 100644 index 00000000..7b7bfc86 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/Location.java @@ -0,0 +1,1615 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +/** + * + * + *
+ * A resource that represents Google Cloud Platform location.
+ * 
+ * + * Protobuf type {@code google.cloud.location.Location} + */ +public final class Location extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.location.Location) + LocationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Location.newBuilder() to construct. + private Location(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Location() { + name_ = ""; + locationId_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Location(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Location( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 26: + { + com.google.protobuf.Any.Builder subBuilder = null; + if (metadata_ != null) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + locationId_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_Location_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.Location.class, + com.google.cloud.location.Location.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Resource name for the location, which may vary between implementations.
+   * For example: `"projects/example-project/locations/us-east1"`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name for the location, which may vary between implementations.
+   * For example: `"projects/example-project/locations/us-east1"`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object locationId_; + /** + * + * + *
+   * The canonical id for this location. For example: `"us-east1"`.
+   * 
+ * + * string location_id = 4; + * + * @return The locationId. + */ + @java.lang.Override + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + 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(); + locationId_ = s; + return s; + } + } + /** + * + * + *
+   * The canonical id for this location. For example: `"us-east1"`.
+   * 
+ * + * string location_id = 4; + * + * @return The bytes for locationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * The friendly name for this location, typically a nearby city name.
+   * For example, "Tokyo".
+   * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The friendly name for this location, typically a nearby city name.
+   * For example, "Tokyo".
+   * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 2; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_Location_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int METADATA_FIELD_NUMBER = 3; + private com.google.protobuf.Any metadata_; + /** + * + * + *
+   * Service-specific metadata. For example the available capacity at the given
+   * location.
+   * 
+ * + * .google.protobuf.Any metadata = 3; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+   * Service-specific metadata. For example the available capacity at the given
+   * location.
+   * 
+ * + * .google.protobuf.Any metadata = 3; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.Any getMetadata() { + return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; + } + /** + * + * + *
+   * Service-specific metadata. For example the available capacity at the given
+   * location.
+   * 
+ * + * .google.protobuf.Any metadata = 3; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 2); + if (metadata_ != null) { + output.writeMessage(3, getMetadata()); + } + if (!getLocationIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, locationId_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, labels__); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMetadata()); + } + if (!getLocationIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, locationId_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_); + } + size += unknownFields.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.location.Location)) { + return super.equals(obj); + } + com.google.cloud.location.Location other = (com.google.cloud.location.Location) obj; + + if (!getName().equals(other.getName())) return false; + if (!getLocationId().equals(other.getLocationId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + LOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getLocationId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.location.Location parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.Location 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.location.Location parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.Location 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.location.Location parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.location.Location parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.location.Location parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.Location 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.location.Location parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.location.Location 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.location.Location parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.location.Location 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.location.Location 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; + } + /** + * + * + *
+   * A resource that represents Google Cloud Platform location.
+   * 
+ * + * Protobuf type {@code google.cloud.location.Location} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.location.Location) + com.google.cloud.location.LocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_Location_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.location.Location.class, + com.google.cloud.location.Location.Builder.class); + } + + // Construct using com.google.cloud.location.Location.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + locationId_ = ""; + + displayName_ = ""; + + internalGetMutableLabels().clear(); + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.location.LocationsProto + .internal_static_google_cloud_location_Location_descriptor; + } + + @java.lang.Override + public com.google.cloud.location.Location getDefaultInstanceForType() { + return com.google.cloud.location.Location.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.location.Location build() { + com.google.cloud.location.Location result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.location.Location buildPartial() { + com.google.cloud.location.Location result = new com.google.cloud.location.Location(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.locationId_ = locationId_; + result.displayName_ = displayName_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.location.Location) { + return mergeFrom((com.google.cloud.location.Location) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.location.Location other) { + if (other == com.google.cloud.location.Location.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getLocationId().isEmpty()) { + locationId_ = other.locationId_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.location.Location parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.location.Location) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name for the location, which may vary between implementations.
+     * For example: `"projects/example-project/locations/us-east1"`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name for the location, which may vary between implementations.
+     * For example: `"projects/example-project/locations/us-east1"`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name for the location, which may vary between implementations.
+     * For example: `"projects/example-project/locations/us-east1"`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for the location, which may vary between implementations.
+     * For example: `"projects/example-project/locations/us-east1"`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name for the location, which may vary between implementations.
+     * For example: `"projects/example-project/locations/us-east1"`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object locationId_ = ""; + /** + * + * + *
+     * The canonical id for this location. For example: `"us-east1"`.
+     * 
+ * + * string location_id = 4; + * + * @return The locationId. + */ + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The canonical id for this location. For example: `"us-east1"`.
+     * 
+ * + * string location_id = 4; + * + * @return The bytes for locationId. + */ + public com.google.protobuf.ByteString getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The canonical id for this location. For example: `"us-east1"`.
+     * 
+ * + * string location_id = 4; + * + * @param value The locationId to set. + * @return This builder for chaining. + */ + public Builder setLocationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + locationId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The canonical id for this location. For example: `"us-east1"`.
+     * 
+ * + * string location_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearLocationId() { + + locationId_ = getDefaultInstance().getLocationId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The canonical id for this location. For example: `"us-east1"`.
+     * 
+ * + * string location_id = 4; + * + * @param value The bytes for locationId to set. + * @return This builder for chaining. + */ + public Builder setLocationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + locationId_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The friendly name for this location, typically a nearby city name.
+     * For example, "Tokyo".
+     * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The friendly name for this location, typically a nearby city name.
+     * For example, "Tokyo".
+     * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The friendly name for this location, typically a nearby city name.
+     * For example, "Tokyo".
+     * 
+ * + * string display_name = 5; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The friendly name for this location, typically a nearby city name.
+     * For example, "Tokyo".
+     * 
+ * + * string display_name = 5; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The friendly name for this location, typically a nearby city name.
+     * For example, "Tokyo".
+     * 
+ * + * string display_name = 5; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Cross-service attributes for the location. For example
+     *     {"cloud.googleapis.com/region": "us-east1"}
+     * 
+ * + * map<string, string> labels = 2; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.Any metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + metadataBuilder_; + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + * + * @return The metadata. + */ + public com.google.protobuf.Any getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + public Builder setMetadata(com.google.protobuf.Any value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + public Builder setMetadata(com.google.protobuf.Any.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + public Builder mergeMetadata(com.google.protobuf.Any value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = com.google.protobuf.Any.newBuilder(metadata_).mergeFrom(value).buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + public com.google.protobuf.Any.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; + } + } + /** + * + * + *
+     * Service-specific metadata. For example the available capacity at the given
+     * location.
+     * 
+ * + * .google.protobuf.Any metadata = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>(getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @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.location.Location) + } + + // @@protoc_insertion_point(class_scope:google.cloud.location.Location) + private static final com.google.cloud.location.Location DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.location.Location(); + } + + public static com.google.cloud.location.Location getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Location parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Location(input, extensionRegistry); + } + }; + + 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.location.Location getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/LocationOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/LocationOrBuilder.java new file mode 100644 index 00000000..98ab25de --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/LocationOrBuilder.java @@ -0,0 +1,201 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +public interface LocationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.location.Location) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name for the location, which may vary between implementations.
+   * For example: `"projects/example-project/locations/us-east1"`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name for the location, which may vary between implementations.
+   * For example: `"projects/example-project/locations/us-east1"`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The canonical id for this location. For example: `"us-east1"`.
+   * 
+ * + * string location_id = 4; + * + * @return The locationId. + */ + java.lang.String getLocationId(); + /** + * + * + *
+   * The canonical id for this location. For example: `"us-east1"`.
+   * 
+ * + * string location_id = 4; + * + * @return The bytes for locationId. + */ + com.google.protobuf.ByteString getLocationIdBytes(); + + /** + * + * + *
+   * The friendly name for this location, typically a nearby city name.
+   * For example, "Tokyo".
+   * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The friendly name for this location, typically a nearby city name.
+   * For example, "Tokyo".
+   * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + int getLabelsCount(); + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Cross-service attributes for the location. For example
+   *     {"cloud.googleapis.com/region": "us-east1"}
+   * 
+ * + * map<string, string> labels = 2; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Service-specific metadata. For example the available capacity at the given
+   * location.
+   * 
+ * + * .google.protobuf.Any metadata = 3; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+   * Service-specific metadata. For example the available capacity at the given
+   * location.
+   * 
+ * + * .google.protobuf.Any metadata = 3; + * + * @return The metadata. + */ + com.google.protobuf.Any getMetadata(); + /** + * + * + *
+   * Service-specific metadata. For example the available capacity at the given
+   * location.
+   * 
+ * + * .google.protobuf.Any metadata = 3; + */ + com.google.protobuf.AnyOrBuilder getMetadataOrBuilder(); +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/LocationsProto.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/LocationsProto.java new file mode 100644 index 00000000..d2b6da30 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/location/LocationsProto.java @@ -0,0 +1,150 @@ +/* + * Copyright 2020 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/location/locations.proto + +package com.google.cloud.location; + +public final class LocationsProto { + private LocationsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_location_ListLocationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_location_ListLocationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_location_ListLocationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_location_ListLocationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_location_GetLocationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_location_GetLocationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_location_Location_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_location_Location_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_location_Location_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_location_Location_LabelsEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n%google/cloud/location/locations.proto\022" + + "\025google.cloud.location\032\034google/api/annot" + + "ations.proto\032\031google/protobuf/any.proto\032" + + "\027google/api/client.proto\"[\n\024ListLocation" + + "sRequest\022\014\n\004name\030\001 \001(\t\022\016\n\006filter\030\002 \001(\t\022\021" + + "\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"d\n" + + "\025ListLocationsResponse\0222\n\tlocations\030\001 \003(" + + "\0132\037.google.cloud.location.Location\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\"\"\n\022GetLocationReques" + + "t\022\014\n\004name\030\001 \001(\t\"\327\001\n\010Location\022\014\n\004name\030\001 \001" + + "(\t\022\023\n\013location_id\030\004 \001(\t\022\024\n\014display_name\030" + + "\005 \001(\t\022;\n\006labels\030\002 \003(\0132+.google.cloud.loc" + + "ation.Location.LabelsEntry\022&\n\010metadata\030\003" + + " \001(\0132\024.google.protobuf.Any\032-\n\013LabelsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\0012\244\003\n\tLo" + + "cations\022\253\001\n\rListLocations\022+.google.cloud" + + ".location.ListLocationsRequest\032,.google." + + "cloud.location.ListLocationsResponse\"?\202\323" + + "\344\223\0029\022\024/v1/{name=locations}Z!\022\037/v1/{name=" + + "projects/*}/locations\022\236\001\n\013GetLocation\022)." + + "google.cloud.location.GetLocationRequest" + + "\032\037.google.cloud.location.Location\"C\202\323\344\223\002" + + "=\022\026/v1/{name=locations/*}Z#\022!/v1/{name=p" + + "rojects/*/locations/*}\032H\312A\024cloud.googlea" + + "pis.com\322A.https://www.googleapis.com/aut" + + "h/cloud-platformBo\n\031com.google.cloud.loc" + + "ationB\016LocationsProtoP\001Z=google.golang.o" + + "rg/genproto/googleapis/cloud/location;lo" + + "cation\370\001\001b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_cloud_location_ListLocationsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_location_ListLocationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_location_ListLocationsRequest_descriptor, + new java.lang.String[] { + "Name", "Filter", "PageSize", "PageToken", + }); + internal_static_google_cloud_location_ListLocationsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_location_ListLocationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_location_ListLocationsResponse_descriptor, + new java.lang.String[] { + "Locations", "NextPageToken", + }); + internal_static_google_cloud_location_GetLocationRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_location_GetLocationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_location_GetLocationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_location_Location_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_location_Location_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_location_Location_descriptor, + new java.lang.String[] { + "Name", "LocationId", "DisplayName", "Labels", "Metadata", + }); + internal_static_google_cloud_location_Location_LabelsEntry_descriptor = + internal_static_google_cloud_location_Location_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_location_Location_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_location_Location_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequest.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequest.java index 4f95412e..eeada506 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequest.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequest.java @@ -161,6 +161,23 @@ private BatchTranslateDocumentRequest( glossaries_.getMutableMap().put(glossaries__.getKey(), glossaries__.getValue()); break; } + case 66: + { + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + formatConversions_ = + com.google.protobuf.MapField.newMapField( + FormatConversionsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000010; + } + com.google.protobuf.MapEntry formatConversions__ = + input.readMessage( + FormatConversionsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + formatConversions_ + .getMutableMap() + .put(formatConversions__.getKey(), formatConversions__.getValue()); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -199,6 +216,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { return internalGetModels(); case 7: return internalGetGlossaries(); + case 8: + return internalGetFormatConversions(); default: throw new RuntimeException("Invalid map field number: " + number); } @@ -815,6 +834,143 @@ public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossar 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, + ""); + } + + 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 java.lang.NullPointerException(); + } + 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 java.lang.String getFormatConversionsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 java.lang.NullPointerException(); + } + java.util.Map map = internalGetFormatConversions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -848,6 +1004,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io 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); unknownFields.writeTo(output); } @@ -900,6 +1061,16 @@ public int getSerializedSize() { .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__); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -926,6 +1097,7 @@ public boolean equals(final java.lang.Object obj) { } if (!internalGetModels().equals(other.internalGetModels())) return false; if (!internalGetGlossaries().equals(other.internalGetGlossaries())) return false; + if (!internalGetFormatConversions().equals(other.internalGetFormatConversions())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -961,6 +1133,10 @@ public int hashCode() { 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 = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -1087,6 +1263,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { return internalGetModels(); case 7: return internalGetGlossaries(); + case 8: + return internalGetFormatConversions(); default: throw new RuntimeException("Invalid map field number: " + number); } @@ -1099,6 +1277,8 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { return internalGetMutableModels(); case 7: return internalGetMutableGlossaries(); + case 8: + return internalGetMutableFormatConversions(); default: throw new RuntimeException("Invalid map field number: " + number); } @@ -1153,6 +1333,7 @@ public Builder clear() { } internalGetMutableModels().clear(); internalGetMutableGlossaries().clear(); + internalGetMutableFormatConversions().clear(); return this; } @@ -1207,6 +1388,8 @@ public com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest buildPar result.models_.makeImmutable(); result.glossaries_ = internalGetGlossaries(); result.glossaries_.makeImmutable(); + result.formatConversions_ = internalGetFormatConversions(); + result.formatConversions_.makeImmutable(); onBuilt(); return result; } @@ -1309,6 +1492,7 @@ public Builder mergeFrom( } internalGetMutableModels().mergeFrom(other.internalGetModels()); internalGetMutableGlossaries().mergeFrom(other.internalGetGlossaries()); + internalGetMutableFormatConversions().mergeFrom(other.internalGetFormatConversions()); this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -2883,6 +3067,233 @@ public Builder putAllGlossaries( return this; } + 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() { + onChanged(); + ; + if (formatConversions_ == null) { + formatConversions_ = + com.google.protobuf.MapField.newMapField( + FormatConversionsDefaultEntryHolder.defaultEntry); + } + if (!formatConversions_.isMutable()) { + formatConversions_ = formatConversions_.copy(); + } + 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 java.lang.NullPointerException(); + } + 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 java.lang.String getFormatConversionsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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 java.lang.NullPointerException(); + } + java.util.Map map = + internalGetFormatConversions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearFormatConversions() { + 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 java.lang.NullPointerException(); + } + internalGetMutableFormatConversions().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableFormatConversions() { + 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 java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableFormatConversions().getMutableMap().put(key, value); + 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); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequestOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequestOrBuilder.java index 93da1f43..3859890b 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequestOrBuilder.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequestOrBuilder.java @@ -442,4 +442,104 @@ com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossariesOrDe */ com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossariesOrThrow( java.lang.String key); + + /** + * + * + *
+   * 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]; + * + */ + int getFormatConversionsCount(); + /** + * + * + *
+   * 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]; + * + */ + boolean containsFormatConversions(java.lang.String key); + /** Use {@link #getFormatConversionsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getFormatConversions(); + /** + * + * + *
+   * 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.util.Map 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.String getFormatConversionsOrDefault( + java.lang.String key, java.lang.String 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.String getFormatConversionsOrThrow(java.lang.String key); } diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceProto.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceProto.java index 84e89626..d20e7a8d 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceProto.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceProto.java @@ -199,6 +199,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_GlossariesEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_GlossariesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_FormatConversionsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_FormatConversionsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_translation_v3beta1_BatchDocumentInputConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -230,288 +234,293 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "to\032\027google/api/client.proto\032\037google/api/" + "field_behavior.proto\032\031google/api/resourc" + "e.proto\032#google/longrunning/operations.p" - + "roto\032\037google/protobuf/timestamp.proto\"N\n" - + "\033TranslateTextGlossaryConfig\022\025\n\010glossary" - + "\030\001 \001(\tB\003\340A\002\022\030\n\013ignore_case\030\002 \001(\010B\003\340A\001\"\277\003" - + "\n\024TranslateTextRequest\022\025\n\010contents\030\001 \003(\t" - + "B\003\340A\002\022\026\n\tmime_type\030\003 \001(\tB\003\340A\001\022!\n\024source_" - + "language_code\030\004 \001(\tB\003\340A\001\022!\n\024target_langu" - + "age_code\030\005 \001(\tB\003\340A\002\0229\n\006parent\030\010 \001(\tB)\340A\002" - + "\372A#\n!locations.googleapis.com/Location\022\022" - + "\n\005model\030\006 \001(\tB\003\340A\001\022[\n\017glossary_config\030\007 " - + "\001(\0132=.google.cloud.translation.v3beta1.T" - + "ranslateTextGlossaryConfigB\003\340A\001\022W\n\006label" - + "s\030\n \003(\0132B.google.cloud.translation.v3bet" - + "a1.TranslateTextRequest.LabelsEntryB\003\340A\001" - + "\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " - + "\001(\t:\0028\001\"\252\001\n\025TranslateTextResponse\022C\n\014tra" - + "nslations\030\001 \003(\0132-.google.cloud.translati" - + "on.v3beta1.Translation\022L\n\025glossary_trans" - + "lations\030\003 \003(\0132-.google.cloud.translation" - + ".v3beta1.Translation\"\255\001\n\013Translation\022\027\n\017" - + "translated_text\030\001 \001(\t\022\r\n\005model\030\002 \001(\t\022\036\n\026" - + "detected_language_code\030\004 \001(\t\022V\n\017glossary" - + "_config\030\003 \001(\0132=.google.cloud.translation" - + ".v3beta1.TranslateTextGlossaryConfig\"\244\002\n" - + "\025DetectLanguageRequest\0229\n\006parent\030\005 \001(\tB)" - + "\340A\002\372A#\n!locations.googleapis.com/Locatio" - + "n\022\022\n\005model\030\004 \001(\tB\003\340A\001\022\021\n\007content\030\001 \001(\tH\000" - + "\022\026\n\tmime_type\030\003 \001(\tB\003\340A\001\022X\n\006labels\030\006 \003(\013" - + "2C.google.cloud.translation.v3beta1.Dete" - + "ctLanguageRequest.LabelsEntryB\003\340A\001\032-\n\013La" - + "belsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" - + "\001B\010\n\006source\"=\n\020DetectedLanguage\022\025\n\rlangu" - + "age_code\030\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002\"_\n\026De" - + "tectLanguageResponse\022E\n\tlanguages\030\001 \003(\0132" - + "2.google.cloud.translation.v3beta1.Detec" - + "tedLanguage\"\221\001\n\034GetSupportedLanguagesReq" - + "uest\0229\n\006parent\030\003 \001(\tB)\340A\002\372A#\n!locations." - + "googleapis.com/Location\022\"\n\025display_langu" - + "age_code\030\001 \001(\tB\003\340A\001\022\022\n\005model\030\002 \001(\tB\003\340A\001\"" - + "\\\n\022SupportedLanguages\022F\n\tlanguages\030\001 \003(\013" - + "23.google.cloud.translation.v3beta1.Supp" - + "ortedLanguage\"p\n\021SupportedLanguage\022\025\n\rla" - + "nguage_code\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022" - + "\026\n\016support_source\030\003 \001(\010\022\026\n\016support_targe" - + "t\030\004 \001(\010\"#\n\tGcsSource\022\026\n\tinput_uri\030\001 \001(\tB" - + "\003\340A\002\"r\n\013InputConfig\022\026\n\tmime_type\030\001 \001(\tB\003" - + "\340A\001\022A\n\ngcs_source\030\002 \001(\0132+.google.cloud.t" - + "ranslation.v3beta1.GcsSourceH\000B\010\n\006source" - + "\"0\n\016GcsDestination\022\036\n\021output_uri_prefix\030" - + "\001 \001(\tB\003\340A\002\"j\n\014OutputConfig\022K\n\017gcs_destin" - + "ation\030\001 \001(\01320.google.cloud.translation.v" - + "3beta1.GcsDestinationH\000B\r\n\013destination\"\210" - + "\001\n\023DocumentInputConfig\022\021\n\007content\030\001 \001(\014H" - + "\000\022A\n\ngcs_source\030\002 \001(\0132+.google.cloud.tra" - + "nslation.v3beta1.GcsSourceH\000\022\021\n\tmime_typ" - + "e\030\004 \001(\tB\010\n\006source\"\217\001\n\024DocumentOutputConf" - + "ig\022P\n\017gcs_destination\030\001 \001(\01320.google.clo" - + "ud.translation.v3beta1.GcsDestinationB\003\340" - + "A\001H\000\022\026\n\tmime_type\030\003 \001(\tB\003\340A\001B\r\n\013destinat" - + "ion\"\252\004\n\030TranslateDocumentRequest\022\023\n\006pare" - + "nt\030\001 \001(\tB\003\340A\002\022!\n\024source_language_code\030\002 " - + "\001(\tB\003\340A\001\022!\n\024target_language_code\030\003 \001(\tB\003" - + "\340A\002\022Y\n\025document_input_config\030\004 \001(\01325.goo" - + "gle.cloud.translation.v3beta1.DocumentIn" - + "putConfigB\003\340A\002\022[\n\026document_output_config" - + "\030\005 \001(\01326.google.cloud.translation.v3beta" - + "1.DocumentOutputConfigB\003\340A\001\022\022\n\005model\030\006 \001" - + "(\tB\003\340A\001\022[\n\017glossary_config\030\007 \001(\0132=.googl" - + "e.cloud.translation.v3beta1.TranslateTex" - + "tGlossaryConfigB\003\340A\001\022[\n\006labels\030\010 \003(\0132F.g" - + "oogle.cloud.translation.v3beta1.Translat" - + "eDocumentRequest.LabelsEntryB\003\340A\001\032-\n\013Lab" - + "elsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" - + "\"e\n\023DocumentTranslation\022\033\n\023byte_stream_o" - + "utputs\030\001 \003(\014\022\021\n\tmime_type\030\002 \001(\t\022\036\n\026detec" - + "ted_language_code\030\003 \001(\t\"\265\002\n\031TranslateDoc" - + "umentResponse\022S\n\024document_translation\030\001 " - + "\001(\01325.google.cloud.translation.v3beta1.D" - + "ocumentTranslation\022\\\n\035glossary_document_" - + "translation\030\002 \001(\01325.google.cloud.transla" - + "tion.v3beta1.DocumentTranslation\022\r\n\005mode" - + "l\030\003 \001(\t\022V\n\017glossary_config\030\004 \001(\0132=.googl" + + "roto\032\037google/protobuf/timestamp.proto\032\027g" + + "oogle/rpc/status.proto\"N\n\033TranslateTextG" + + "lossaryConfig\022\025\n\010glossary\030\001 \001(\tB\003\340A\002\022\030\n\013" + + "ignore_case\030\002 \001(\010B\003\340A\001\"\277\003\n\024TranslateText" + + "Request\022\025\n\010contents\030\001 \003(\tB\003\340A\002\022\026\n\tmime_t" + + "ype\030\003 \001(\tB\003\340A\001\022!\n\024source_language_code\030\004" + + " \001(\tB\003\340A\001\022!\n\024target_language_code\030\005 \001(\tB" + + "\003\340A\002\0229\n\006parent\030\010 \001(\tB)\340A\002\372A#\n!locations." + + "googleapis.com/Location\022\022\n\005model\030\006 \001(\tB\003" + + "\340A\001\022[\n\017glossary_config\030\007 \001(\0132=.google.cl" + + "oud.translation.v3beta1.TranslateTextGlo" + + "ssaryConfigB\003\340A\001\022W\n\006labels\030\n \003(\0132B.googl" + "e.cloud.translation.v3beta1.TranslateTex" - + "tGlossaryConfig\"\246\006\n\031BatchTranslateTextRe" - + "quest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations" - + ".googleapis.com/Location\022!\n\024source_langu" - + "age_code\030\002 \001(\tB\003\340A\002\022\"\n\025target_language_c" - + "odes\030\003 \003(\tB\003\340A\002\022\\\n\006models\030\004 \003(\0132G.google" - + ".cloud.translation.v3beta1.BatchTranslat" - + "eTextRequest.ModelsEntryB\003\340A\001\022I\n\rinput_c" - + "onfigs\030\005 \003(\0132-.google.cloud.translation." - + "v3beta1.InputConfigB\003\340A\002\022J\n\routput_confi" - + "g\030\006 \001(\0132..google.cloud.translation.v3bet" - + "a1.OutputConfigB\003\340A\002\022d\n\nglossaries\030\007 \003(\013" - + "2K.google.cloud.translation.v3beta1.Batc" - + "hTranslateTextRequest.GlossariesEntryB\003\340" - + "A\001\022\\\n\006labels\030\t \003(\0132G.google.cloud.transl" - + "ation.v3beta1.BatchTranslateTextRequest." - + "LabelsEntryB\003\340A\001\032-\n\013ModelsEntry\022\013\n\003key\030\001" - + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032p\n\017GlossariesEnt" - + "ry\022\013\n\003key\030\001 \001(\t\022L\n\005value\030\002 \001(\0132=.google." - + "cloud.translation.v3beta1.TranslateTextG" - + "lossaryConfig:\0028\001\032-\n\013LabelsEntry\022\013\n\003key\030" - + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\323\002\n\026BatchTransl" - + "ateMetadata\022M\n\005state\030\001 \001(\0162>.google.clou" - + "d.translation.v3beta1.BatchTranslateMeta" - + "data.State\022\035\n\025translated_characters\030\002 \001(" - + "\003\022\031\n\021failed_characters\030\003 \001(\003\022\030\n\020total_ch" - + "aracters\030\004 \001(\003\022/\n\013submit_time\030\005 \001(\0132\032.go" - + "ogle.protobuf.Timestamp\"e\n\005State\022\025\n\021STAT" - + "E_UNSPECIFIED\020\000\022\013\n\007RUNNING\020\001\022\r\n\tSUCCEEDE" - + "D\020\002\022\n\n\006FAILED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCANCE" - + "LLED\020\005\"\313\001\n\026BatchTranslateResponse\022\030\n\020tot" - + "al_characters\030\001 \001(\003\022\035\n\025translated_charac" - + "ters\030\002 \001(\003\022\031\n\021failed_characters\030\003 \001(\003\022/\n" - + "\013submit_time\030\004 \001(\0132\032.google.protobuf.Tim" - + "estamp\022,\n\010end_time\030\005 \001(\0132\032.google.protob" - + "uf.Timestamp\"b\n\023GlossaryInputConfig\022A\n\ng" - + "cs_source\030\001 \001(\0132+.google.cloud.translati" - + "on.v3beta1.GcsSourceH\000B\010\n\006source\"\216\005\n\010Glo" - + "ssary\022\021\n\004name\030\001 \001(\tB\003\340A\002\022T\n\rlanguage_pai" - + "r\030\003 \001(\0132;.google.cloud.translation.v3bet" - + "a1.Glossary.LanguageCodePairH\000\022Y\n\022langua" - + "ge_codes_set\030\004 \001(\0132;.google.cloud.transl" - + "ation.v3beta1.Glossary.LanguageCodesSetH" - + "\000\022K\n\014input_config\030\005 \001(\01325.google.cloud.t" - + "ranslation.v3beta1.GlossaryInputConfig\022\030" - + "\n\013entry_count\030\006 \001(\005B\003\340A\003\0224\n\013submit_time\030" - + "\007 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0221" - + "\n\010end_time\030\010 \001(\0132\032.google.protobuf.Times" - + "tampB\003\340A\003\032N\n\020LanguageCodePair\022\034\n\024source_" - + "language_code\030\001 \001(\t\022\034\n\024target_language_c" - + "ode\030\002 \001(\t\032*\n\020LanguageCodesSet\022\026\n\016languag" - + "e_codes\030\001 \003(\t:e\352Ab\n!translate.googleapis" - + ".com/Glossary\022=projects/{project}/locati" - + "ons/{location}/glossaries/{glossary}B\013\n\t" - + "languages\"\225\001\n\025CreateGlossaryRequest\0229\n\006p" - + "arent\030\001 \001(\tB)\340A\002\372A#\n!locations.googleapi" - + "s.com/Location\022A\n\010glossary\030\002 \001(\0132*.googl" - + "e.cloud.translation.v3beta1.GlossaryB\003\340A" - + "\002\"M\n\022GetGlossaryRequest\0227\n\004name\030\001 \001(\tB)\340" - + "A\002\372A#\n!translate.googleapis.com/Glossary" - + "\"P\n\025DeleteGlossaryRequest\0227\n\004name\030\001 \001(\tB" - + ")\340A\002\372A#\n!translate.googleapis.com/Glossa" - + "ry\"\230\001\n\025ListGlossariesRequest\0229\n\006parent\030\001" - + " \001(\tB)\340A\002\372A#\n!locations.googleapis.com/L" - + "ocation\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_" - + "token\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001(\tB\003\340A\001\"q\n" - + "\026ListGlossariesResponse\022>\n\nglossaries\030\001 " - + "\003(\0132*.google.cloud.translation.v3beta1.G" - + "lossary\022\027\n\017next_page_token\030\002 \001(\t\"\215\002\n\026Cre" - + "ateGlossaryMetadata\022\014\n\004name\030\001 \001(\t\022M\n\005sta" - + "te\030\002 \001(\0162>.google.cloud.translation.v3be" - + "ta1.CreateGlossaryMetadata.State\022/\n\013subm" - + "it_time\030\003 \001(\0132\032.google.protobuf.Timestam" - + "p\"e\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007RUN" - + "NING\020\001\022\r\n\tSUCCEEDED\020\002\022\n\n\006FAILED\020\003\022\016\n\nCAN" - + "CELLING\020\004\022\r\n\tCANCELLED\020\005\"\215\002\n\026DeleteGloss" - + "aryMetadata\022\014\n\004name\030\001 \001(\t\022M\n\005state\030\002 \001(\016" - + "2>.google.cloud.translation.v3beta1.Dele" - + "teGlossaryMetadata.State\022/\n\013submit_time\030" - + "\003 \001(\0132\032.google.protobuf.Timestamp\"e\n\005Sta" - + "te\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007RUNNING\020\001\022\r" - + "\n\tSUCCEEDED\020\002\022\n\n\006FAILED\020\003\022\016\n\nCANCELLING\020" - + "\004\022\r\n\tCANCELLED\020\005\"\205\001\n\026DeleteGlossaryRespo" - + "nse\022\014\n\004name\030\001 \001(\t\022/\n\013submit_time\030\002 \001(\0132\032" - + ".google.protobuf.Timestamp\022,\n\010end_time\030\003" - + " \001(\0132\032.google.protobuf.Timestamp\"\277\005\n\035Bat" - + "chTranslateDocumentRequest\0229\n\006parent\030\001 \001" - + "(\tB)\340A\002\372A#\n!locations.googleapis.com/Loc" - + "ation\022!\n\024source_language_code\030\002 \001(\tB\003\340A\002" - + "\022\"\n\025target_language_codes\030\003 \003(\tB\003\340A\002\022V\n\r" - + "input_configs\030\004 \003(\0132:.google.cloud.trans" - + "lation.v3beta1.BatchDocumentInputConfigB" - + "\003\340A\002\022W\n\routput_config\030\005 \001(\0132;.google.clo" - + "ud.translation.v3beta1.BatchDocumentOutp" - + "utConfigB\003\340A\002\022`\n\006models\030\006 \003(\0132K.google.c" - + "loud.translation.v3beta1.BatchTranslateD" - + "ocumentRequest.ModelsEntryB\003\340A\001\022h\n\ngloss" - + "aries\030\007 \003(\0132O.google.cloud.translation.v" - + "3beta1.BatchTranslateDocumentRequest.Glo" - + "ssariesEntryB\003\340A\001\032-\n\013ModelsEntry\022\013\n\003key\030" - + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032p\n\017GlossariesEn" - + "try\022\013\n\003key\030\001 \001(\t\022L\n\005value\030\002 \001(\0132=.google" - + ".cloud.translation.v3beta1.TranslateText" - + "GlossaryConfig:\0028\001\"g\n\030BatchDocumentInput" - + "Config\022A\n\ngcs_source\030\001 \001(\0132+.google.clou" - + "d.translation.v3beta1.GcsSourceH\000B\010\n\006sou" - + "rce\"w\n\031BatchDocumentOutputConfig\022K\n\017gcs_" - + "destination\030\001 \001(\01320.google.cloud.transla" - + "tion.v3beta1.GcsDestinationH\000B\r\n\013destina" - + "tion\"\331\002\n\036BatchTranslateDocumentResponse\022" - + "\023\n\013total_pages\030\001 \001(\003\022\030\n\020translated_pages" - + "\030\002 \001(\003\022\024\n\014failed_pages\030\003 \001(\003\022\034\n\024total_bi" - + "llable_pages\030\004 \001(\003\022\030\n\020total_characters\030\005" - + " \001(\003\022\035\n\025translated_characters\030\006 \001(\003\022\031\n\021f" - + "ailed_characters\030\007 \001(\003\022!\n\031total_billable" - + "_characters\030\010 \001(\003\022/\n\013submit_time\030\t \001(\0132\032" - + ".google.protobuf.Timestamp\022,\n\010end_time\030\n" - + " \001(\0132\032.google.protobuf.Timestamp\"\351\003\n\036Bat" - + "chTranslateDocumentMetadata\022U\n\005state\030\001 \001" - + "(\0162F.google.cloud.translation.v3beta1.Ba" - + "tchTranslateDocumentMetadata.State\022\023\n\013to" - + "tal_pages\030\002 \001(\003\022\030\n\020translated_pages\030\003 \001(" - + "\003\022\024\n\014failed_pages\030\004 \001(\003\022\034\n\024total_billabl" - + "e_pages\030\005 \001(\003\022\030\n\020total_characters\030\006 \001(\003\022" - + "\035\n\025translated_characters\030\007 \001(\003\022\031\n\021failed" - + "_characters\030\010 \001(\003\022!\n\031total_billable_char" - + "acters\030\t \001(\003\022/\n\013submit_time\030\n \001(\0132\032.goog" - + "le.protobuf.Timestamp\"e\n\005State\022\025\n\021STATE_" - + "UNSPECIFIED\020\000\022\013\n\007RUNNING\020\001\022\r\n\tSUCCEEDED\020" - + "\002\022\n\n\006FAILED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCANCELL" - + "ED\020\0052\362\023\n\022TranslationService\022\364\001\n\rTranslat" - + "eText\0226.google.cloud.translation.v3beta1" - + ".TranslateTextRequest\0327.google.cloud.tra" - + "nslation.v3beta1.TranslateTextResponse\"r" - + "\202\323\344\223\002l\"6/v3beta1/{parent=projects/*/loca" - + "tions/*}:translateText:\001*Z/\"*/v3beta1/{p" - + "arent=projects/*}:translateText:\001*\022\223\002\n\016D" - + "etectLanguage\0227.google.cloud.translation" - + ".v3beta1.DetectLanguageRequest\0328.google." - + "cloud.translation.v3beta1.DetectLanguage" - + "Response\"\215\001\202\323\344\223\002n\"7/v3beta1/{parent=proj" - + "ects/*/locations/*}:detectLanguage:\001*Z0\"" - + "+/v3beta1/{parent=projects/*}:detectLang" - + "uage:\001*\332A\026parent,model,mime_type\022\253\002\n\025Get" - + "SupportedLanguages\022>.google.cloud.transl" - + "ation.v3beta1.GetSupportedLanguagesReque" - + "st\0324.google.cloud.translation.v3beta1.Su" - + "pportedLanguages\"\233\001\202\323\344\223\002p\022;/v3beta1/{par" - + "ent=projects/*/locations/*}/supportedLan" - + "guagesZ1\022//v3beta1/{parent=projects/*}/s" - + "upportedLanguages\332A\"parent,display_langu" - + "age_code,model\022\323\001\n\021TranslateDocument\022:.g" - + "oogle.cloud.translation.v3beta1.Translat" - + "eDocumentRequest\032;.google.cloud.translat" - + "ion.v3beta1.TranslateDocumentResponse\"E\202" - + "\323\344\223\002?\":/v3beta1/{parent=projects/*/locat" - + "ions/*}:translateDocument:\001*\022\353\001\n\022BatchTr" - + "anslateText\022;.google.cloud.translation.v" - + "3beta1.BatchTranslateTextRequest\032\035.googl" - + "e.longrunning.Operation\"y\202\323\344\223\002@\";/v3beta" - + "1/{parent=projects/*/locations/*}:batchT" - + "ranslateText:\001*\312A0\n\026BatchTranslateRespon" - + "se\022\026BatchTranslateMetadata\022\210\002\n\026BatchTran" - + "slateDocument\022?.google.cloud.translation" - + ".v3beta1.BatchTranslateDocumentRequest\032\035" - + ".google.longrunning.Operation\"\215\001\202\323\344\223\002D\"?" - + "/v3beta1/{parent=projects/*/locations/*}" - + ":batchTranslateDocument:\001*\312A@\n\036BatchTran" - + "slateDocumentResponse\022\036BatchTranslateDoc" - + "umentMetadata\022\346\001\n\016CreateGlossary\0227.googl" - + "e.cloud.translation.v3beta1.CreateGlossa" - + "ryRequest\032\035.google.longrunning.Operation" - + "\"|\202\323\344\223\002?\"3/v3beta1/{parent=projects/*/lo" - + "cations/*}/glossaries:\010glossary\332A\017parent" - + ",glossary\312A\"\n\010Glossary\022\026CreateGlossaryMe" - + "tadata\022\320\001\n\016ListGlossaries\0227.google.cloud" - + ".translation.v3beta1.ListGlossariesReque" - + "st\0328.google.cloud.translation.v3beta1.Li" - + "stGlossariesResponse\"K\202\323\344\223\0025\0223/v3beta1/{" - + "parent=projects/*/locations/*}/glossarie" - + "s\332A\rparent,filter\022\263\001\n\013GetGlossary\0224.goog" - + "le.cloud.translation.v3beta1.GetGlossary" - + "Request\032*.google.cloud.translation.v3bet" - + "a1.Glossary\"B\202\323\344\223\0025\0223/v3beta1/{name=proj" - + "ects/*/locations/*/glossaries/*}\332A\004name\022" - + "\337\001\n\016DeleteGlossary\0227.google.cloud.transl" - + "ation.v3beta1.DeleteGlossaryRequest\032\035.go" - + "ogle.longrunning.Operation\"u\202\323\344\223\0025*3/v3b" - + "eta1/{name=projects/*/locations/*/glossa" - + "ries/*}\332A\004name\312A0\n\026DeleteGlossaryRespons" - + "e\022\026DeleteGlossaryMetadata\032~\312A\030translate." - + "googleapis.com\322A`https://www.googleapis." - + "com/auth/cloud-platform,https://www.goog" - + "leapis.com/auth/cloud-translationB\361\001\n\"co" - + "m.google.cloud.translate.v3beta1B\027Transl" - + "ationServiceProtoP\001ZGgoogle.golang.org/g" - + "enproto/googleapis/cloud/translate/v3bet" - + "a1;translate\370\001\001\252\002\036Google.Cloud.Translate" - + ".V3Beta1\312\002\036Google\\Cloud\\Translate\\V3beta" - + "1\352\002!Google::Cloud::Translate::V3beta1b\006p" - + "roto3" + + "tRequest.LabelsEntryB\003\340A\001\032-\n\013LabelsEntry" + + "\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\252\001\n\025Tra" + + "nslateTextResponse\022C\n\014translations\030\001 \003(\013" + + "2-.google.cloud.translation.v3beta1.Tran" + + "slation\022L\n\025glossary_translations\030\003 \003(\0132-" + + ".google.cloud.translation.v3beta1.Transl" + + "ation\"\255\001\n\013Translation\022\027\n\017translated_text" + + "\030\001 \001(\t\022\r\n\005model\030\002 \001(\t\022\036\n\026detected_langua" + + "ge_code\030\004 \001(\t\022V\n\017glossary_config\030\003 \001(\0132=" + + ".google.cloud.translation.v3beta1.Transl" + + "ateTextGlossaryConfig\"\244\002\n\025DetectLanguage" + + "Request\0229\n\006parent\030\005 \001(\tB)\340A\002\372A#\n!locatio" + + "ns.googleapis.com/Location\022\022\n\005model\030\004 \001(" + + "\tB\003\340A\001\022\021\n\007content\030\001 \001(\tH\000\022\026\n\tmime_type\030\003" + + " \001(\tB\003\340A\001\022X\n\006labels\030\006 \003(\0132C.google.cloud" + + ".translation.v3beta1.DetectLanguageReque" + + "st.LabelsEntryB\003\340A\001\032-\n\013LabelsEntry\022\013\n\003ke" + + "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\010\n\006source\"=\n\020" + + "DetectedLanguage\022\025\n\rlanguage_code\030\001 \001(\t\022" + + "\022\n\nconfidence\030\002 \001(\002\"_\n\026DetectLanguageRes" + + "ponse\022E\n\tlanguages\030\001 \003(\01322.google.cloud." + + "translation.v3beta1.DetectedLanguage\"\221\001\n" + + "\034GetSupportedLanguagesRequest\0229\n\006parent\030" + + "\003 \001(\tB)\340A\002\372A#\n!locations.googleapis.com/" + + "Location\022\"\n\025display_language_code\030\001 \001(\tB" + + "\003\340A\001\022\022\n\005model\030\002 \001(\tB\003\340A\001\"\\\n\022SupportedLan" + + "guages\022F\n\tlanguages\030\001 \003(\01323.google.cloud" + + ".translation.v3beta1.SupportedLanguage\"p" + + "\n\021SupportedLanguage\022\025\n\rlanguage_code\030\001 \001" + + "(\t\022\024\n\014display_name\030\002 \001(\t\022\026\n\016support_sour" + + "ce\030\003 \001(\010\022\026\n\016support_target\030\004 \001(\010\"#\n\tGcsS" + + "ource\022\026\n\tinput_uri\030\001 \001(\tB\003\340A\002\"r\n\013InputCo" + + "nfig\022\026\n\tmime_type\030\001 \001(\tB\003\340A\001\022A\n\ngcs_sour" + + "ce\030\002 \001(\0132+.google.cloud.translation.v3be" + + "ta1.GcsSourceH\000B\010\n\006source\"0\n\016GcsDestinat" + + "ion\022\036\n\021output_uri_prefix\030\001 \001(\tB\003\340A\002\"j\n\014O" + + "utputConfig\022K\n\017gcs_destination\030\001 \001(\01320.g" + + "oogle.cloud.translation.v3beta1.GcsDesti" + + "nationH\000B\r\n\013destination\"\210\001\n\023DocumentInpu" + + "tConfig\022\021\n\007content\030\001 \001(\014H\000\022A\n\ngcs_source" + + "\030\002 \001(\0132+.google.cloud.translation.v3beta" + + "1.GcsSourceH\000\022\021\n\tmime_type\030\004 \001(\tB\010\n\006sour" + + "ce\"\217\001\n\024DocumentOutputConfig\022P\n\017gcs_desti" + + "nation\030\001 \001(\01320.google.cloud.translation." + + "v3beta1.GcsDestinationB\003\340A\001H\000\022\026\n\tmime_ty" + + "pe\030\003 \001(\tB\003\340A\001B\r\n\013destination\"\252\004\n\030Transla" + + "teDocumentRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022!" + + "\n\024source_language_code\030\002 \001(\tB\003\340A\001\022!\n\024tar" + + "get_language_code\030\003 \001(\tB\003\340A\002\022Y\n\025document" + + "_input_config\030\004 \001(\01325.google.cloud.trans" + + "lation.v3beta1.DocumentInputConfigB\003\340A\002\022" + + "[\n\026document_output_config\030\005 \001(\01326.google" + + ".cloud.translation.v3beta1.DocumentOutpu" + + "tConfigB\003\340A\001\022\022\n\005model\030\006 \001(\tB\003\340A\001\022[\n\017glos" + + "sary_config\030\007 \001(\0132=.google.cloud.transla" + + "tion.v3beta1.TranslateTextGlossaryConfig" + + "B\003\340A\001\022[\n\006labels\030\010 \003(\0132F.google.cloud.tra" + + "nslation.v3beta1.TranslateDocumentReques" + + "t.LabelsEntryB\003\340A\001\032-\n\013LabelsEntry\022\013\n\003key" + + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"e\n\023DocumentTra" + + "nslation\022\033\n\023byte_stream_outputs\030\001 \003(\014\022\021\n" + + "\tmime_type\030\002 \001(\t\022\036\n\026detected_language_co" + + "de\030\003 \001(\t\"\265\002\n\031TranslateDocumentResponse\022S" + + "\n\024document_translation\030\001 \001(\01325.google.cl" + + "oud.translation.v3beta1.DocumentTranslat" + + "ion\022\\\n\035glossary_document_translation\030\002 \001" + + "(\01325.google.cloud.translation.v3beta1.Do" + + "cumentTranslation\022\r\n\005model\030\003 \001(\t\022V\n\017glos" + + "sary_config\030\004 \001(\0132=.google.cloud.transla" + + "tion.v3beta1.TranslateTextGlossaryConfig" + + "\"\246\006\n\031BatchTranslateTextRequest\0229\n\006parent" + + "\030\001 \001(\tB)\340A\002\372A#\n!locations.googleapis.com" + + "/Location\022!\n\024source_language_code\030\002 \001(\tB" + + "\003\340A\002\022\"\n\025target_language_codes\030\003 \003(\tB\003\340A\002" + + "\022\\\n\006models\030\004 \003(\0132G.google.cloud.translat" + + "ion.v3beta1.BatchTranslateTextRequest.Mo" + + "delsEntryB\003\340A\001\022I\n\rinput_configs\030\005 \003(\0132-." + + "google.cloud.translation.v3beta1.InputCo" + + "nfigB\003\340A\002\022J\n\routput_config\030\006 \001(\0132..googl" + + "e.cloud.translation.v3beta1.OutputConfig" + + "B\003\340A\002\022d\n\nglossaries\030\007 \003(\0132K.google.cloud" + + ".translation.v3beta1.BatchTranslateTextR" + + "equest.GlossariesEntryB\003\340A\001\022\\\n\006labels\030\t " + + "\003(\0132G.google.cloud.translation.v3beta1.B" + + "atchTranslateTextRequest.LabelsEntryB\003\340A" + + "\001\032-\n\013ModelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002" + + " \001(\t:\0028\001\032p\n\017GlossariesEntry\022\013\n\003key\030\001 \001(\t" + + "\022L\n\005value\030\002 \001(\0132=.google.cloud.translati" + + "on.v3beta1.TranslateTextGlossaryConfig:\002" + + "8\001\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" + + "\002 \001(\t:\0028\001\"\323\002\n\026BatchTranslateMetadata\022M\n\005" + + "state\030\001 \001(\0162>.google.cloud.translation.v" + + "3beta1.BatchTranslateMetadata.State\022\035\n\025t" + + "ranslated_characters\030\002 \001(\003\022\031\n\021failed_cha" + + "racters\030\003 \001(\003\022\030\n\020total_characters\030\004 \001(\003\022" + + "/\n\013submit_time\030\005 \001(\0132\032.google.protobuf.T" + + "imestamp\"e\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000" + + "\022\013\n\007RUNNING\020\001\022\r\n\tSUCCEEDED\020\002\022\n\n\006FAILED\020\003" + + "\022\016\n\nCANCELLING\020\004\022\r\n\tCANCELLED\020\005\"\313\001\n\026Batc" + + "hTranslateResponse\022\030\n\020total_characters\030\001" + + " \001(\003\022\035\n\025translated_characters\030\002 \001(\003\022\031\n\021f" + + "ailed_characters\030\003 \001(\003\022/\n\013submit_time\030\004 " + + "\001(\0132\032.google.protobuf.Timestamp\022,\n\010end_t" + + "ime\030\005 \001(\0132\032.google.protobuf.Timestamp\"b\n" + + "\023GlossaryInputConfig\022A\n\ngcs_source\030\001 \001(\013" + + "2+.google.cloud.translation.v3beta1.GcsS" + + "ourceH\000B\010\n\006source\"\216\005\n\010Glossary\022\021\n\004name\030\001" + + " \001(\tB\003\340A\002\022T\n\rlanguage_pair\030\003 \001(\0132;.googl" + + "e.cloud.translation.v3beta1.Glossary.Lan" + + "guageCodePairH\000\022Y\n\022language_codes_set\030\004 " + + "\001(\0132;.google.cloud.translation.v3beta1.G" + + "lossary.LanguageCodesSetH\000\022K\n\014input_conf" + + "ig\030\005 \001(\01325.google.cloud.translation.v3be" + + "ta1.GlossaryInputConfig\022\030\n\013entry_count\030\006" + + " \001(\005B\003\340A\003\0224\n\013submit_time\030\007 \001(\0132\032.google." + + "protobuf.TimestampB\003\340A\003\0221\n\010end_time\030\010 \001(" + + "\0132\032.google.protobuf.TimestampB\003\340A\003\032N\n\020La" + + "nguageCodePair\022\034\n\024source_language_code\030\001" + + " \001(\t\022\034\n\024target_language_code\030\002 \001(\t\032*\n\020La" + + "nguageCodesSet\022\026\n\016language_codes\030\001 \003(\t:e" + + "\352Ab\n!translate.googleapis.com/Glossary\022=" + + "projects/{project}/locations/{location}/" + + "glossaries/{glossary}B\013\n\tlanguages\"\225\001\n\025C" + + "reateGlossaryRequest\0229\n\006parent\030\001 \001(\tB)\340A" + + "\002\372A#\n!locations.googleapis.com/Location\022" + + "A\n\010glossary\030\002 \001(\0132*.google.cloud.transla" + + "tion.v3beta1.GlossaryB\003\340A\002\"M\n\022GetGlossar" + + "yRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!translat" + + "e.googleapis.com/Glossary\"P\n\025DeleteGloss" + + "aryRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!transl" + + "ate.googleapis.com/Glossary\"\230\001\n\025ListGlos" + + "sariesRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!l" + + "ocations.googleapis.com/Location\022\026\n\tpage" + + "_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A" + + "\001\022\023\n\006filter\030\004 \001(\tB\003\340A\001\"q\n\026ListGlossaries" + + "Response\022>\n\nglossaries\030\001 \003(\0132*.google.cl" + + "oud.translation.v3beta1.Glossary\022\027\n\017next" + + "_page_token\030\002 \001(\t\"\215\002\n\026CreateGlossaryMeta" + + "data\022\014\n\004name\030\001 \001(\t\022M\n\005state\030\002 \001(\0162>.goog" + + "le.cloud.translation.v3beta1.CreateGloss" + + "aryMetadata.State\022/\n\013submit_time\030\003 \001(\0132\032" + + ".google.protobuf.Timestamp\"e\n\005State\022\025\n\021S" + + "TATE_UNSPECIFIED\020\000\022\013\n\007RUNNING\020\001\022\r\n\tSUCCE" + + "EDED\020\002\022\n\n\006FAILED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCA" + + "NCELLED\020\005\"\215\002\n\026DeleteGlossaryMetadata\022\014\n\004" + + "name\030\001 \001(\t\022M\n\005state\030\002 \001(\0162>.google.cloud" + + ".translation.v3beta1.DeleteGlossaryMetad" + + "ata.State\022/\n\013submit_time\030\003 \001(\0132\032.google." + + "protobuf.Timestamp\"e\n\005State\022\025\n\021STATE_UNS" + + "PECIFIED\020\000\022\013\n\007RUNNING\020\001\022\r\n\tSUCCEEDED\020\002\022\n" + + "\n\006FAILED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCANCELLED\020" + + "\005\"\205\001\n\026DeleteGlossaryResponse\022\014\n\004name\030\001 \001" + + "(\t\022/\n\013submit_time\030\002 \001(\0132\032.google.protobu" + + "f.Timestamp\022,\n\010end_time\030\003 \001(\0132\032.google.p" + + "rotobuf.Timestamp\"\362\006\n\035BatchTranslateDocu" + + "mentRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!loc" + + "ations.googleapis.com/Location\022!\n\024source" + + "_language_code\030\002 \001(\tB\003\340A\002\022\"\n\025target_lang" + + "uage_codes\030\003 \003(\tB\003\340A\002\022V\n\rinput_configs\030\004" + + " \003(\0132:.google.cloud.translation.v3beta1." + + "BatchDocumentInputConfigB\003\340A\002\022W\n\routput_" + + "config\030\005 \001(\0132;.google.cloud.translation." + + "v3beta1.BatchDocumentOutputConfigB\003\340A\002\022`" + + "\n\006models\030\006 \003(\0132K.google.cloud.translatio" + + "n.v3beta1.BatchTranslateDocumentRequest." + + "ModelsEntryB\003\340A\001\022h\n\nglossaries\030\007 \003(\0132O.g" + + "oogle.cloud.translation.v3beta1.BatchTra" + + "nslateDocumentRequest.GlossariesEntryB\003\340" + + "A\001\022w\n\022format_conversions\030\010 \003(\0132V.google." + + "cloud.translation.v3beta1.BatchTranslate" + + "DocumentRequest.FormatConversionsEntryB\003" + + "\340A\001\032-\n\013ModelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" + + "\030\002 \001(\t:\0028\001\032p\n\017GlossariesEntry\022\013\n\003key\030\001 \001" + + "(\t\022L\n\005value\030\002 \001(\0132=.google.cloud.transla" + + "tion.v3beta1.TranslateTextGlossaryConfig" + + ":\0028\001\0328\n\026FormatConversionsEntry\022\013\n\003key\030\001 " + + "\001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"g\n\030BatchDocumentI" + + "nputConfig\022A\n\ngcs_source\030\001 \001(\0132+.google." + + "cloud.translation.v3beta1.GcsSourceH\000B\010\n" + + "\006source\"w\n\031BatchDocumentOutputConfig\022K\n\017" + + "gcs_destination\030\001 \001(\01320.google.cloud.tra" + + "nslation.v3beta1.GcsDestinationH\000B\r\n\013des" + + "tination\"\331\002\n\036BatchTranslateDocumentRespo" + + "nse\022\023\n\013total_pages\030\001 \001(\003\022\030\n\020translated_p" + + "ages\030\002 \001(\003\022\024\n\014failed_pages\030\003 \001(\003\022\034\n\024tota" + + "l_billable_pages\030\004 \001(\003\022\030\n\020total_characte" + + "rs\030\005 \001(\003\022\035\n\025translated_characters\030\006 \001(\003\022" + + "\031\n\021failed_characters\030\007 \001(\003\022!\n\031total_bill" + + "able_characters\030\010 \001(\003\022/\n\013submit_time\030\t \001" + + "(\0132\032.google.protobuf.Timestamp\022,\n\010end_ti" + + "me\030\n \001(\0132\032.google.protobuf.Timestamp\"\351\003\n" + + "\036BatchTranslateDocumentMetadata\022U\n\005state" + + "\030\001 \001(\0162F.google.cloud.translation.v3beta" + + "1.BatchTranslateDocumentMetadata.State\022\023" + + "\n\013total_pages\030\002 \001(\003\022\030\n\020translated_pages\030" + + "\003 \001(\003\022\024\n\014failed_pages\030\004 \001(\003\022\034\n\024total_bil" + + "lable_pages\030\005 \001(\003\022\030\n\020total_characters\030\006 " + + "\001(\003\022\035\n\025translated_characters\030\007 \001(\003\022\031\n\021fa" + + "iled_characters\030\010 \001(\003\022!\n\031total_billable_" + + "characters\030\t \001(\003\022/\n\013submit_time\030\n \001(\0132\032." + + "google.protobuf.Timestamp\"e\n\005State\022\025\n\021ST" + + "ATE_UNSPECIFIED\020\000\022\013\n\007RUNNING\020\001\022\r\n\tSUCCEE" + + "DED\020\002\022\n\n\006FAILED\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCAN" + + "CELLED\020\0052\362\023\n\022TranslationService\022\364\001\n\rTran" + + "slateText\0226.google.cloud.translation.v3b" + + "eta1.TranslateTextRequest\0327.google.cloud" + + ".translation.v3beta1.TranslateTextRespon" + + "se\"r\202\323\344\223\002l\"6/v3beta1/{parent=projects/*/" + + "locations/*}:translateText:\001*Z/\"*/v3beta" + + "1/{parent=projects/*}:translateText:\001*\022\223" + + "\002\n\016DetectLanguage\0227.google.cloud.transla" + + "tion.v3beta1.DetectLanguageRequest\0328.goo" + + "gle.cloud.translation.v3beta1.DetectLang" + + "uageResponse\"\215\001\202\323\344\223\002n\"7/v3beta1/{parent=" + + "projects/*/locations/*}:detectLanguage:\001" + + "*Z0\"+/v3beta1/{parent=projects/*}:detect" + + "Language:\001*\332A\026parent,model,mime_type\022\253\002\n" + + "\025GetSupportedLanguages\022>.google.cloud.tr" + + "anslation.v3beta1.GetSupportedLanguagesR" + + "equest\0324.google.cloud.translation.v3beta" + + "1.SupportedLanguages\"\233\001\202\323\344\223\002p\022;/v3beta1/" + + "{parent=projects/*/locations/*}/supporte" + + "dLanguagesZ1\022//v3beta1/{parent=projects/" + + "*}/supportedLanguages\332A\"parent,display_l" + + "anguage_code,model\022\323\001\n\021TranslateDocument" + + "\022:.google.cloud.translation.v3beta1.Tran" + + "slateDocumentRequest\032;.google.cloud.tran" + + "slation.v3beta1.TranslateDocumentRespons" + + "e\"E\202\323\344\223\002?\":/v3beta1/{parent=projects/*/l" + + "ocations/*}:translateDocument:\001*\022\353\001\n\022Bat" + + "chTranslateText\022;.google.cloud.translati" + + "on.v3beta1.BatchTranslateTextRequest\032\035.g" + + "oogle.longrunning.Operation\"y\202\323\344\223\002@\";/v3" + + "beta1/{parent=projects/*/locations/*}:ba" + + "tchTranslateText:\001*\312A0\n\026BatchTranslateRe" + + "sponse\022\026BatchTranslateMetadata\022\210\002\n\026Batch" + + "TranslateDocument\022?.google.cloud.transla" + + "tion.v3beta1.BatchTranslateDocumentReque" + + "st\032\035.google.longrunning.Operation\"\215\001\202\323\344\223" + + "\002D\"?/v3beta1/{parent=projects/*/location" + + "s/*}:batchTranslateDocument:\001*\312A@\n\036Batch" + + "TranslateDocumentResponse\022\036BatchTranslat" + + "eDocumentMetadata\022\346\001\n\016CreateGlossary\0227.g" + + "oogle.cloud.translation.v3beta1.CreateGl" + + "ossaryRequest\032\035.google.longrunning.Opera" + + "tion\"|\202\323\344\223\002?\"3/v3beta1/{parent=projects/" + + "*/locations/*}/glossaries:\010glossary\332A\017pa" + + "rent,glossary\312A\"\n\010Glossary\022\026CreateGlossa" + + "ryMetadata\022\320\001\n\016ListGlossaries\0227.google.c" + + "loud.translation.v3beta1.ListGlossariesR" + + "equest\0328.google.cloud.translation.v3beta" + + "1.ListGlossariesResponse\"K\202\323\344\223\0025\0223/v3bet" + + "a1/{parent=projects/*/locations/*}/gloss" + + "aries\332A\rparent,filter\022\263\001\n\013GetGlossary\0224." + + "google.cloud.translation.v3beta1.GetGlos" + + "saryRequest\032*.google.cloud.translation.v" + + "3beta1.Glossary\"B\202\323\344\223\0025\0223/v3beta1/{name=" + + "projects/*/locations/*/glossaries/*}\332A\004n" + + "ame\022\337\001\n\016DeleteGlossary\0227.google.cloud.tr" + + "anslation.v3beta1.DeleteGlossaryRequest\032" + + "\035.google.longrunning.Operation\"u\202\323\344\223\0025*3" + + "/v3beta1/{name=projects/*/locations/*/gl" + + "ossaries/*}\332A\004name\312A0\n\026DeleteGlossaryRes" + + "ponse\022\026DeleteGlossaryMetadata\032~\312A\030transl" + + "ate.googleapis.com\322A`https://www.googlea" + + "pis.com/auth/cloud-platform,https://www." + + "googleapis.com/auth/cloud-translationB\361\001" + + "\n\"com.google.cloud.translate.v3beta1B\027Tr" + + "anslationServiceProtoP\001ZGgoogle.golang.o" + + "rg/genproto/googleapis/cloud/translate/v" + + "3beta1;translate\370\001\001\252\002\036Google.Cloud.Trans" + + "late.V3Beta1\312\002\036Google\\Cloud\\Translate\\V3" + + "beta1\352\002!Google::Cloud::Translate::V3beta" + + "1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -523,6 +532,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), }); internal_static_google_cloud_translation_v3beta1_TranslateTextGlossaryConfig_descriptor = getDescriptor().getMessageTypes().get(0); @@ -905,6 +915,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "OutputConfig", "Models", "Glossaries", + "FormatConversions", }); internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_ModelsEntry_descriptor = internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_descriptor @@ -926,6 +937,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_FormatConversionsEntry_descriptor = + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_FormatConversionsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_FormatConversionsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); internal_static_google_cloud_translation_v3beta1_BatchDocumentInputConfig_descriptor = getDescriptor().getMessageTypes().get(33); internal_static_google_cloud_translation_v3beta1_BatchDocumentInputConfig_fieldAccessorTable = @@ -994,6 +1015,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-translate-v3beta1/src/main/proto/google/cloud/location/locations.proto b/proto-google-cloud-translate-v3beta1/src/main/proto/google/cloud/location/locations.proto new file mode 100644 index 00000000..a91766c9 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/proto/google/cloud/location/locations.proto @@ -0,0 +1,108 @@ +// Copyright 2020 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.location; + +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "google/api/client.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/location;location"; +option java_multiple_files = true; +option java_outer_classname = "LocationsProto"; +option java_package = "com.google.cloud.location"; + +// An abstract interface that provides location-related information for +// a service. Service-specific metadata is provided through the +// [Location.metadata][google.cloud.location.Location.metadata] field. +service Locations { + option (google.api.default_host) = "cloud.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists information about the supported locations for this service. + rpc ListLocations(ListLocationsRequest) returns (ListLocationsResponse) { + option (google.api.http) = { + get: "/v1/{name=locations}" + additional_bindings { + get: "/v1/{name=projects/*}/locations" + } + }; + } + + // Gets information about a location. + rpc GetLocation(GetLocationRequest) returns (Location) { + option (google.api.http) = { + get: "/v1/{name=locations/*}" + additional_bindings { + get: "/v1/{name=projects/*/locations/*}" + } + }; + } +} + +// The request message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations]. +message ListLocationsRequest { + // The resource that owns the locations collection, if applicable. + string name = 1; + + // The standard list filter. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + string page_token = 4; +} + +// The response message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations]. +message ListLocationsResponse { + // A list of locations that matches the specified filter in the request. + repeated Location locations = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// The request message for [Locations.GetLocation][google.cloud.location.Locations.GetLocation]. +message GetLocationRequest { + // Resource name for the location. + string name = 1; +} + +// A resource that represents Google Cloud Platform location. +message Location { + // Resource name for the location, which may vary between implementations. + // For example: `"projects/example-project/locations/us-east1"` + string name = 1; + + // The canonical id for this location. For example: `"us-east1"`. + string location_id = 4; + + // The friendly name for this location, typically a nearby city name. + // For example, "Tokyo". + string display_name = 5; + + // Cross-service attributes for the location. For example + // + // {"cloud.googleapis.com/region": "us-east1"} + map labels = 2; + + // Service-specific metadata. For example the available capacity at the given + // location. + google.protobuf.Any metadata = 3; +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/proto/google/cloud/translate/v3beta1/translation_service.proto b/proto-google-cloud-translate-v3beta1/src/main/proto/google/cloud/translate/v3beta1/translation_service.proto index 878af796..03386518 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/proto/google/cloud/translate/v3beta1/translation_service.proto +++ b/proto-google-cloud-translate-v3beta1/src/main/proto/google/cloud/translate/v3beta1/translation_service.proto @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Translate.V3Beta1"; @@ -1241,6 +1242,19 @@ message BatchTranslateDocumentRequest { // Optional. Glossaries to be applied. It's keyed by target language code. map glossaries = 7 [(google.api.field_behavior) = OPTIONAL]; + + // 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 format_conversions = 8 + [(google.api.field_behavior) = OPTIONAL]; } // Input configuration for BatchTranslateDocument request.