From edd06a1df268bfea34a17208f6327c3932db556f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 31 Mar 2021 14:34:02 -0700 Subject: [PATCH] feat: added v3beta1 proto for online and batch document translation (#478) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/4a2226f3-4bc7-46d7-9a62-8b2d1917946d/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 364358156 Source-Link: https://github.com/googleapis/googleapis/commit/d6b4fb337caf6eccb606728ef727ac76364a4f14 --- .../clirr-ignored-differences.xml | 8 +- .../v3beta1/TranslationServiceClient.java | 308 +- .../v3beta1/TranslationServiceSettings.java | 43 + .../translate/v3beta1/gapic_metadata.json | 8 +- .../stub/GrpcTranslationServiceStub.java | 101 + .../v3beta1/stub/TranslationServiceStub.java | 23 + .../stub/TranslationServiceStubSettings.java | 118 + .../v3beta1/MockTranslationServiceImpl.java | 43 + .../v3beta1/TranslationServiceClientTest.java | 236 +- .../v3beta1/TranslationServiceGrpc.java | 273 +- .../v3beta1/BatchDocumentInputConfig.java | 1028 ++++++ .../BatchDocumentInputConfigOrBuilder.java | 110 + .../v3beta1/BatchDocumentOutputConfig.java | 1287 ++++++++ .../BatchDocumentOutputConfigOrBuilder.java | 174 + .../BatchTranslateDocumentMetadata.java | 1883 +++++++++++ ...tchTranslateDocumentMetadataOrBuilder.java | 196 ++ .../BatchTranslateDocumentRequest.java | 2935 +++++++++++++++++ ...atchTranslateDocumentRequestOrBuilder.java | 446 +++ .../BatchTranslateDocumentResponse.java | 1785 ++++++++++ ...tchTranslateDocumentResponseOrBuilder.java | 212 ++ .../v3beta1/BatchTranslateResponse.java | 48 +- .../BatchTranslateResponseOrBuilder.java | 9 +- .../v3beta1/BatchTranslateTextRequest.java | 148 +- .../BatchTranslateTextRequestOrBuilder.java | 54 +- .../v3beta1/CreateGlossaryMetadata.java | 10 +- .../v3beta1/DeleteGlossaryMetadata.java | 10 +- .../v3beta1/DeleteGlossaryResponse.java | 46 +- .../DeleteGlossaryResponseOrBuilder.java | 9 +- .../v3beta1/DetectLanguageRequest.java | 120 +- .../DetectLanguageRequestOrBuilder.java | 38 +- .../v3beta1/DocumentInputConfig.java | 1223 +++++++ .../v3beta1/DocumentInputConfigOrBuilder.java | 131 + .../v3beta1/DocumentOutputConfig.java | 1496 +++++++++ .../DocumentOutputConfigOrBuilder.java | 209 ++ .../v3beta1/DocumentTranslation.java | 1097 ++++++ .../v3beta1/DocumentTranslationOrBuilder.java | 127 + .../v3beta1/GetSupportedLanguagesRequest.java | 98 +- ...GetSupportedLanguagesRequestOrBuilder.java | 28 +- .../cloud/translate/v3beta1/Glossary.java | 14 +- .../translate/v3beta1/GlossaryOrBuilder.java | 4 +- .../v3beta1/ListGlossariesRequest.java | 105 +- .../ListGlossariesRequestOrBuilder.java | 30 +- .../cloud/translate/v3beta1/OutputConfig.java | 168 +- .../v3beta1/OutputConfigOrBuilder.java | 42 +- .../v3beta1/TranslateDocumentRequest.java | 2712 +++++++++++++++ .../TranslateDocumentRequestOrBuilder.java | 394 +++ .../v3beta1/TranslateDocumentResponse.java | 1595 +++++++++ .../TranslateDocumentResponseOrBuilder.java | 178 + .../v3beta1/TranslateTextRequest.java | 151 +- .../TranslateTextRequestOrBuilder.java | 44 +- .../v3beta1/TranslateTextResponse.java | 92 +- .../TranslateTextResponseOrBuilder.java | 20 +- .../cloud/translate/v3beta1/Translation.java | 49 +- .../v3beta1/TranslationOrBuilder.java | 14 +- .../v3beta1/TranslationServiceProto.java | 636 +++- .../v3beta1/translation_service.proto | 657 +++- synth.metadata | 28 +- 57 files changed, 22090 insertions(+), 961 deletions(-) create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentInputConfig.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentInputConfigOrBuilder.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentOutputConfig.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentOutputConfigOrBuilder.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentMetadata.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentMetadataOrBuilder.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequest.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequestOrBuilder.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentResponse.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentResponseOrBuilder.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentInputConfig.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentInputConfigOrBuilder.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentOutputConfig.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentOutputConfigOrBuilder.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentTranslation.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentTranslationOrBuilder.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentRequest.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentRequestOrBuilder.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentResponse.java create mode 100644 proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentResponseOrBuilder.java diff --git a/google-cloud-translate/clirr-ignored-differences.xml b/google-cloud-translate/clirr-ignored-differences.xml index e2293b7a..c5ae17e1 100644 --- a/google-cloud-translate/clirr-ignored-differences.xml +++ b/google-cloud-translate/clirr-ignored-differences.xml @@ -1,14 +1,10 @@ + 7002 com/google/cloud/translate/v3beta1/TranslationServiceClient - java.lang.String parse*From*Name(java.lang.String) - - - 7002 - com/google/cloud/translate/v3beta1/TranslationServiceClient - java.lang.String format*Name(*) + * listGlossaries*(*) \ No newline at end of file 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 92cdd404..578a9ac1 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 @@ -253,16 +253,17 @@ public final UnaryCallable translat * } * * @param parent Required. Project or location to make a call. Must refer to a caller's project. - *

Format: `projects/{project-id}/locations/{location-id}` or `projects/{project-id}`. - *

For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. - *

Only models within the same region (has same location-id) can be used. Otherwise an - * INVALID_ARGUMENT (400) error is returned. + *

Format: `projects/{project-number-or-id}/locations/{location-id}` or + * `projects/{project-number-or-id}`. + *

For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + *

Only models within the same region, which have the same location-id, can be used. + * Otherwise an INVALID_ARGUMENT (400) error is returned. * @param model Optional. The language detection model to be used. *

Format: - * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` *

Only one language detection model is currently supported: - * `projects/{project-id}/locations/{location-id}/models/language-detection/default`. + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. *

If not specified, the default model is 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". @@ -296,16 +297,17 @@ public final DetectLanguageResponse detectLanguage( * } * * @param parent Required. Project or location to make a call. Must refer to a caller's project. - *

Format: `projects/{project-id}/locations/{location-id}` or `projects/{project-id}`. - *

For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. - *

Only models within the same region (has same location-id) can be used. Otherwise an - * INVALID_ARGUMENT (400) error is returned. + *

Format: `projects/{project-number-or-id}/locations/{location-id}` or + * `projects/{project-number-or-id}`. + *

For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + *

Only models within the same region, which have the same location-id, can be used. + * Otherwise an INVALID_ARGUMENT (400) error is returned. * @param model Optional. The language detection model to be used. *

Format: - * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` *

Only one language detection model is currently supported: - * `projects/{project-id}/locations/{location-id}/models/language-detection/default`. + * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. *

If not specified, the default model is 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". @@ -391,9 +393,10 @@ public final DetectLanguageResponse detectLanguage(DetectLanguageRequest request * } * * @param parent Required. Project or location to make a call. Must refer to a caller's project. - *

Format: `projects/{project-id}` or `projects/{project-id}/locations/{location-id}`. - *

For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. + *

Format: `projects/{project-number-or-id}` or + * `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 AutoML models. *

Only models within the same region (have same location-id) can be used, otherwise an * INVALID_ARGUMENT (400) error is returned. @@ -403,10 +406,10 @@ public final DetectLanguageResponse detectLanguage(DetectLanguageRequest request * @param model Optional. Get supported languages of this model. *

The format depends on model type: *

- AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` *

- General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -439,9 +442,10 @@ public final SupportedLanguages getSupportedLanguages( * } * * @param parent Required. Project or location to make a call. Must refer to a caller's project. - *

Format: `projects/{project-id}` or `projects/{project-id}/locations/{location-id}`. - *

For global calls, use `projects/{project-id}/locations/global` or - * `projects/{project-id}`. + *

Format: `projects/{project-number-or-id}` or + * `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 AutoML models. *

Only models within the same region (have same location-id) can be used, otherwise an * INVALID_ARGUMENT (400) error is returned. @@ -451,10 +455,10 @@ public final SupportedLanguages getSupportedLanguages( * @param model Optional. Get supported languages of this model. *

The format depends on model type: *

- AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` *

- General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -521,6 +525,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 @@ -630,6 +695,118 @@ public final UnaryCallable batchTranslateT return stub.batchTranslateTextCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Translates a large volume of documents 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("parent-995424086")
+   *           .setSourceLanguageCode("sourceLanguageCode1645917472")
+   *           .addAllTargetLanguageCodes(new ArrayList())
+   *           .addAllInputConfigs(new ArrayList())
+   *           .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build())
+   *           .putAllModels(new HashMap())
+   *           .putAllGlossaries(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 documents 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("parent-995424086")
+   *           .setSourceLanguageCode("sourceLanguageCode1645917472")
+   *           .addAllTargetLanguageCodes(new ArrayList())
+   *           .addAllInputConfigs(new ArrayList())
+   *           .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build())
+   *           .putAllModels(new HashMap())
+   *           .putAllGlossaries(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 documents 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("parent-995424086")
+   *           .setSourceLanguageCode("sourceLanguageCode1645917472")
+   *           .addAllTargetLanguageCodes(new ArrayList())
+   *           .addAllInputConfigs(new ArrayList())
+   *           .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build())
+   *           .putAllModels(new HashMap())
+   *           .putAllGlossaries(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 @@ -762,55 +939,6 @@ public final UnaryCallable createGlossaryCalla return stub.createGlossaryCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist. - * - *

Sample code: - * - *

{@code
-   * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Glossary element : translationServiceClient.listGlossaries(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The name of the project from which to list all of the glossaries. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListGlossariesPagedResponse listGlossaries(LocationName parent) { - ListGlossariesRequest request = - ListGlossariesRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listGlossaries(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist. - * - *

Sample code: - * - *

{@code
-   * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
-   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
-   *   for (Glossary element : translationServiceClient.listGlossaries(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The name of the project from which to list all of the glossaries. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListGlossariesPagedResponse listGlossaries(String parent) { - ListGlossariesRequest request = ListGlossariesRequest.newBuilder().setParent(parent).build(); - return listGlossaries(request); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist. @@ -829,9 +957,18 @@ public final ListGlossariesPagedResponse listGlossaries(String parent) { * } * * @param parent Required. The name of the project from which to list all of the glossaries. - * @param filter Optional. Filter specifying constraints of a list operation. Filtering is not - * supported yet, and the parameter currently has no effect. If missing, no filtering is - * performed. + * @param filter Optional. Filter specifying constraints of a list operation. 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListGlossariesPagedResponse listGlossaries(LocationName parent, String filter) { @@ -861,9 +998,18 @@ public final ListGlossariesPagedResponse listGlossaries(LocationName parent, Str * } * * @param parent Required. The name of the project from which to list all of the glossaries. - * @param filter Optional. Filter specifying constraints of a list operation. Filtering is not - * supported yet, and the parameter currently has no effect. If missing, no filtering is - * performed. + * @param filter Optional. Filter specifying constraints of a list operation. 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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListGlossariesPagedResponse listGlossaries(String parent, String filter) { diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceSettings.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceSettings.java index 36012127..a4f77f3a 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceSettings.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceSettings.java @@ -89,6 +89,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(); @@ -102,6 +108,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(); @@ -253,6 +275,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() { @@ -266,6 +294,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/v3beta1/gapic_metadata.json b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/gapic_metadata.json index 51d395b9..e5db2b0a 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/gapic_metadata.json +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/gapic_metadata.json @@ -10,6 +10,9 @@ "grpc": { "libraryClient": "TranslationServiceClient", "rpcs": { + "BatchTranslateDocument": { + "methods": ["batchTranslateDocumentAsync", "batchTranslateDocumentOperationCallable", "batchTranslateDocumentCallable"] + }, "BatchTranslateText": { "methods": ["batchTranslateTextAsync", "batchTranslateTextOperationCallable", "batchTranslateTextCallable"] }, @@ -29,7 +32,10 @@ "methods": ["getSupportedLanguages", "getSupportedLanguages", "getSupportedLanguages", "getSupportedLanguagesCallable"] }, "ListGlossaries": { - "methods": ["listGlossaries", "listGlossaries", "listGlossaries", "listGlossaries", "listGlossaries", "listGlossariesPagedCallable", "listGlossariesCallable"] + "methods": ["listGlossaries", "listGlossaries", "listGlossaries", "listGlossariesPagedCallable", "listGlossariesCallable"] + }, + "TranslateDocument": { + "methods": ["translateDocument", "translateDocumentCallable"] }, "TranslateText": { "methods": ["translateText", "translateTextCallable"] diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/stub/GrpcTranslationServiceStub.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/stub/GrpcTranslationServiceStub.java index 4fb90663..2a7c3f86 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/stub/GrpcTranslationServiceStub.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/stub/GrpcTranslationServiceStub.java @@ -27,6 +27,9 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata; +import com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest; +import com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse; import com.google.cloud.translate.v3beta1.BatchTranslateMetadata; import com.google.cloud.translate.v3beta1.BatchTranslateResponse; import com.google.cloud.translate.v3beta1.BatchTranslateTextRequest; @@ -43,6 +46,8 @@ import com.google.cloud.translate.v3beta1.ListGlossariesRequest; import com.google.cloud.translate.v3beta1.ListGlossariesResponse; import com.google.cloud.translate.v3beta1.SupportedLanguages; +import com.google.cloud.translate.v3beta1.TranslateDocumentRequest; +import com.google.cloud.translate.v3beta1.TranslateDocumentResponse; import com.google.cloud.translate.v3beta1.TranslateTextRequest; import com.google.cloud.translate.v3beta1.TranslateTextResponse; import com.google.common.collect.ImmutableMap; @@ -99,6 +104,18 @@ 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.v3beta1.TranslationService/TranslateDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(TranslateDocumentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TranslateDocumentResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor batchTranslateTextMethodDescriptor = MethodDescriptor.newBuilder() @@ -110,6 +127,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.v3beta1.TranslationService/BatchTranslateDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchTranslateDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor createGlossaryMethodDescriptor = MethodDescriptor.newBuilder() @@ -156,10 +184,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; @@ -257,6 +294,20 @@ public Map extract(GetSupportedLanguagesRequest request) { } }) .build(); + GrpcCallSettings + translateDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(translateDocumentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TranslateDocumentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); GrpcCallSettings batchTranslateTextTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(batchTranslateTextMethodDescriptor) @@ -270,6 +321,20 @@ public Map extract(BatchTranslateTextRequest request) { } }) .build(); + GrpcCallSettings + batchTranslateDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchTranslateDocumentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(BatchTranslateDocumentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); GrpcCallSettings createGlossaryTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createGlossaryMethodDescriptor) @@ -335,6 +400,11 @@ public Map extract(DeleteGlossaryRequest request) { getSupportedLanguagesTransportSettings, settings.getSupportedLanguagesSettings(), clientContext); + this.translateDocumentCallable = + callableFactory.createUnaryCallable( + translateDocumentTransportSettings, + settings.translateDocumentSettings(), + clientContext); this.batchTranslateTextCallable = callableFactory.createUnaryCallable( batchTranslateTextTransportSettings, @@ -346,6 +416,17 @@ public Map extract(DeleteGlossaryRequest request) { 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); @@ -398,6 +479,12 @@ public UnaryCallable detectLangua return getSupportedLanguagesCallable; } + @Override + public UnaryCallable + translateDocumentCallable() { + return translateDocumentCallable; + } + @Override public UnaryCallable batchTranslateTextCallable() { return batchTranslateTextCallable; @@ -410,6 +497,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/v3beta1/stub/TranslationServiceStub.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/stub/TranslationServiceStub.java index 8de15b32..47e6af85 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/stub/TranslationServiceStub.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/stub/TranslationServiceStub.java @@ -22,6 +22,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.v3beta1.BatchTranslateDocumentMetadata; +import com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest; +import com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse; import com.google.cloud.translate.v3beta1.BatchTranslateMetadata; import com.google.cloud.translate.v3beta1.BatchTranslateResponse; import com.google.cloud.translate.v3beta1.BatchTranslateTextRequest; @@ -38,6 +41,8 @@ import com.google.cloud.translate.v3beta1.ListGlossariesRequest; import com.google.cloud.translate.v3beta1.ListGlossariesResponse; import com.google.cloud.translate.v3beta1.SupportedLanguages; +import com.google.cloud.translate.v3beta1.TranslateDocumentRequest; +import com.google.cloud.translate.v3beta1.TranslateDocumentResponse; import com.google.cloud.translate.v3beta1.TranslateTextRequest; import com.google.cloud.translate.v3beta1.TranslateTextResponse; import com.google.longrunning.Operation; @@ -71,6 +76,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() { @@ -82,6 +92,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/v3beta1/stub/TranslationServiceStubSettings.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/stub/TranslationServiceStubSettings.java index 8137daea..a5f61db8 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/stub/TranslationServiceStubSettings.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/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.v3beta1.BatchTranslateDocumentMetadata; +import com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest; +import com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse; import com.google.cloud.translate.v3beta1.BatchTranslateMetadata; import com.google.cloud.translate.v3beta1.BatchTranslateResponse; import com.google.cloud.translate.v3beta1.BatchTranslateTextRequest; @@ -60,6 +63,8 @@ import com.google.cloud.translate.v3beta1.ListGlossariesRequest; import com.google.cloud.translate.v3beta1.ListGlossariesResponse; import com.google.cloud.translate.v3beta1.SupportedLanguages; +import com.google.cloud.translate.v3beta1.TranslateDocumentRequest; +import com.google.cloud.translate.v3beta1.TranslateDocumentResponse; import com.google.cloud.translate.v3beta1.TranslateTextRequest; import com.google.cloud.translate.v3beta1.TranslateTextResponse; import com.google.common.collect.ImmutableList; @@ -121,10 +126,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; @@ -207,6 +221,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; @@ -219,6 +239,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; @@ -326,9 +361,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(); @@ -347,11 +386,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< @@ -419,8 +467,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); @@ -433,7 +484,9 @@ protected Builder(ClientContext clientContext) { translateTextSettings, detectLanguageSettings, getSupportedLanguagesSettings, + translateDocumentSettings, batchTranslateTextSettings, + batchTranslateDocumentSettings, createGlossarySettings, listGlossariesSettings, getGlossarySettings, @@ -447,9 +500,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(); @@ -462,7 +519,9 @@ protected Builder(TranslationServiceStubSettings settings) { translateTextSettings, detectLanguageSettings, getSupportedLanguagesSettings, + translateDocumentSettings, batchTranslateTextSettings, + batchTranslateDocumentSettings, createGlossarySettings, listGlossariesSettings, getGlossarySettings, @@ -496,11 +555,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + builder + .translateDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder .batchTranslateTextSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder + .batchTranslateDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder .createGlossarySettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) @@ -545,6 +614,32 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .batchTranslateDocumentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_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( @@ -630,6 +725,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() { @@ -645,6 +746,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/test/java/com/google/cloud/translate/v3beta1/MockTranslationServiceImpl.java b/google-cloud-translate/src/test/java/com/google/cloud/translate/v3beta1/MockTranslationServiceImpl.java index 952f9654..e5f98b07 100644 --- a/google-cloud-translate/src/test/java/com/google/cloud/translate/v3beta1/MockTranslationServiceImpl.java +++ b/google-cloud-translate/src/test/java/com/google/cloud/translate/v3beta1/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/v3beta1/TranslationServiceClientTest.java b/google-cloud-translate/src/test/java/com/google/cloud/translate/v3beta1/TranslationServiceClientTest.java index 443884d8..a89cc623 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 @@ -327,6 +327,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 = @@ -406,35 +474,56 @@ public void batchTranslateTextExceptionTest() throws Exception { } @Test - public void createGlossaryTest() throws Exception { - Glossary expectedResponse = - Glossary.newBuilder() - .setName(GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]").toString()) - .setInputConfig(GlossaryInputConfig.newBuilder().build()) - .setEntryCount(-811131134) + 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("createGlossaryTest") + .setName("batchTranslateDocumentTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockTranslationService.addResponse(resultOperation); - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - Glossary glossary = Glossary.newBuilder().build(); + BatchTranslateDocumentRequest request = + BatchTranslateDocumentRequest.newBuilder() + .setParent("parent-995424086") + .setSourceLanguageCode("sourceLanguageCode1645917472") + .addAllTargetLanguageCodes(new ArrayList()) + .addAllInputConfigs(new ArrayList()) + .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build()) + .putAllModels(new HashMap()) + .putAllGlossaries(new HashMap()) + .build(); - Glossary actualResponse = client.createGlossaryAsync(parent, glossary).get(); + BatchTranslateDocumentResponse actualResponse = + client.batchTranslateDocumentAsync(request).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockTranslationService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateGlossaryRequest actualRequest = ((CreateGlossaryRequest) actualRequests.get(0)); + BatchTranslateDocumentRequest actualRequest = + ((BatchTranslateDocumentRequest) actualRequests.get(0)); - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(glossary, actualRequest.getGlossary()); + 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.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -442,14 +531,22 @@ public void createGlossaryTest() throws Exception { } @Test - public void createGlossaryExceptionTest() throws Exception { + public void batchTranslateDocumentExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTranslationService.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - Glossary glossary = Glossary.newBuilder().build(); - client.createGlossaryAsync(parent, glossary).get(); + BatchTranslateDocumentRequest request = + BatchTranslateDocumentRequest.newBuilder() + .setParent("parent-995424086") + .setSourceLanguageCode("sourceLanguageCode1645917472") + .addAllTargetLanguageCodes(new ArrayList()) + .addAllInputConfigs(new ArrayList()) + .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build()) + .putAllModels(new HashMap()) + .putAllGlossaries(new HashMap()) + .build(); + client.batchTranslateDocumentAsync(request).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); @@ -459,7 +556,7 @@ public void createGlossaryExceptionTest() throws Exception { } @Test - public void createGlossaryTest2() throws Exception { + public void createGlossaryTest() throws Exception { Glossary expectedResponse = Glossary.newBuilder() .setName(GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]").toString()) @@ -476,7 +573,7 @@ public void createGlossaryTest2() throws Exception { .build(); mockTranslationService.addResponse(resultOperation); - String parent = "parent-995424086"; + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Glossary glossary = Glossary.newBuilder().build(); Glossary actualResponse = client.createGlossaryAsync(parent, glossary).get(); @@ -486,7 +583,7 @@ public void createGlossaryTest2() throws Exception { Assert.assertEquals(1, actualRequests.size()); CreateGlossaryRequest actualRequest = ((CreateGlossaryRequest) actualRequests.get(0)); - Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(glossary, actualRequest.getGlossary()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -495,12 +592,12 @@ public void createGlossaryTest2() throws Exception { } @Test - public void createGlossaryExceptionTest2() throws Exception { + public void createGlossaryExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTranslationService.addException(exception); try { - String parent = "parent-995424086"; + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Glossary glossary = Glossary.newBuilder().build(); client.createGlossaryAsync(parent, glossary).get(); Assert.fail("No exception raised"); @@ -512,73 +609,35 @@ public void createGlossaryExceptionTest2() throws Exception { } @Test - public void listGlossariesTest() throws Exception { - Glossary responsesElement = Glossary.newBuilder().build(); - ListGlossariesResponse expectedResponse = - ListGlossariesResponse.newBuilder() - .setNextPageToken("") - .addAllGlossaries(Arrays.asList(responsesElement)) + public void createGlossaryTest2() throws Exception { + Glossary expectedResponse = + Glossary.newBuilder() + .setName(GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]").toString()) + .setInputConfig(GlossaryInputConfig.newBuilder().build()) + .setEntryCount(-811131134) + .setSubmitTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) .build(); - mockTranslationService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - - ListGlossariesPagedResponse pagedListResponse = client.listGlossaries(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getGlossariesList().get(0), resources.get(0)); - - List actualRequests = mockTranslationService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListGlossariesRequest actualRequest = ((ListGlossariesRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listGlossariesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTranslationService.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listGlossaries(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listGlossariesTest2() throws Exception { - Glossary responsesElement = Glossary.newBuilder().build(); - ListGlossariesResponse expectedResponse = - ListGlossariesResponse.newBuilder() - .setNextPageToken("") - .addAllGlossaries(Arrays.asList(responsesElement)) + Operation resultOperation = + Operation.newBuilder() + .setName("createGlossaryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) .build(); - mockTranslationService.addResponse(expectedResponse); + mockTranslationService.addResponse(resultOperation); String parent = "parent-995424086"; + Glossary glossary = Glossary.newBuilder().build(); - ListGlossariesPagedResponse pagedListResponse = client.listGlossaries(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getGlossariesList().get(0), resources.get(0)); + Glossary actualResponse = client.createGlossaryAsync(parent, glossary).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockTranslationService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListGlossariesRequest actualRequest = ((ListGlossariesRequest) actualRequests.get(0)); + CreateGlossaryRequest actualRequest = ((CreateGlossaryRequest) actualRequests.get(0)); Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(glossary, actualRequest.getGlossary()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -586,21 +645,24 @@ public void listGlossariesTest2() throws Exception { } @Test - public void listGlossariesExceptionTest2() throws Exception { + public void createGlossaryExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTranslationService.addException(exception); try { String parent = "parent-995424086"; - client.listGlossaries(parent); + Glossary glossary = Glossary.newBuilder().build(); + client.createGlossaryAsync(parent, glossary).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. + } 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 listGlossariesTest3() throws Exception { + public void listGlossariesTest() throws Exception { Glossary responsesElement = Glossary.newBuilder().build(); ListGlossariesResponse expectedResponse = ListGlossariesResponse.newBuilder() @@ -632,7 +694,7 @@ public void listGlossariesTest3() throws Exception { } @Test - public void listGlossariesExceptionTest3() throws Exception { + public void listGlossariesExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTranslationService.addException(exception); @@ -647,7 +709,7 @@ public void listGlossariesExceptionTest3() throws Exception { } @Test - public void listGlossariesTest4() throws Exception { + public void listGlossariesTest2() throws Exception { Glossary responsesElement = Glossary.newBuilder().build(); ListGlossariesResponse expectedResponse = ListGlossariesResponse.newBuilder() @@ -679,7 +741,7 @@ public void listGlossariesTest4() throws Exception { } @Test - public void listGlossariesExceptionTest4() throws Exception { + public void listGlossariesExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTranslationService.addException(exception); diff --git a/grpc-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceGrpc.java b/grpc-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceGrpc.java index 296bb37b..f614b687 100644 --- a/grpc-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceGrpc.java +++ b/grpc-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceGrpc.java @@ -178,6 +178,54 @@ private TranslationServiceGrpc() {} return getGetSupportedLanguagesMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.translate.v3beta1.TranslateDocumentRequest, + com.google.cloud.translate.v3beta1.TranslateDocumentResponse> + getTranslateDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TranslateDocument", + requestType = com.google.cloud.translate.v3beta1.TranslateDocumentRequest.class, + responseType = com.google.cloud.translate.v3beta1.TranslateDocumentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.translate.v3beta1.TranslateDocumentRequest, + com.google.cloud.translate.v3beta1.TranslateDocumentResponse> + getTranslateDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.translate.v3beta1.TranslateDocumentRequest, + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.translate.v3beta1.TranslateDocumentResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new TranslationServiceMethodDescriptorSupplier("TranslateDocument")) + .build(); + } + } + } + return getTranslateDocumentMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.translate.v3beta1.BatchTranslateTextRequest, com.google.longrunning.Operation> @@ -226,6 +274,56 @@ private TranslationServiceGrpc() {} return getBatchTranslateTextMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest, + com.google.longrunning.Operation> + getBatchTranslateDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchTranslateDocument", + requestType = com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest, + com.google.longrunning.Operation> + getBatchTranslateDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.CreateGlossaryRequest, com.google.longrunning.Operation> @@ -506,6 +604,21 @@ public void getSupportedLanguages( getGetSupportedLanguagesMethod(), responseObserver); } + /** + * + * + *
+     * Translates documents in synchronous mode.
+     * 
+ */ + public void translateDocument( + com.google.cloud.translate.v3beta1.TranslateDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTranslateDocumentMethod(), responseObserver); + } + /** * * @@ -525,6 +638,25 @@ public void batchTranslateText( getBatchTranslateTextMethod(), responseObserver); } + /** + * + * + *
+     * Translates a large volume of documents 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.v3beta1.BatchTranslateDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchTranslateDocumentMethod(), responseObserver); + } + /** * * @@ -611,12 +743,25 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.translate.v3beta1.GetSupportedLanguagesRequest, com.google.cloud.translate.v3beta1.SupportedLanguages>( this, METHODID_GET_SUPPORTED_LANGUAGES))) + .addMethod( + getTranslateDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.translate.v3beta1.TranslateDocumentRequest, + com.google.cloud.translate.v3beta1.TranslateDocumentResponse>( + this, METHODID_TRANSLATE_DOCUMENT))) .addMethod( getBatchTranslateTextMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< com.google.cloud.translate.v3beta1.BatchTranslateTextRequest, com.google.longrunning.Operation>(this, METHODID_BATCH_TRANSLATE_TEXT))) + .addMethod( + getBatchTranslateDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest, + com.google.longrunning.Operation>(this, METHODID_BATCH_TRANSLATE_DOCUMENT))) .addMethod( getCreateGlossaryMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -716,6 +861,23 @@ public void getSupportedLanguages( responseObserver); } + /** + * + * + *
+     * Translates documents in synchronous mode.
+     * 
+ */ + public void translateDocument( + com.google.cloud.translate.v3beta1.TranslateDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTranslateDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -737,6 +899,27 @@ public void batchTranslateText( responseObserver); } + /** + * + * + *
+     * Translates a large volume of documents 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.v3beta1.BatchTranslateDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchTranslateDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -867,6 +1050,19 @@ public com.google.cloud.translate.v3beta1.SupportedLanguages getSupportedLanguag getChannel(), getGetSupportedLanguagesMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Translates documents in synchronous mode.
+     * 
+ */ + public com.google.cloud.translate.v3beta1.TranslateDocumentResponse translateDocument( + com.google.cloud.translate.v3beta1.TranslateDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTranslateDocumentMethod(), getCallOptions(), request); + } + /** * * @@ -885,6 +1081,24 @@ public com.google.longrunning.Operation batchTranslateText( getChannel(), getBatchTranslateTextMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Translates a large volume of documents 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.v3beta1.BatchTranslateDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchTranslateDocumentMethod(), getCallOptions(), request); + } + /** * * @@ -1005,6 +1219,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.v3beta1.TranslateDocumentResponse> + translateDocument(com.google.cloud.translate.v3beta1.TranslateDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTranslateDocumentMethod(), getCallOptions()), request); + } + /** * * @@ -1023,6 +1251,25 @@ protected TranslationServiceFutureStub build( getChannel().newCall(getBatchTranslateTextMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Translates a large volume of documents 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.v3beta1.BatchTranslateDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBatchTranslateDocumentMethod(), getCallOptions()), request); + } + /** * * @@ -1086,11 +1333,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, @@ -1129,11 +1378,23 @@ 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.v3beta1.TranslateDocumentRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.translate.v3beta1.TranslateDocumentResponse>) + responseObserver); + break; case METHODID_BATCH_TRANSLATE_TEXT: serviceImpl.batchTranslateText( (com.google.cloud.translate.v3beta1.BatchTranslateTextRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_BATCH_TRANSLATE_DOCUMENT: + serviceImpl.batchTranslateDocument( + (com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_CREATE_GLOSSARY: serviceImpl.createGlossary( (com.google.cloud.translate.v3beta1.CreateGlossaryRequest) request, @@ -1224,7 +1485,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/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentInputConfig.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentInputConfig.java new file mode 100644 index 00000000..1c943305 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentInputConfig.java @@ -0,0 +1,1028 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +/** + * + * + *
+ * Input configuration for BatchTranslateDocument request.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3beta1.BatchDocumentInputConfig} + */ +public final class BatchDocumentInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3beta1.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.v3beta1.GcsSource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = ((com.google.cloud.translate.v3beta1.GcsSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.translate.v3beta1.GcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchDocumentInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchDocumentInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.class, + com.google.cloud.translate.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+   * The max file size supported for `.pdf` is 1GB and the max page limit is
+   * 1000 pages.
+   * The max file size supported for all input documents is 1GB.
+   * 
+ * + * .google.cloud.translation.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+   * The max file size supported for `.pdf` is 1GB and the max page limit is
+   * 1000 pages.
+   * The max file size supported for all input documents is 1GB.
+   * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 1; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsSource getGcsSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.translate.v3beta1.GcsSource) source_; + } + return com.google.cloud.translate.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+   * The max file size supported for `.pdf` is 1GB and the max page limit is
+   * 1000 pages.
+   * The max file size supported for all input documents is 1GB.
+   * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 1; + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.translate.v3beta1.GcsSource) source_; + } + return com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.BatchDocumentInputConfig)) { + return super.equals(obj); + } + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig other = + (com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.BatchDocumentInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3beta1.BatchDocumentInputConfig) + com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchDocumentInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchDocumentInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.class, + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder.class); + } + + // Construct using com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchDocumentInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig getDefaultInstanceForType() { + return com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig build() { + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig buildPartial() { + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig result = + new com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentInputConfig) { + return mergeFrom((com.google.cloud.translate.v3beta1.BatchDocumentInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3beta1.BatchDocumentInputConfig other) { + if (other == com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3beta1.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.v3beta1.GcsSource, + com.google.cloud.translate.v3beta1.GcsSource.Builder, + com.google.cloud.translate.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size supported for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size supported for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size supported for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size supported for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 1; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.translate.v3beta1.GcsSource) source_; + } + return com.google.cloud.translate.v3beta1.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.translate.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size supported for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size supported for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource(com.google.cloud.translate.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size supported for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size supported for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource( + com.google.cloud.translate.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size supported for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size supported for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 1; + */ + public Builder mergeGcsSource(com.google.cloud.translate.v3beta1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ != com.google.cloud.translate.v3beta1.GcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.translate.v3beta1.GcsSource.newBuilder( + (com.google.cloud.translate.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size supported for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size supported for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size supported for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size supported for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.translate.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size supported for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size supported for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 1; + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 1) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.translate.v3beta1.GcsSource) source_; + } + return com.google.cloud.translate.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+     * The max file size supported for `.pdf` is 1GB and the max page limit is
+     * 1000 pages.
+     * The max file size supported for all input documents is 1GB.
+     * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.GcsSource, + com.google.cloud.translate.v3beta1.GcsSource.Builder, + com.google.cloud.translate.v3beta1.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.translate.v3beta1.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.GcsSource, + com.google.cloud.translate.v3beta1.GcsSource.Builder, + com.google.cloud.translate.v3beta1.GcsSourceOrBuilder>( + (com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchDocumentInputConfig) + private static final com.google.cloud.translate.v3beta1.BatchDocumentInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3beta1.BatchDocumentInputConfig(); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentInputConfigOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentInputConfigOrBuilder.java new file mode 100644 index 00000000..87edf042 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +public interface BatchDocumentInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+   * The max file size supported for `.pdf` is 1GB and the max page limit is
+   * 1000 pages.
+   * The max file size supported for all input documents is 1GB.
+   * 
+ * + * .google.cloud.translation.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+   * The max file size supported for `.pdf` is 1GB and the max page limit is
+   * 1000 pages.
+   * The max file size supported for all input documents is 1GB.
+   * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 1; + * + * @return The gcsSource. + */ + com.google.cloud.translate.v3beta1.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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB.
+   * The max file size supported for `.pdf` is 1GB and the max page limit is
+   * 1000 pages.
+   * The max file size supported for all input documents is 1GB.
+   * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 1; + */ + com.google.cloud.translate.v3beta1.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentOutputConfig.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentOutputConfig.java new file mode 100644 index 00000000..207fc95e --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentOutputConfig.java @@ -0,0 +1,1287 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +/** + * + * + *
+ * Output configuration for BatchTranslateDocument request.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3beta1.BatchDocumentOutputConfig} + */ +public final class BatchDocumentOutputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3beta1.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.v3beta1.GcsDestination.Builder subBuilder = null; + if (destinationCase_ == 1) { + subBuilder = + ((com.google.cloud.translate.v3beta1.GcsDestination) destination_).toBuilder(); + } + destination_ = + input.readMessage( + com.google.cloud.translate.v3beta1.GcsDestination.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchDocumentOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchDocumentOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.class, + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsDestination getGcsDestination() { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3beta1.GcsDestination) destination_; + } + return com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1; + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3beta1.GcsDestination) destination_; + } + return com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.BatchDocumentOutputConfig)) { + return super.equals(obj); + } + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig other = + (com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentOutputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentOutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentOutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentOutputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentOutputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.BatchDocumentOutputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3beta1.BatchDocumentOutputConfig) + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchDocumentOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchDocumentOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.class, + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.Builder.class); + } + + // Construct using com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchDocumentOutputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig + getDefaultInstanceForType() { + return com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig build() { + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig buildPartial() { + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig result = + new com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentOutputConfig) { + return mergeFrom((com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig other) { + if (other + == com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentOutputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination, + com.google.cloud.translate.v3beta1.GcsDestination.Builder, + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3beta1.GcsDestination) destination_; + } + return com.google.cloud.translate.v3beta1.GcsDestination.getDefaultInstance(); + } else { + if (destinationCase_ == 1) { + return gcsDestinationBuilder_.getMessage(); + } + return com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination(com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination( + com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1; + */ + public Builder mergeGcsDestination(com.google.cloud.translate.v3beta1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1 + && destination_ + != com.google.cloud.translate.v3beta1.GcsDestination.getDefaultInstance()) { + destination_ = + com.google.cloud.translate.v3beta1.GcsDestination.newBuilder( + (com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1; + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3beta1.GcsDestination) destination_; + } + return com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.GcsDestination, + com.google.cloud.translate.v3beta1.GcsDestination.Builder, + com.google.cloud.translate.v3beta1.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + if (!(destinationCase_ == 1)) { + destination_ = com.google.cloud.translate.v3beta1.GcsDestination.getDefaultInstance(); + } + gcsDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.GcsDestination, + com.google.cloud.translate.v3beta1.GcsDestination.Builder, + com.google.cloud.translate.v3beta1.GcsDestinationOrBuilder>( + (com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentOutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchDocumentOutputConfig) + private static final com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig(); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentOutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentOutputConfigOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentOutputConfigOrBuilder.java new file mode 100644 index 00000000..96d88eb9 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +public interface BatchDocumentOutputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3beta1.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.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1; + */ + com.google.cloud.translate.v3beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); + + public com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.DestinationCase + getDestinationCase(); +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentMetadata.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentMetadata.java new file mode 100644 index 00000000..b44aa671 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentMetadata.java @@ -0,0 +1,1883 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +/** + * + * + *
+ * State metadata for the batch translation operation.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata} + */ +public final class BatchTranslateDocumentMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata.class, + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata.Builder.class); + } + + /** + * + * + *
+   * State of the job.
+   * 
+ * + * Protobuf enum {@code google.cloud.translation.v3beta1.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.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata.State) + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.cloud.translation.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata.State result = + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata.State.valueOf(state_); + return result == null + ? com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata)) { + return super.equals(obj); + } + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata other = + (com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata) + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata.class, + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata + getDefaultInstanceForType() { + return com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata build() { + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata buildPartial() { + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata result = + new com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata) { + return mergeFrom((com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata other) { + if (other + == com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata.State state = 1; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata.State result = + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata.State.valueOf(state_); + return result == null + ? com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State state = 1; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState( + com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.cloud.translation.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata) + private static final com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3beta1.BatchTranslateDocumentMetadata(); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentMetadataOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentMetadataOrBuilder.java new file mode 100644 index 00000000..e59f2142 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +public interface BatchTranslateDocumentMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata.State state = 1; + * + * @return The state. + */ + com.google.cloud.translate.v3beta1.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-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 new file mode 100644 index 00000000..67c19b45 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequest.java @@ -0,0 +1,2935 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +/** + * + * + *
+ * The BatchTranslateDocument request.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3beta1.BatchTranslateDocumentRequest} + */ +public final class BatchTranslateDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3beta1.BatchTranslateDocumentRequest) + BatchTranslateDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchTranslateDocumentRequest.newBuilder() to construct. + private BatchTranslateDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchTranslateDocumentRequest() { + parent_ = ""; + sourceLanguageCode_ = ""; + targetLanguageCodes_ = com.google.protobuf.LazyStringArrayList.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.v3beta1.BatchDocumentInputConfig>(); + mutable_bitField0_ |= 0x00000002; + } + inputConfigs_.add( + input.readMessage( + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.parser(), + extensionRegistry)); + break; + } + case 42: + { + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.Builder subBuilder = + null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = + input.readMessage( + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig> + glossaries__ = + input.readMessage( + GlossariesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + glossaries_.getMutableMap().put(glossaries__.getKey(), glossaries__.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_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(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.class, + com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.Builder.class); + } + + 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]; + * + * @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]; + * + * @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.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getInputConfigsList() { + return inputConfigs_; + } + /** + * + * + *
+   * Required. Input configurations.
+   * The total number of files matched should be <= 100.
+   * The total content size to translate should be <= 100M Unicode codepoints.
+   * The files must use UTF-8 encoding.
+   * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder> + getInputConfigsOrBuilderList() { + return inputConfigs_; + } + /** + * + * + *
+   * Required. Input configurations.
+   * The total number of files matched should be <= 100.
+   * The total content size to translate should be <= 100M Unicode codepoints.
+   * The files must use UTF-8 encoding.
+   * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getInputConfigsCount() { + return inputConfigs_.size(); + } + /** + * + * + *
+   * Required. Input configurations.
+   * The total number of files matched should be <= 100.
+   * The total content size to translate should be <= 100M Unicode codepoints.
+   * The files must use UTF-8 encoding.
+   * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig getInputConfigs(int index) { + return inputConfigs_.get(index); + } + /** + * + * + *
+   * Required. Input configurations.
+   * The total number of files matched should be <= 100.
+   * The total content size to translate should be <= 100M Unicode codepoints.
+   * The files must use UTF-8 encoding.
+   * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder + getInputConfigsOrBuilder(int index) { + return inputConfigs_.get(index); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 5; + private com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig outputConfig_; + /** + * + * + *
+   * Required. Output configuration.
+   * If 2 input configs match to the same file (that is, same input path),
+   * we don't generate output for duplicate inputs.
+   * 
+ * + * + * .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return 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.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * Required. Output configuration.
+   * If 2 input configs match to the same file (that is, same input path),
+   * we don't generate output for duplicate inputs.
+   * 
+ * + * + * .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchDocumentOutputConfigOrBuilder + getOutputConfigOrBuilder() { + return 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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_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`,
+   *   `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.
+   * 
+ * + * 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`,
+   *   `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.
+   * 
+ * + * 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`,
+   *   `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.
+   * 
+ * + * 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`,
+   *   `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.
+   * 
+ * + * 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.v3beta1.TranslateTextGlossaryConfig> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_GlossariesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig + .getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig> + glossaries_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig> + internalGetGlossaries() { + if (glossaries_ == null) { + return com.google.protobuf.MapField.emptyMapField(GlossariesDefaultEntryHolder.defaultEntry); + } + return glossaries_; + } + + public int getGlossariesCount() { + return internalGetGlossaries().getMap().size(); + } + /** + * + * + *
+   * Optional. Glossaries to be applied. It's keyed by target language code.
+   * 
+ * + * + * map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsGlossaries(java.lang.String key) { + if (key == null) { + throw new 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.v3beta1.TranslateTextGlossaryConfig> + getGlossaries() { + return getGlossariesMap(); + } + /** + * + * + *
+   * Optional. Glossaries to be applied. It's keyed by target language code.
+   * 
+ * + * + * map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig> + getGlossariesMap() { + return internalGetGlossaries().getMap(); + } + /** + * + * + *
+   * Optional. Glossaries to be applied. It's keyed by target language code.
+   * 
+ * + * + * map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossariesOrDefault( + java.lang.String key, + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossariesOrThrow( + java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map + map = internalGetGlossaries().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); + 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.v3beta1.TranslateTextGlossaryConfig> + entry : internalGetGlossaries().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig> + glossaries__ = + GlossariesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, glossaries__); + } + 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.v3beta1.BatchTranslateDocumentRequest)) { + return super.equals(obj); + } + com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest other = + (com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getSourceLanguageCode().equals(other.getSourceLanguageCode())) return false; + if (!getTargetLanguageCodesList().equals(other.getTargetLanguageCodesList())) return false; + if (!getInputConfigsList().equals(other.getInputConfigsList())) return false; + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig().equals(other.getOutputConfig())) return false; + } + if (!internalGetModels().equals(other.internalGetModels())) return false; + if (!internalGetGlossaries().equals(other.internalGetGlossaries())) return false; + if (!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(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The BatchTranslateDocument request.
+   * 
+ * + * Protobuf type {@code google.cloud.translation.v3beta1.BatchTranslateDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3beta1.BatchTranslateDocumentRequest) + com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetModels(); + case 7: + return internalGetGlossaries(); + 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(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.class, + com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.Builder.class); + } + + // Construct using com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInputConfigsFieldBuilder(); + } + } + + @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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest + getDefaultInstanceForType() { + return com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest build() { + com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest buildPartial() { + com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest result = + new com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest(this); + 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(); + 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.v3beta1.BatchTranslateDocumentRequest) { + return mergeFrom((com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest other) { + if (other + == com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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()); + 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.v3beta1.BatchTranslateDocumentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3beta1.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]; + * + * @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]; + * + * @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]; + * + * @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]; + * + * @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]; + * + * @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.v3beta1.BatchDocumentInputConfig, + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder, + com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder> + inputConfigsBuilder_; + + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getInputConfigsList() { + if (inputConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(inputConfigs_); + } else { + return inputConfigsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getInputConfigsCount() { + if (inputConfigsBuilder_ == null) { + return inputConfigs_.size(); + } else { + return inputConfigsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig getInputConfigs(int index) { + if (inputConfigsBuilder_ == null) { + return inputConfigs_.get(index); + } else { + return inputConfigsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfigs( + int index, com.google.cloud.translate.v3beta1.BatchDocumentInputConfig value) { + if (inputConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputConfigsIsMutable(); + inputConfigs_.set(index, value); + onChanged(); + } else { + inputConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfigs( + int index, + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder builderForValue) { + if (inputConfigsBuilder_ == null) { + ensureInputConfigsIsMutable(); + inputConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + inputConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInputConfigs( + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig value) { + if (inputConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputConfigsIsMutable(); + inputConfigs_.add(value); + onChanged(); + } else { + inputConfigsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInputConfigs( + int index, com.google.cloud.translate.v3beta1.BatchDocumentInputConfig value) { + if (inputConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputConfigsIsMutable(); + inputConfigs_.add(index, value); + onChanged(); + } else { + inputConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInputConfigs( + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder builderForValue) { + if (inputConfigsBuilder_ == null) { + ensureInputConfigsIsMutable(); + inputConfigs_.add(builderForValue.build()); + onChanged(); + } else { + inputConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInputConfigs( + int index, + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder builderForValue) { + if (inputConfigsBuilder_ == null) { + ensureInputConfigsIsMutable(); + inputConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + inputConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllInputConfigs( + java.lang.Iterable + values) { + if (inputConfigsBuilder_ == null) { + ensureInputConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, inputConfigs_); + onChanged(); + } else { + inputConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInputConfigs() { + if (inputConfigsBuilder_ == null) { + inputConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~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.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeInputConfigs(int index) { + if (inputConfigsBuilder_ == null) { + ensureInputConfigsIsMutable(); + inputConfigs_.remove(index); + onChanged(); + } else { + inputConfigsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder + getInputConfigsBuilder(int index) { + return getInputConfigsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder + getInputConfigsOrBuilder(int index) { + if (inputConfigsBuilder_ == null) { + return inputConfigs_.get(index); + } else { + return inputConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder> + getInputConfigsOrBuilderList() { + if (inputConfigsBuilder_ != null) { + return inputConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(inputConfigs_); + } + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder + addInputConfigsBuilder() { + return getInputConfigsFieldBuilder() + .addBuilder( + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder + addInputConfigsBuilder(int index) { + return getInputConfigsFieldBuilder() + .addBuilder( + index, + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Input configurations.
+     * The total number of files matched should be <= 100.
+     * The total content size to translate should be <= 100M Unicode codepoints.
+     * The files must use UTF-8 encoding.
+     * 
+ * + * + * repeated .google.cloud.translation.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getInputConfigsBuilderList() { + return getInputConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig, + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder, + com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder> + getInputConfigsFieldBuilder() { + if (inputConfigsBuilder_ == null) { + inputConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig, + com.google.cloud.translate.v3beta1.BatchDocumentInputConfig.Builder, + com.google.cloud.translate.v3beta1.BatchDocumentInputConfigOrBuilder>( + inputConfigs_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + inputConfigs_ = null; + } + return inputConfigsBuilder_; + } + + private com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig, + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.Builder, + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * Required. Output configuration.
+     * If 2 input configs match to the same file (that is, same input path),
+     * we don't generate output for duplicate inputs.
+     * 
+ * + * + * .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return 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.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + public com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Output configuration.
+     * If 2 input configs match to the same file (that is, same input path),
+     * we don't generate output for duplicate inputs.
+     * 
+ * + * + * .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOutputConfig( + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + 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.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOutputConfig( + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + 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.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeOutputConfig( + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3beta1.BatchDocumentOutputConfigOrBuilder + getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * Required. Output configuration.
+     * If 2 input configs match to the same file (that is, same input path),
+     * we don't generate output for duplicate inputs.
+     * 
+ * + * + * .google.cloud.translation.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig, + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.Builder, + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig, + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfig.Builder, + com.google.cloud.translate.v3beta1.BatchDocumentOutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + private com.google.protobuf.MapField models_; + + private com.google.protobuf.MapField internalGetModels() { + if (models_ == null) { + return com.google.protobuf.MapField.emptyMapField(ModelsDefaultEntryHolder.defaultEntry); + } + return models_; + } + + private com.google.protobuf.MapField + internalGetMutableModels() { + 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`,
+     *   `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.
+     * 
+ * + * 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`,
+     *   `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.
+     * 
+ * + * 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`,
+     *   `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.
+     * 
+ * + * 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`,
+     *   `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.
+     * 
+ * + * 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`,
+     *   `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.
+     * 
+ * + * 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`,
+     *   `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.
+     * 
+ * + * 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`,
+     *   `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.
+     * 
+ * + * 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.v3beta1.TranslateTextGlossaryConfig> + glossaries_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig> + internalGetGlossaries() { + if (glossaries_ == null) { + return com.google.protobuf.MapField.emptyMapField( + GlossariesDefaultEntryHolder.defaultEntry); + } + return glossaries_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.TranslateTextGlossaryConfig> + getGlossaries() { + return getGlossariesMap(); + } + /** + * + * + *
+     * Optional. Glossaries to be applied. It's keyed by target language code.
+     * 
+ * + * + * map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig> + getGlossariesMap() { + return internalGetGlossaries().getMap(); + } + /** + * + * + *
+     * Optional. Glossaries to be applied. It's keyed by target language code.
+     * 
+ * + * + * map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossariesOrDefault( + java.lang.String key, + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig> + map = internalGetGlossaries().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Glossaries to be applied. It's keyed by target language code.
+     * 
+ * + * + * map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossariesOrThrow( + java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map< + java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig> + 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.v3beta1.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.v3beta1.TranslateTextGlossaryConfig> + getMutableGlossaries() { + return internalGetMutableGlossaries().getMutableMap(); + } + /** + * + * + *
+     * Optional. Glossaries to be applied. It's keyed by target language code.
+     * 
+ * + * + * map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putGlossaries( + java.lang.String key, + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig value) { + if (key == null) { + throw new 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.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllGlossaries( + java.util.Map< + java.lang.String, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig> + values) { + internalGetMutableGlossaries().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.v3beta1.BatchTranslateDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchTranslateDocumentRequest) + private static final com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest(); + } + + public static com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchTranslateDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + 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.v3beta1.BatchTranslateDocumentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} 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 new file mode 100644 index 00000000..ade00cbe --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequestOrBuilder.java @@ -0,0 +1,446 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +public interface BatchTranslateDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3beta1.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]; + * + * @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]; + * + * @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.v3beta1.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.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + com.google.cloud.translate.v3beta1.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.v3beta1.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.translate.v3beta1.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`,
+   *   `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.
+   * 
+ * + * 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`,
+   *   `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.
+   * 
+ * + * 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`,
+   *   `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.
+   * 
+ * + * 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`,
+   *   `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.
+   * 
+ * + * 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`,
+   *   `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.
+   * 
+ * + * 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.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossariesOrDefault( + java.lang.String key, + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig defaultValue); + /** + * + * + *
+   * Optional. Glossaries to be applied. It's keyed by target language code.
+   * 
+ * + * + * map<string, .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossariesOrThrow( + java.lang.String key); +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentResponse.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentResponse.java new file mode 100644 index 00000000..1b8c94ef --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentResponse.java @@ -0,0 +1,1785 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +/** + * + * + *
+ * 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.v3beta1.BatchTranslateDocumentResponse} + */ +public final class BatchTranslateDocumentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse.class, + com.google.cloud.translate.v3beta1.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 a
+   * 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
+   * a 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
+   * a 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.v3beta1.BatchTranslateDocumentResponse)) { + return super.equals(obj); + } + com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse other = + (com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.BatchTranslateDocumentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3beta1.BatchTranslateDocumentResponse) + com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse.class, + com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse.Builder.class); + } + + // Construct using + // com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse + getDefaultInstanceForType() { + return com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse build() { + com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse buildPartial() { + com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse result = + new com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentResponse) { + return mergeFrom((com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse other) { + if (other + == com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3beta1.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 a
+     * 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 a
+     * 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 a
+     * 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
+     * a 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
+     * a 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
+     * a 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
+     * a 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
+     * a 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
+     * a 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.v3beta1.BatchTranslateDocumentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchTranslateDocumentResponse) + private static final com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3beta1.BatchTranslateDocumentResponse(); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.BatchTranslateDocumentResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentResponseOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentResponseOrBuilder.java new file mode 100644 index 00000000..0c29088b --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +public interface BatchTranslateDocumentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3beta1.BatchTranslateDocumentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Total number of pages to translate in all documents. Documents without a
+   * 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
+   * a 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
+   * a 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-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateResponse.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateResponse.java index 927206f6..7de25916 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateResponse.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateResponse.java @@ -22,8 +22,10 @@ * * *
- * Stored in the [google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by
- * BatchTranslateText if at least one sentence is translated successfully.
+ * Stored in the
+ * [google.longrunning.Operation.response][google.longrunning.Operation.response]
+ * field returned by BatchTranslateText if at least one sentence is translated
+ * successfully.
  * 
* * Protobuf type {@code google.cloud.translation.v3beta1.BatchTranslateResponse} @@ -255,7 +257,8 @@ public 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.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
    * 
* * .google.protobuf.Timestamp end_time = 5; @@ -271,7 +274,8 @@ public boolean hasEndTime() { * *
    * The time when the operation is finished and
-   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
    * 
* * .google.protobuf.Timestamp end_time = 5; @@ -287,7 +291,8 @@ public 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.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
    * 
* * .google.protobuf.Timestamp end_time = 5; @@ -507,8 +512,10 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Stored in the [google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by
-   * BatchTranslateText if at least one sentence is translated successfully.
+   * Stored in the
+   * [google.longrunning.Operation.response][google.longrunning.Operation.response]
+   * field returned by BatchTranslateText if at least one sentence is translated
+   * successfully.
    * 
* * Protobuf type {@code google.cloud.translation.v3beta1.BatchTranslateResponse} @@ -1052,7 +1059,8 @@ public 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.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 5; @@ -1067,7 +1075,8 @@ public boolean hasEndTime() { * *
      * The time when the operation is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 5; @@ -1086,7 +1095,8 @@ public 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.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 5; @@ -1109,7 +1119,8 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { * *
      * The time when the operation is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 5; @@ -1129,7 +1140,8 @@ public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) * *
      * The time when the operation is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 5; @@ -1154,7 +1166,8 @@ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { * *
      * The time when the operation is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 5; @@ -1175,7 +1188,8 @@ public Builder clearEndTime() { * *
      * The time when the operation is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 5; @@ -1190,7 +1204,8 @@ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { * *
      * The time when the operation is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 5; @@ -1207,7 +1222,8 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { * *
      * The time when the operation is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 5; diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateResponseOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateResponseOrBuilder.java index 5ad4a445..0f69ba03 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateResponseOrBuilder.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateResponseOrBuilder.java @@ -102,7 +102,8 @@ public interface BatchTranslateResponseOrBuilder * *
    * The time when the operation is finished and
-   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
    * 
* * .google.protobuf.Timestamp end_time = 5; @@ -115,7 +116,8 @@ public interface BatchTranslateResponseOrBuilder * *
    * The time when the operation is finished and
-   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
    * 
* * .google.protobuf.Timestamp end_time = 5; @@ -128,7 +130,8 @@ public interface BatchTranslateResponseOrBuilder * *
    * The time when the operation is finished and
-   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
    * 
* * .google.protobuf.Timestamp end_time = 5; diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateTextRequest.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateTextRequest.java index ea3bd74b..94d1a49a 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateTextRequest.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateTextRequest.java @@ -232,7 +232,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { * *
    * Required. Location to make a call. Must refer to a caller's project.
-   * Format: `projects/{project-id}/locations/{location-id}`.
+   * 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)
@@ -262,7 +262,7 @@ public java.lang.String getParent() {
    *
    * 
    * Required. Location to make a call. Must refer to a caller's project.
-   * Format: `projects/{project-id}/locations/{location-id}`.
+   * 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)
@@ -432,14 +432,14 @@ public int getModelsCount() {
    *
    * 
    * Optional. The models to use for translation. Map's key is target language
-   * code. Map's value is model name. Value can be a built-in general model,
+   * 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-id}/locations/{location-id}/models/{model-id}`
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
    * - General (built-in) models:
-   *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-   *   `projects/{project-id}/locations/{location-id}/models/general/base`
+   *   `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.
    * 
@@ -464,14 +464,14 @@ public java.util.Map getModels() { * *
    * Optional. The models to use for translation. Map's key is target language
-   * code. Map's value is model name. Value can be a built-in general model,
+   * 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-id}/locations/{location-id}/models/{model-id}`
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
    * - General (built-in) models:
-   *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-   *   `projects/{project-id}/locations/{location-id}/models/general/base`
+   *   `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.
    * 
@@ -487,14 +487,14 @@ public java.util.Map getModelsMap() { * *
    * Optional. The models to use for translation. Map's key is target language
-   * code. Map's value is model name. Value can be a built-in general model,
+   * 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-id}/locations/{location-id}/models/{model-id}`
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
    * - General (built-in) models:
-   *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-   *   `projects/{project-id}/locations/{location-id}/models/general/base`
+   *   `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.
    * 
@@ -514,14 +514,14 @@ public java.lang.String getModelsOrDefault(java.lang.String key, java.lang.Strin * *
    * Optional. The models to use for translation. Map's key is target language
-   * code. Map's value is model name. Value can be a built-in general model,
+   * 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-id}/locations/{location-id}/models/{model-id}`
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
    * - General (built-in) models:
-   *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-   *   `projects/{project-id}/locations/{location-id}/models/general/base`
+   *   `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.
    * 
@@ -547,7 +547,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.
    * 
@@ -565,7 +565,7 @@ public java.util.List getInputCo * *
    * 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.
    * 
@@ -584,7 +584,7 @@ public java.util.List getInputCo * *
    * 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.
    * 
@@ -602,7 +602,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.
    * 
@@ -620,7 +620,7 @@ public com.google.cloud.translate.v3beta1.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.
    * 
@@ -1497,7 +1497,7 @@ public Builder mergeFrom( * *
      * Required. Location to make a call. Must refer to a caller's project.
-     * Format: `projects/{project-id}/locations/{location-id}`.
+     * 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)
@@ -1526,7 +1526,7 @@ public java.lang.String getParent() {
      *
      * 
      * Required. Location to make a call. Must refer to a caller's project.
-     * Format: `projects/{project-id}/locations/{location-id}`.
+     * 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)
@@ -1555,7 +1555,7 @@ public com.google.protobuf.ByteString getParentBytes() {
      *
      * 
      * Required. Location to make a call. Must refer to a caller's project.
-     * Format: `projects/{project-id}/locations/{location-id}`.
+     * 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)
@@ -1583,7 +1583,7 @@ public Builder setParent(java.lang.String value) {
      *
      * 
      * Required. Location to make a call. Must refer to a caller's project.
-     * Format: `projects/{project-id}/locations/{location-id}`.
+     * 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)
@@ -1607,7 +1607,7 @@ public Builder clearParent() {
      *
      * 
      * Required. Location to make a call. Must refer to a caller's project.
-     * Format: `projects/{project-id}/locations/{location-id}`.
+     * 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)
@@ -1945,14 +1945,14 @@ public int getModelsCount() {
      *
      * 
      * Optional. The models to use for translation. Map's key is target language
-     * code. Map's value is model name. Value can be a built-in general model,
+     * 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-id}/locations/{location-id}/models/{model-id}`
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
      * - General (built-in) models:
-     *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-     *   `projects/{project-id}/locations/{location-id}/models/general/base`
+     *   `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.
      * 
@@ -1977,14 +1977,14 @@ public java.util.Map getModels() { * *
      * Optional. The models to use for translation. Map's key is target language
-     * code. Map's value is model name. Value can be a built-in general model,
+     * 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-id}/locations/{location-id}/models/{model-id}`
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
      * - General (built-in) models:
-     *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-     *   `projects/{project-id}/locations/{location-id}/models/general/base`
+     *   `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.
      * 
@@ -2000,14 +2000,14 @@ public java.util.Map getModelsMap() { * *
      * Optional. The models to use for translation. Map's key is target language
-     * code. Map's value is model name. Value can be a built-in general model,
+     * 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-id}/locations/{location-id}/models/{model-id}`
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
      * - General (built-in) models:
-     *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-     *   `projects/{project-id}/locations/{location-id}/models/general/base`
+     *   `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.
      * 
@@ -2028,14 +2028,14 @@ public java.lang.String getModelsOrDefault( * *
      * Optional. The models to use for translation. Map's key is target language
-     * code. Map's value is model name. Value can be a built-in general model,
+     * 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-id}/locations/{location-id}/models/{model-id}`
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
      * - General (built-in) models:
-     *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-     *   `projects/{project-id}/locations/{location-id}/models/general/base`
+     *   `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.
      * 
@@ -2063,14 +2063,14 @@ public Builder clearModels() { * *
      * Optional. The models to use for translation. Map's key is target language
-     * code. Map's value is model name. Value can be a built-in general model,
+     * 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-id}/locations/{location-id}/models/{model-id}`
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
      * - General (built-in) models:
-     *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-     *   `projects/{project-id}/locations/{location-id}/models/general/base`
+     *   `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.
      * 
@@ -2094,14 +2094,14 @@ public java.util.Map getMutableModels() { * *
      * Optional. The models to use for translation. Map's key is target language
-     * code. Map's value is model name. Value can be a built-in general model,
+     * 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-id}/locations/{location-id}/models/{model-id}`
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
      * - General (built-in) models:
-     *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-     *   `projects/{project-id}/locations/{location-id}/models/general/base`
+     *   `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.
      * 
@@ -2123,14 +2123,14 @@ public Builder putModels(java.lang.String key, java.lang.String value) { * *
      * Optional. The models to use for translation. Map's key is target language
-     * code. Map's value is model name. Value can be a built-in general model,
+     * 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-id}/locations/{location-id}/models/{model-id}`
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
      * - General (built-in) models:
-     *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-     *   `projects/{project-id}/locations/{location-id}/models/general/base`
+     *   `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.
      * 
@@ -2164,7 +2164,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.
      * 
@@ -2185,7 +2185,7 @@ public java.util.List getInputCo * *
      * 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.
      * 
@@ -2206,7 +2206,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.
      * 
@@ -2227,7 +2227,7 @@ public com.google.cloud.translate.v3beta1.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.
      * 
@@ -2255,7 +2255,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.
      * 
@@ -2280,7 +2280,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.
      * 
@@ -2307,7 +2307,7 @@ public Builder addInputConfigs(com.google.cloud.translate.v3beta1.InputConfig va * *
      * 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.
      * 
@@ -2335,7 +2335,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.
      * 
@@ -2360,7 +2360,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.
      * 
@@ -2385,7 +2385,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.
      * 
@@ -2410,7 +2410,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.
      * 
@@ -2434,7 +2434,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.
      * 
@@ -2458,7 +2458,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.
      * 
@@ -2476,7 +2476,7 @@ public com.google.cloud.translate.v3beta1.InputConfig.Builder getInputConfigsBui * *
      * 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.
      * 
@@ -2498,7 +2498,7 @@ public com.google.cloud.translate.v3beta1.InputConfigOrBuilder getInputConfigsOr * *
      * 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.
      * 
@@ -2520,7 +2520,7 @@ public com.google.cloud.translate.v3beta1.InputConfigOrBuilder getInputConfigsOr * *
      * 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.
      * 
@@ -2538,7 +2538,7 @@ public com.google.cloud.translate.v3beta1.InputConfig.Builder addInputConfigsBui * *
      * 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.
      * 
@@ -2557,7 +2557,7 @@ public com.google.cloud.translate.v3beta1.InputConfig.Builder addInputConfigsBui * *
      * 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.
      * 
diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateTextRequestOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateTextRequestOrBuilder.java index 357e1ab0..8b5ecc1f 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateTextRequestOrBuilder.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateTextRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface BatchTranslateTextRequestOrBuilder * *
    * Required. Location to make a call. Must refer to a caller's project.
-   * Format: `projects/{project-id}/locations/{location-id}`.
+   * 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)
@@ -47,7 +47,7 @@ public interface BatchTranslateTextRequestOrBuilder
    *
    * 
    * Required. Location to make a call. Must refer to a caller's project.
-   * Format: `projects/{project-id}/locations/{location-id}`.
+   * 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)
@@ -147,14 +147,14 @@ public interface BatchTranslateTextRequestOrBuilder
    *
    * 
    * Optional. The models to use for translation. Map's key is target language
-   * code. Map's value is model name. Value can be a built-in general model,
+   * 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-id}/locations/{location-id}/models/{model-id}`
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
    * - General (built-in) models:
-   *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-   *   `projects/{project-id}/locations/{location-id}/models/general/base`
+   *   `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.
    * 
@@ -167,14 +167,14 @@ public interface BatchTranslateTextRequestOrBuilder * *
    * Optional. The models to use for translation. Map's key is target language
-   * code. Map's value is model name. Value can be a built-in general model,
+   * 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-id}/locations/{location-id}/models/{model-id}`
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
    * - General (built-in) models:
-   *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-   *   `projects/{project-id}/locations/{location-id}/models/general/base`
+   *   `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.
    * 
@@ -190,14 +190,14 @@ public interface BatchTranslateTextRequestOrBuilder * *
    * Optional. The models to use for translation. Map's key is target language
-   * code. Map's value is model name. Value can be a built-in general model,
+   * 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-id}/locations/{location-id}/models/{model-id}`
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
    * - General (built-in) models:
-   *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-   *   `projects/{project-id}/locations/{location-id}/models/general/base`
+   *   `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.
    * 
@@ -210,14 +210,14 @@ public interface BatchTranslateTextRequestOrBuilder * *
    * Optional. The models to use for translation. Map's key is target language
-   * code. Map's value is model name. Value can be a built-in general model,
+   * 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-id}/locations/{location-id}/models/{model-id}`
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
    * - General (built-in) models:
-   *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-   *   `projects/{project-id}/locations/{location-id}/models/general/base`
+   *   `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.
    * 
@@ -230,14 +230,14 @@ public interface BatchTranslateTextRequestOrBuilder * *
    * Optional. The models to use for translation. Map's key is target language
-   * code. Map's value is model name. Value can be a built-in general model,
+   * 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-id}/locations/{location-id}/models/{model-id}`
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
    * - General (built-in) models:
-   *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-   *   `projects/{project-id}/locations/{location-id}/models/general/base`
+   *   `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 +251,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 +266,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 +281,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 +296,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 +312,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.
    * 
diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/CreateGlossaryMetadata.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/CreateGlossaryMetadata.java index 12d30800..a5419c1c 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/CreateGlossaryMetadata.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/CreateGlossaryMetadata.java @@ -22,8 +22,9 @@ * * *
- * Stored in the [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by
- * CreateGlossary.
+ * Stored in the
+ * [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata]
+ * field returned by CreateGlossary.
  * 
* * Protobuf type {@code google.cloud.translation.v3beta1.CreateGlossaryMetadata} @@ -686,8 +687,9 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Stored in the [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by
-   * CreateGlossary.
+   * Stored in the
+   * [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata]
+   * field returned by CreateGlossary.
    * 
* * Protobuf type {@code google.cloud.translation.v3beta1.CreateGlossaryMetadata} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DeleteGlossaryMetadata.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DeleteGlossaryMetadata.java index 93c2fa63..5a535324 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DeleteGlossaryMetadata.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DeleteGlossaryMetadata.java @@ -22,8 +22,9 @@ * * *
- * Stored in the [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by
- * DeleteGlossary.
+ * Stored in the
+ * [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata]
+ * field returned by DeleteGlossary.
  * 
* * Protobuf type {@code google.cloud.translation.v3beta1.DeleteGlossaryMetadata} @@ -686,8 +687,9 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Stored in the [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by
-   * DeleteGlossary.
+   * Stored in the
+   * [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata]
+   * field returned by DeleteGlossary.
    * 
* * Protobuf type {@code google.cloud.translation.v3beta1.DeleteGlossaryMetadata} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DeleteGlossaryResponse.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DeleteGlossaryResponse.java index 5b5a83a7..09f53096 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DeleteGlossaryResponse.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DeleteGlossaryResponse.java @@ -22,8 +22,9 @@ * * *
- * Stored in the [google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by
- * DeleteGlossary.
+ * Stored in the
+ * [google.longrunning.Operation.response][google.longrunning.Operation.response]
+ * field returned by DeleteGlossary.
  * 
* * Protobuf type {@code google.cloud.translation.v3beta1.DeleteGlossaryResponse} @@ -244,7 +245,8 @@ public com.google.protobuf.TimestampOrBuilder getSubmitTimeOrBuilder() { * *
    * The time when the glossary deletion is finished and
-   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
    * 
* * .google.protobuf.Timestamp end_time = 3; @@ -260,7 +262,8 @@ public boolean hasEndTime() { * *
    * The time when the glossary deletion is finished and
-   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
    * 
* * .google.protobuf.Timestamp end_time = 3; @@ -276,7 +279,8 @@ public com.google.protobuf.Timestamp getEndTime() { * *
    * The time when the glossary deletion is finished and
-   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
    * 
* * .google.protobuf.Timestamp end_time = 3; @@ -478,8 +482,9 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Stored in the [google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by
-   * DeleteGlossary.
+   * Stored in the
+   * [google.longrunning.Operation.response][google.longrunning.Operation.response]
+   * field returned by DeleteGlossary.
    * 
* * Protobuf type {@code google.cloud.translation.v3beta1.DeleteGlossaryResponse} @@ -962,7 +967,8 @@ public com.google.protobuf.TimestampOrBuilder getSubmitTimeOrBuilder() { * *
      * The time when the glossary deletion is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 3; @@ -977,7 +983,8 @@ public boolean hasEndTime() { * *
      * The time when the glossary deletion is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 3; @@ -996,7 +1003,8 @@ public com.google.protobuf.Timestamp getEndTime() { * *
      * The time when the glossary deletion is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 3; @@ -1019,7 +1027,8 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { * *
      * The time when the glossary deletion is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 3; @@ -1039,7 +1048,8 @@ public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) * *
      * The time when the glossary deletion is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 3; @@ -1064,7 +1074,8 @@ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { * *
      * The time when the glossary deletion is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 3; @@ -1085,7 +1096,8 @@ public Builder clearEndTime() { * *
      * The time when the glossary deletion is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 3; @@ -1100,7 +1112,8 @@ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { * *
      * The time when the glossary deletion is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 3; @@ -1117,7 +1130,8 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { * *
      * The time when the glossary deletion is finished and
-     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+     * set to true.
      * 
* * .google.protobuf.Timestamp end_time = 3; diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DeleteGlossaryResponseOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DeleteGlossaryResponseOrBuilder.java index d36f3168..2309505d 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DeleteGlossaryResponseOrBuilder.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DeleteGlossaryResponseOrBuilder.java @@ -88,7 +88,8 @@ public interface DeleteGlossaryResponseOrBuilder * *
    * The time when the glossary deletion is finished and
-   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
    * 
* * .google.protobuf.Timestamp end_time = 3; @@ -101,7 +102,8 @@ public interface DeleteGlossaryResponseOrBuilder * *
    * The time when the glossary deletion is finished and
-   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
    * 
* * .google.protobuf.Timestamp end_time = 3; @@ -114,7 +116,8 @@ public interface DeleteGlossaryResponseOrBuilder * *
    * The time when the glossary deletion is finished and
-   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
+   * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
+   * set to true.
    * 
* * .google.protobuf.Timestamp end_time = 3; diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DetectLanguageRequest.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DetectLanguageRequest.java index 7b48d739..c237aa25 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DetectLanguageRequest.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DetectLanguageRequest.java @@ -211,11 +211,11 @@ public SourceCase getSourceCase() { *
    * Required. Project or location to make a call. Must refer to a caller's
    * project.
-   * Format: `projects/{project-id}/locations/{location-id}` or
-   * `projects/{project-id}`.
-   * For global calls, use `projects/{project-id}/locations/global` or
-   * `projects/{project-id}`.
-   * Only models within the same region (has same location-id) can be used.
+   * Format: `projects/{project-number-or-id}/locations/{location-id}` or
+   * `projects/{project-number-or-id}`.
+   * For global calls, use `projects/{project-number-or-id}/locations/global` or
+   * `projects/{project-number-or-id}`.
+   * Only models within the same region, which have the same location-id, can be used.
    * Otherwise an INVALID_ARGUMENT (400) error is returned.
    * 
* @@ -243,11 +243,11 @@ public java.lang.String getParent() { *
    * Required. Project or location to make a call. Must refer to a caller's
    * project.
-   * Format: `projects/{project-id}/locations/{location-id}` or
-   * `projects/{project-id}`.
-   * For global calls, use `projects/{project-id}/locations/global` or
-   * `projects/{project-id}`.
-   * Only models within the same region (has same location-id) can be used.
+   * Format: `projects/{project-number-or-id}/locations/{location-id}` or
+   * `projects/{project-number-or-id}`.
+   * For global calls, use `projects/{project-number-or-id}/locations/global` or
+   * `projects/{project-number-or-id}`.
+   * Only models within the same region, which have the same location-id, can be used.
    * Otherwise an INVALID_ARGUMENT (400) error is returned.
    * 
* @@ -278,9 +278,9 @@ public com.google.protobuf.ByteString getParentBytes() { *
    * Optional. The language detection model to be used.
    * Format:
-   * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}`
+   * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
    * Only one language detection model is currently supported:
-   * `projects/{project-id}/locations/{location-id}/models/language-detection/default`.
+   * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
    * If not specified, the default model is used.
    * 
* @@ -306,9 +306,9 @@ public java.lang.String getModel() { *
    * Optional. The language detection model to be used.
    * Format:
-   * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}`
+   * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
    * Only one language detection model is currently supported:
-   * `projects/{project-id}/locations/{location-id}/models/language-detection/default`.
+   * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
    * If not specified, the default model is used.
    * 
* @@ -487,7 +487,7 @@ public int getLabelsCount() { * See https://cloud.google.com/translate/docs/labels for more information. *
* - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ @java.lang.Override public boolean containsLabels(java.lang.String key) { @@ -514,7 +514,7 @@ public java.util.Map getLabels() { * See https://cloud.google.com/translate/docs/labels for more information. *
* - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ @java.lang.Override public java.util.Map getLabelsMap() { @@ -532,7 +532,7 @@ public java.util.Map getLabelsMap() { * See https://cloud.google.com/translate/docs/labels for more information. *
* - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ @java.lang.Override public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { @@ -554,7 +554,7 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin * See https://cloud.google.com/translate/docs/labels for more information. *
* - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ @java.lang.Override public java.lang.String getLabelsOrThrow(java.lang.String key) { @@ -1025,11 +1025,11 @@ public Builder clearSource() { *
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}/locations/{location-id}` or
-     * `projects/{project-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
-     * Only models within the same region (has same location-id) can be used.
+     * Format: `projects/{project-number-or-id}/locations/{location-id}` or
+     * `projects/{project-number-or-id}`.
+     * For global calls, use `projects/{project-number-or-id}/locations/global` or
+     * `projects/{project-number-or-id}`.
+     * Only models within the same region, which have the same location-id, can be used.
      * Otherwise an INVALID_ARGUMENT (400) error is returned.
      * 
* @@ -1056,11 +1056,11 @@ public java.lang.String getParent() { *
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}/locations/{location-id}` or
-     * `projects/{project-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
-     * Only models within the same region (has same location-id) can be used.
+     * Format: `projects/{project-number-or-id}/locations/{location-id}` or
+     * `projects/{project-number-or-id}`.
+     * For global calls, use `projects/{project-number-or-id}/locations/global` or
+     * `projects/{project-number-or-id}`.
+     * Only models within the same region, which have the same location-id, can be used.
      * Otherwise an INVALID_ARGUMENT (400) error is returned.
      * 
* @@ -1087,11 +1087,11 @@ public com.google.protobuf.ByteString getParentBytes() { *
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}/locations/{location-id}` or
-     * `projects/{project-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
-     * Only models within the same region (has same location-id) can be used.
+     * Format: `projects/{project-number-or-id}/locations/{location-id}` or
+     * `projects/{project-number-or-id}`.
+     * For global calls, use `projects/{project-number-or-id}/locations/global` or
+     * `projects/{project-number-or-id}`.
+     * Only models within the same region, which have the same location-id, can be used.
      * Otherwise an INVALID_ARGUMENT (400) error is returned.
      * 
* @@ -1117,11 +1117,11 @@ public Builder setParent(java.lang.String value) { *
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}/locations/{location-id}` or
-     * `projects/{project-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
-     * Only models within the same region (has same location-id) can be used.
+     * Format: `projects/{project-number-or-id}/locations/{location-id}` or
+     * `projects/{project-number-or-id}`.
+     * For global calls, use `projects/{project-number-or-id}/locations/global` or
+     * `projects/{project-number-or-id}`.
+     * Only models within the same region, which have the same location-id, can be used.
      * Otherwise an INVALID_ARGUMENT (400) error is returned.
      * 
* @@ -1143,11 +1143,11 @@ public Builder clearParent() { *
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}/locations/{location-id}` or
-     * `projects/{project-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
-     * Only models within the same region (has same location-id) can be used.
+     * Format: `projects/{project-number-or-id}/locations/{location-id}` or
+     * `projects/{project-number-or-id}`.
+     * For global calls, use `projects/{project-number-or-id}/locations/global` or
+     * `projects/{project-number-or-id}`.
+     * Only models within the same region, which have the same location-id, can be used.
      * Otherwise an INVALID_ARGUMENT (400) error is returned.
      * 
* @@ -1176,9 +1176,9 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { *
      * Optional. The language detection model to be used.
      * Format:
-     * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}`
+     * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
      * Only one language detection model is currently supported:
-     * `projects/{project-id}/locations/{location-id}/models/language-detection/default`.
+     * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
      * If not specified, the default model is used.
      * 
* @@ -1203,9 +1203,9 @@ public java.lang.String getModel() { *
      * Optional. The language detection model to be used.
      * Format:
-     * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}`
+     * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
      * Only one language detection model is currently supported:
-     * `projects/{project-id}/locations/{location-id}/models/language-detection/default`.
+     * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
      * If not specified, the default model is used.
      * 
* @@ -1230,9 +1230,9 @@ public com.google.protobuf.ByteString getModelBytes() { *
      * Optional. The language detection model to be used.
      * Format:
-     * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}`
+     * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
      * Only one language detection model is currently supported:
-     * `projects/{project-id}/locations/{location-id}/models/language-detection/default`.
+     * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
      * If not specified, the default model is used.
      * 
* @@ -1256,9 +1256,9 @@ public Builder setModel(java.lang.String value) { *
      * Optional. The language detection model to be used.
      * Format:
-     * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}`
+     * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
      * Only one language detection model is currently supported:
-     * `projects/{project-id}/locations/{location-id}/models/language-detection/default`.
+     * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
      * If not specified, the default model is used.
      * 
* @@ -1278,9 +1278,9 @@ public Builder clearModel() { *
      * Optional. The language detection model to be used.
      * Format:
-     * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}`
+     * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
      * Only one language detection model is currently supported:
-     * `projects/{project-id}/locations/{location-id}/models/language-detection/default`.
+     * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
      * If not specified, the default model is used.
      * 
* @@ -1582,7 +1582,7 @@ public int getLabelsCount() { * See https://cloud.google.com/translate/docs/labels for more information. *
* - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ @java.lang.Override public boolean containsLabels(java.lang.String key) { @@ -1609,7 +1609,7 @@ public java.util.Map getLabels() { * See https://cloud.google.com/translate/docs/labels for more information. *
* - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ @java.lang.Override public java.util.Map getLabelsMap() { @@ -1627,7 +1627,7 @@ public java.util.Map getLabelsMap() { * See https://cloud.google.com/translate/docs/labels for more information. *
* - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ @java.lang.Override public java.lang.String getLabelsOrDefault( @@ -1650,7 +1650,7 @@ public java.lang.String getLabelsOrDefault( * See https://cloud.google.com/translate/docs/labels for more information. *
* - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ @java.lang.Override public java.lang.String getLabelsOrThrow(java.lang.String key) { @@ -1680,7 +1680,7 @@ public Builder clearLabels() { * See https://cloud.google.com/translate/docs/labels for more information. *
* - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder removeLabels(java.lang.String key) { if (key == null) { @@ -1706,7 +1706,7 @@ public java.util.Map getMutableLabels() { * See https://cloud.google.com/translate/docs/labels for more information. * * - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder putLabels(java.lang.String key, java.lang.String value) { if (key == null) { @@ -1730,7 +1730,7 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { * See https://cloud.google.com/translate/docs/labels for more information. * * - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DetectLanguageRequestOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DetectLanguageRequestOrBuilder.java index 79682372..9a0a6ded 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DetectLanguageRequestOrBuilder.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DetectLanguageRequestOrBuilder.java @@ -29,11 +29,11 @@ public interface DetectLanguageRequestOrBuilder *
    * Required. Project or location to make a call. Must refer to a caller's
    * project.
-   * Format: `projects/{project-id}/locations/{location-id}` or
-   * `projects/{project-id}`.
-   * For global calls, use `projects/{project-id}/locations/global` or
-   * `projects/{project-id}`.
-   * Only models within the same region (has same location-id) can be used.
+   * Format: `projects/{project-number-or-id}/locations/{location-id}` or
+   * `projects/{project-number-or-id}`.
+   * For global calls, use `projects/{project-number-or-id}/locations/global` or
+   * `projects/{project-number-or-id}`.
+   * Only models within the same region, which have the same location-id, can be used.
    * Otherwise an INVALID_ARGUMENT (400) error is returned.
    * 
* @@ -50,11 +50,11 @@ public interface DetectLanguageRequestOrBuilder *
    * Required. Project or location to make a call. Must refer to a caller's
    * project.
-   * Format: `projects/{project-id}/locations/{location-id}` or
-   * `projects/{project-id}`.
-   * For global calls, use `projects/{project-id}/locations/global` or
-   * `projects/{project-id}`.
-   * Only models within the same region (has same location-id) can be used.
+   * Format: `projects/{project-number-or-id}/locations/{location-id}` or
+   * `projects/{project-number-or-id}`.
+   * For global calls, use `projects/{project-number-or-id}/locations/global` or
+   * `projects/{project-number-or-id}`.
+   * Only models within the same region, which have the same location-id, can be used.
    * Otherwise an INVALID_ARGUMENT (400) error is returned.
    * 
* @@ -72,9 +72,9 @@ public interface DetectLanguageRequestOrBuilder *
    * Optional. The language detection model to be used.
    * Format:
-   * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}`
+   * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
    * Only one language detection model is currently supported:
-   * `projects/{project-id}/locations/{location-id}/models/language-detection/default`.
+   * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
    * If not specified, the default model is used.
    * 
* @@ -89,9 +89,9 @@ public interface DetectLanguageRequestOrBuilder *
    * Optional. The language detection model to be used.
    * Format:
-   * `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}`
+   * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
    * Only one language detection model is currently supported:
-   * `projects/{project-id}/locations/{location-id}/models/language-detection/default`.
+   * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
    * If not specified, the default model is used.
    * 
* @@ -177,7 +177,7 @@ public interface DetectLanguageRequestOrBuilder * See https://cloud.google.com/translate/docs/labels for more information. * * - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ int getLabelsCount(); /** @@ -192,7 +192,7 @@ public interface DetectLanguageRequestOrBuilder * See https://cloud.google.com/translate/docs/labels for more information. * * - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ boolean containsLabels(java.lang.String key); /** Use {@link #getLabelsMap()} instead. */ @@ -210,7 +210,7 @@ public interface DetectLanguageRequestOrBuilder * See https://cloud.google.com/translate/docs/labels for more information. * * - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ java.util.Map getLabelsMap(); /** @@ -225,7 +225,7 @@ public interface DetectLanguageRequestOrBuilder * See https://cloud.google.com/translate/docs/labels for more information. * * - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); /** @@ -240,7 +240,7 @@ public interface DetectLanguageRequestOrBuilder * See https://cloud.google.com/translate/docs/labels for more information. * * - * map<string, string> labels = 6; + * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ java.lang.String getLabelsOrThrow(java.lang.String key); diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentInputConfig.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentInputConfig.java new file mode 100644 index 00000000..17e1f527 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentInputConfig.java @@ -0,0 +1,1223 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +/** + * + * + *
+ * A document translation request input config.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3beta1.DocumentInputConfig} + */ +public final class DocumentInputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3beta1.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.v3beta1.GcsSource.Builder subBuilder = null; + if (sourceCase_ == 2) { + subBuilder = ((com.google.cloud.translate.v3beta1.GcsSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.translate.v3beta1.GcsSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.DocumentInputConfig.class, + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsSource getGcsSource() { + if (sourceCase_ == 2) { + return (com.google.cloud.translate.v3beta1.GcsSource) source_; + } + return com.google.cloud.translate.v3beta1.GcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * Google Cloud Storage location. This must be a single file.
+   * For example: gs://example_bucket/example_file.pdf
+   * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 2; + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.cloud.translate.v3beta1.GcsSource) source_; + } + return com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.DocumentInputConfig)) { + return super.equals(obj); + } + com.google.cloud.translate.v3beta1.DocumentInputConfig other = + (com.google.cloud.translate.v3beta1.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.v3beta1.DocumentInputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentInputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentInputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentInputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentInputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.DocumentInputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3beta1.DocumentInputConfig) + com.google.cloud.translate.v3beta1.DocumentInputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentInputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentInputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.DocumentInputConfig.class, + com.google.cloud.translate.v3beta1.DocumentInputConfig.Builder.class); + } + + // Construct using com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentInputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentInputConfig getDefaultInstanceForType() { + return com.google.cloud.translate.v3beta1.DocumentInputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentInputConfig build() { + com.google.cloud.translate.v3beta1.DocumentInputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentInputConfig buildPartial() { + com.google.cloud.translate.v3beta1.DocumentInputConfig result = + new com.google.cloud.translate.v3beta1.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.v3beta1.DocumentInputConfig) { + return mergeFrom((com.google.cloud.translate.v3beta1.DocumentInputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3beta1.DocumentInputConfig other) { + if (other == com.google.cloud.translate.v3beta1.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.v3beta1.DocumentInputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3beta1.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.v3beta1.GcsSource, + com.google.cloud.translate.v3beta1.GcsSource.Builder, + com.google.cloud.translate.v3beta1.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Google Cloud Storage location. This must be a single file.
+     * For example: gs://example_bucket/example_file.pdf
+     * 
+ * + * .google.cloud.translation.v3beta1.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.v3beta1.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.cloud.translate.v3beta1.GcsSource) source_; + } + return com.google.cloud.translate.v3beta1.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.translate.v3beta1.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage location. This must be a single file.
+     * For example: gs://example_bucket/example_file.pdf
+     * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 2; + */ + public Builder setGcsSource(com.google.cloud.translate.v3beta1.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.v3beta1.GcsSource gcs_source = 2; + */ + public Builder setGcsSource( + com.google.cloud.translate.v3beta1.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.v3beta1.GcsSource gcs_source = 2; + */ + public Builder mergeGcsSource(com.google.cloud.translate.v3beta1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 2 + && source_ != com.google.cloud.translate.v3beta1.GcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.translate.v3beta1.GcsSource.newBuilder( + (com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.GcsSource gcs_source = 2; + */ + public com.google.cloud.translate.v3beta1.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.v3beta1.GcsSource gcs_source = 2; + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 2) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.cloud.translate.v3beta1.GcsSource) source_; + } + return com.google.cloud.translate.v3beta1.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Google Cloud Storage location. This must be a single file.
+     * For example: gs://example_bucket/example_file.pdf
+     * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.GcsSource, + com.google.cloud.translate.v3beta1.GcsSource.Builder, + com.google.cloud.translate.v3beta1.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = com.google.cloud.translate.v3beta1.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.GcsSource, + com.google.cloud.translate.v3beta1.GcsSource.Builder, + com.google.cloud.translate.v3beta1.GcsSourceOrBuilder>( + (com.google.cloud.translate.v3beta1.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.v3beta1.DocumentInputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.DocumentInputConfig) + private static final com.google.cloud.translate.v3beta1.DocumentInputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3beta1.DocumentInputConfig(); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentInputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentInputConfigOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentInputConfigOrBuilder.java new file mode 100644 index 00000000..6ec47de4 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +public interface DocumentInputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3beta1.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.v3beta1.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.v3beta1.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + com.google.cloud.translate.v3beta1.GcsSource getGcsSource(); + /** + * + * + *
+   * Google Cloud Storage location. This must be a single file.
+   * For example: gs://example_bucket/example_file.pdf
+   * 
+ * + * .google.cloud.translation.v3beta1.GcsSource gcs_source = 2; + */ + com.google.cloud.translate.v3beta1.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.v3beta1.DocumentInputConfig.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentOutputConfig.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentOutputConfig.java new file mode 100644 index 00000000..2be0d86c --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentOutputConfig.java @@ -0,0 +1,1496 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +/** + * + * + *
+ * A document translation request output config.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3beta1.DocumentOutputConfig} + */ +public final class DocumentOutputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3beta1.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.v3beta1.GcsDestination.Builder subBuilder = null; + if (destinationCase_ == 1) { + subBuilder = + ((com.google.cloud.translate.v3beta1.GcsDestination) destination_).toBuilder(); + } + destination_ = + input.readMessage( + com.google.cloud.translate.v3beta1.GcsDestination.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.DocumentOutputConfig.class, + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsDestination getGcsDestination() { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3beta1.GcsDestination) destination_; + } + return com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3beta1.GcsDestination) destination_; + } + return com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.DocumentOutputConfig)) { + return super.equals(obj); + } + com.google.cloud.translate.v3beta1.DocumentOutputConfig other = + (com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.DocumentOutputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3beta1.DocumentOutputConfig) + com.google.cloud.translate.v3beta1.DocumentOutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.DocumentOutputConfig.class, + com.google.cloud.translate.v3beta1.DocumentOutputConfig.Builder.class); + } + + // Construct using com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentOutputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentOutputConfig getDefaultInstanceForType() { + return com.google.cloud.translate.v3beta1.DocumentOutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentOutputConfig build() { + com.google.cloud.translate.v3beta1.DocumentOutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentOutputConfig buildPartial() { + com.google.cloud.translate.v3beta1.DocumentOutputConfig result = + new com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig) { + return mergeFrom((com.google.cloud.translate.v3beta1.DocumentOutputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3beta1.DocumentOutputConfig other) { + if (other == com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination, + com.google.cloud.translate.v3beta1.GcsDestination.Builder, + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3beta1.GcsDestination) destination_; + } + return com.google.cloud.translate.v3beta1.GcsDestination.getDefaultInstance(); + } else { + if (destinationCase_ == 1) { + return gcsDestinationBuilder_.getMessage(); + } + return com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGcsDestination(com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGcsDestination( + com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeGcsDestination(com.google.cloud.translate.v3beta1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1 + && destination_ + != com.google.cloud.translate.v3beta1.GcsDestination.getDefaultInstance()) { + destination_ = + com.google.cloud.translate.v3beta1.GcsDestination.newBuilder( + (com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 1) { + return (com.google.cloud.translate.v3beta1.GcsDestination) destination_; + } + return com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.GcsDestination, + com.google.cloud.translate.v3beta1.GcsDestination.Builder, + com.google.cloud.translate.v3beta1.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + if (!(destinationCase_ == 1)) { + destination_ = com.google.cloud.translate.v3beta1.GcsDestination.getDefaultInstance(); + } + gcsDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.GcsDestination, + com.google.cloud.translate.v3beta1.GcsDestination.Builder, + com.google.cloud.translate.v3beta1.GcsDestinationOrBuilder>( + (com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.DocumentOutputConfig) + private static final com.google.cloud.translate.v3beta1.DocumentOutputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3beta1.DocumentOutputConfig(); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentOutputConfigOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentOutputConfigOrBuilder.java new file mode 100644 index 00000000..b5f4ac1d --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentOutputConfigOrBuilder.java @@ -0,0 +1,209 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +public interface DocumentOutputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3beta1.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.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The gcsDestination. + */ + com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig.DestinationCase + getDestinationCase(); +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentTranslation.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentTranslation.java new file mode 100644 index 00000000..e39d786c --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentTranslation.java @@ -0,0 +1,1097 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +/** + * + * + *
+ * A translated document message.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3beta1.DocumentTranslation} + */ +public final class DocumentTranslation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentTranslation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentTranslation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.DocumentTranslation.class, + com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation)) { + return super.equals(obj); + } + com.google.cloud.translate.v3beta1.DocumentTranslation other = + (com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.DocumentTranslation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3beta1.DocumentTranslation) + com.google.cloud.translate.v3beta1.DocumentTranslationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentTranslation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentTranslation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.DocumentTranslation.class, + com.google.cloud.translate.v3beta1.DocumentTranslation.Builder.class); + } + + // Construct using com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_DocumentTranslation_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentTranslation getDefaultInstanceForType() { + return com.google.cloud.translate.v3beta1.DocumentTranslation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentTranslation build() { + com.google.cloud.translate.v3beta1.DocumentTranslation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentTranslation buildPartial() { + com.google.cloud.translate.v3beta1.DocumentTranslation result = + new com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation) { + return mergeFrom((com.google.cloud.translate.v3beta1.DocumentTranslation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3beta1.DocumentTranslation other) { + if (other == com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.DocumentTranslation) + private static final com.google.cloud.translate.v3beta1.DocumentTranslation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3beta1.DocumentTranslation(); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentTranslationOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentTranslationOrBuilder.java new file mode 100644 index 00000000..50ac4acb --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +public interface DocumentTranslationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3beta1.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-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GetSupportedLanguagesRequest.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GetSupportedLanguagesRequest.java index ce4c8fd3..82ae8900 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GetSupportedLanguagesRequest.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GetSupportedLanguagesRequest.java @@ -135,10 +135,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { *
    * Required. Project or location to make a call. Must refer to a caller's
    * project.
-   * Format: `projects/{project-id}` or
-   * `projects/{project-id}/locations/{location-id}`.
-   * For global calls, use `projects/{project-id}/locations/global` or
-   * `projects/{project-id}`.
+   * Format: `projects/{project-number-or-id}` or
+   * `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 AutoML models.
    * Only models within the same region (have same location-id) can be used,
    * otherwise an INVALID_ARGUMENT (400) error is returned.
@@ -168,10 +168,10 @@ public java.lang.String getParent() {
    * 
    * Required. Project or location to make a call. Must refer to a caller's
    * project.
-   * Format: `projects/{project-id}` or
-   * `projects/{project-id}/locations/{location-id}`.
-   * For global calls, use `projects/{project-id}/locations/global` or
-   * `projects/{project-id}`.
+   * Format: `projects/{project-number-or-id}` or
+   * `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 AutoML models.
    * Only models within the same region (have same location-id) can be used,
    * otherwise an INVALID_ARGUMENT (400) error is returned.
@@ -258,10 +258,10 @@ public com.google.protobuf.ByteString getDisplayLanguageCodeBytes() {
    * Optional. Get supported languages of this model.
    * The format depends on model type:
    * - AutoML Translation models:
-   *   `projects/{project-id}/locations/{location-id}/models/{model-id}`
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
    * - General (built-in) models:
-   *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-   *   `projects/{project-id}/locations/{location-id}/models/general/base`
+   *   `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.
    * 
@@ -289,10 +289,10 @@ public java.lang.String getModel() { * Optional. Get supported languages of this model. * The format depends on model type: * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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. *
@@ -676,10 +676,10 @@ public Builder mergeFrom( *
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}` or
-     * `projects/{project-id}/locations/{location-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
+     * Format: `projects/{project-number-or-id}` or
+     * `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 AutoML models.
      * Only models within the same region (have same location-id) can be used,
      * otherwise an INVALID_ARGUMENT (400) error is returned.
@@ -708,10 +708,10 @@ public java.lang.String getParent() {
      * 
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}` or
-     * `projects/{project-id}/locations/{location-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
+     * Format: `projects/{project-number-or-id}` or
+     * `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 AutoML models.
      * Only models within the same region (have same location-id) can be used,
      * otherwise an INVALID_ARGUMENT (400) error is returned.
@@ -740,10 +740,10 @@ public com.google.protobuf.ByteString getParentBytes() {
      * 
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}` or
-     * `projects/{project-id}/locations/{location-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
+     * Format: `projects/{project-number-or-id}` or
+     * `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 AutoML models.
      * Only models within the same region (have same location-id) can be used,
      * otherwise an INVALID_ARGUMENT (400) error is returned.
@@ -771,10 +771,10 @@ public Builder setParent(java.lang.String value) {
      * 
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}` or
-     * `projects/{project-id}/locations/{location-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
+     * Format: `projects/{project-number-or-id}` or
+     * `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 AutoML models.
      * Only models within the same region (have same location-id) can be used,
      * otherwise an INVALID_ARGUMENT (400) error is returned.
@@ -798,10 +798,10 @@ public Builder clearParent() {
      * 
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}` or
-     * `projects/{project-id}/locations/{location-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
+     * Format: `projects/{project-number-or-id}` or
+     * `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 AutoML models.
      * Only models within the same region (have same location-id) can be used,
      * otherwise an INVALID_ARGUMENT (400) error is returned.
@@ -949,10 +949,10 @@ public Builder setDisplayLanguageCodeBytes(com.google.protobuf.ByteString value)
      * Optional. Get supported languages of this model.
      * The format depends on model type:
      * - AutoML Translation models:
-     *   `projects/{project-id}/locations/{location-id}/models/{model-id}`
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
      * - General (built-in) models:
-     *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-     *   `projects/{project-id}/locations/{location-id}/models/general/base`
+     *   `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.
      * 
@@ -979,10 +979,10 @@ public java.lang.String getModel() { * Optional. Get supported languages of this model. * The format depends on model type: * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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. *
@@ -1009,10 +1009,10 @@ public com.google.protobuf.ByteString getModelBytes() { * Optional. Get supported languages of this model. * The format depends on model type: * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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. *
@@ -1038,10 +1038,10 @@ public Builder setModel(java.lang.String value) { * Optional. Get supported languages of this model. * The format depends on model type: * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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. *
@@ -1063,10 +1063,10 @@ public Builder clearModel() { * Optional. Get supported languages of this model. * The format depends on model type: * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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. *
diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GetSupportedLanguagesRequestOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GetSupportedLanguagesRequestOrBuilder.java index d4c7bcca..5fed14a8 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GetSupportedLanguagesRequestOrBuilder.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GetSupportedLanguagesRequestOrBuilder.java @@ -29,10 +29,10 @@ public interface GetSupportedLanguagesRequestOrBuilder *
    * Required. Project or location to make a call. Must refer to a caller's
    * project.
-   * Format: `projects/{project-id}` or
-   * `projects/{project-id}/locations/{location-id}`.
-   * For global calls, use `projects/{project-id}/locations/global` or
-   * `projects/{project-id}`.
+   * Format: `projects/{project-number-or-id}` or
+   * `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 AutoML models.
    * Only models within the same region (have same location-id) can be used,
    * otherwise an INVALID_ARGUMENT (400) error is returned.
@@ -51,10 +51,10 @@ public interface GetSupportedLanguagesRequestOrBuilder
    * 
    * Required. Project or location to make a call. Must refer to a caller's
    * project.
-   * Format: `projects/{project-id}` or
-   * `projects/{project-id}/locations/{location-id}`.
-   * For global calls, use `projects/{project-id}/locations/global` or
-   * `projects/{project-id}`.
+   * Format: `projects/{project-number-or-id}` or
+   * `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 AutoML models.
    * Only models within the same region (have same location-id) can be used,
    * otherwise an INVALID_ARGUMENT (400) error is returned.
@@ -104,10 +104,10 @@ public interface GetSupportedLanguagesRequestOrBuilder
    * Optional. Get supported languages of this model.
    * The format depends on model type:
    * - AutoML Translation models:
-   *   `projects/{project-id}/locations/{location-id}/models/{model-id}`
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
    * - General (built-in) models:
-   *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-   *   `projects/{project-id}/locations/{location-id}/models/general/base`
+   *   `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.
    * 
@@ -124,10 +124,10 @@ public interface GetSupportedLanguagesRequestOrBuilder * Optional. Get supported languages of this model. * The format depends on model type: * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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. *
diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/Glossary.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/Glossary.java index adbf75aa..d7868796 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/Glossary.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/Glossary.java @@ -1960,7 +1960,7 @@ public LanguagesCase getLanguagesCase() { * *
    * Required. The resource name of the glossary. Glossary names have the form
-   * `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`.
+   * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.
    * 
* * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -1984,7 +1984,7 @@ public java.lang.String getName() { * *
    * Required. The resource name of the glossary. Glossary names have the form
-   * `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`.
+   * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.
    * 
* * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -2787,7 +2787,7 @@ public Builder clearLanguages() { * *
      * Required. The resource name of the glossary. Glossary names have the form
-     * `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`.
+     * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.
      * 
* * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -2810,7 +2810,7 @@ public java.lang.String getName() { * *
      * Required. The resource name of the glossary. Glossary names have the form
-     * `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`.
+     * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.
      * 
* * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -2833,7 +2833,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
      * Required. The resource name of the glossary. Glossary names have the form
-     * `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`.
+     * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.
      * 
* * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -2855,7 +2855,7 @@ public Builder setName(java.lang.String value) { * *
      * Required. The resource name of the glossary. Glossary names have the form
-     * `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`.
+     * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.
      * 
* * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -2873,7 +2873,7 @@ public Builder clearName() { * *
      * Required. The resource name of the glossary. Glossary names have the form
-     * `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`.
+     * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.
      * 
* * string name = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GlossaryOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GlossaryOrBuilder.java index 7c99a83e..80ef4b59 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GlossaryOrBuilder.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GlossaryOrBuilder.java @@ -28,7 +28,7 @@ public interface GlossaryOrBuilder * *
    * Required. The resource name of the glossary. Glossary names have the form
-   * `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`.
+   * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.
    * 
* * string name = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -41,7 +41,7 @@ public interface GlossaryOrBuilder * *
    * Required. The resource name of the glossary. Glossary names have the form
-   * `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`.
+   * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.
    * 
* * string name = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/ListGlossariesRequest.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/ListGlossariesRequest.java index cc6f9188..1ea16f21 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/ListGlossariesRequest.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/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.
    * 
* @@ -976,7 +1002,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.
      * 
* @@ -1000,7 +1039,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.
      * 
* @@ -1024,7 +1076,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.
      * 
* @@ -1047,7 +1112,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.
      * 
* @@ -1066,7 +1144,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-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/ListGlossariesRequestOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/ListGlossariesRequestOrBuilder.java index ebed1824..c84335be 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/ListGlossariesRequestOrBuilder.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/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-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/OutputConfig.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/OutputConfig.java index 5999bbc1..10814718 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/OutputConfig.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/OutputConfig.java @@ -193,11 +193,15 @@ public DestinationCase getDestinationCase() { * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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 @@ -212,9 +216,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). @@ -224,7 +228,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.v3beta1.GcsDestination gcs_destination = 1; @@ -262,11 +266,15 @@ public boolean hasGcsDestination() { * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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 @@ -281,9 +289,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). @@ -293,7 +301,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.v3beta1.GcsDestination gcs_destination = 1; @@ -334,11 +342,15 @@ public com.google.cloud.translate.v3beta1.GcsDestination getGcsDestination() { * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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 @@ -353,9 +365,9 @@ public com.google.cloud.translate.v3beta1.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). @@ -365,7 +377,7 @@ public com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1; @@ -770,11 +782,15 @@ public Builder clearDestination() { * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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 @@ -789,9 +805,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). @@ -801,7 +817,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.v3beta1.GcsDestination gcs_destination = 1; @@ -839,11 +855,15 @@ public boolean hasGcsDestination() { * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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 @@ -858,9 +878,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). @@ -870,7 +890,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.v3beta1.GcsDestination gcs_destination = 1; @@ -918,11 +938,15 @@ public com.google.cloud.translate.v3beta1.GcsDestination getGcsDestination() { * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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 @@ -937,9 +961,9 @@ public com.google.cloud.translate.v3beta1.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). @@ -949,7 +973,7 @@ public com.google.cloud.translate.v3beta1.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.v3beta1.GcsDestination gcs_destination = 1; @@ -994,11 +1018,15 @@ public Builder setGcsDestination(com.google.cloud.translate.v3beta1.GcsDestinati * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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 @@ -1013,9 +1041,9 @@ public Builder setGcsDestination(com.google.cloud.translate.v3beta1.GcsDestinati * 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). @@ -1025,7 +1053,7 @@ public Builder setGcsDestination(com.google.cloud.translate.v3beta1.GcsDestinati * 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.v3beta1.GcsDestination gcs_destination = 1; @@ -1068,11 +1096,15 @@ public Builder setGcsDestination( * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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 @@ -1087,9 +1119,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). @@ -1099,7 +1131,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.v3beta1.GcsDestination gcs_destination = 1; @@ -1154,11 +1186,15 @@ public Builder mergeGcsDestination(com.google.cloud.translate.v3beta1.GcsDestina * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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 @@ -1173,9 +1209,9 @@ public Builder mergeGcsDestination(com.google.cloud.translate.v3beta1.GcsDestina * 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). @@ -1185,7 +1221,7 @@ public Builder mergeGcsDestination(com.google.cloud.translate.v3beta1.GcsDestina * 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.v3beta1.GcsDestination gcs_destination = 1; @@ -1233,11 +1269,15 @@ public Builder clearGcsDestination() { * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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 @@ -1252,9 +1292,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). @@ -1264,7 +1304,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.v3beta1.GcsDestination gcs_destination = 1; @@ -1299,11 +1339,15 @@ public com.google.cloud.translate.v3beta1.GcsDestination.Builder getGcsDestinati * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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 @@ -1318,9 +1362,9 @@ public com.google.cloud.translate.v3beta1.GcsDestination.Builder getGcsDestinati * 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). @@ -1330,7 +1374,7 @@ public com.google.cloud.translate.v3beta1.GcsDestination.Builder getGcsDestinati * 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.v3beta1.GcsDestination gcs_destination = 1; @@ -1373,11 +1417,15 @@ public com.google.cloud.translate.v3beta1.GcsDestinationOrBuilder getGcsDestinat * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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 @@ -1392,9 +1440,9 @@ public com.google.cloud.translate.v3beta1.GcsDestinationOrBuilder getGcsDestinat * 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). @@ -1404,7 +1452,7 @@ public com.google.cloud.translate.v3beta1.GcsDestinationOrBuilder getGcsDestinat * 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.v3beta1.GcsDestination gcs_destination = 1; diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/OutputConfigOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/OutputConfigOrBuilder.java index 11a887ae..a16d3321 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/OutputConfigOrBuilder.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/OutputConfigOrBuilder.java @@ -50,11 +50,15 @@ public interface OutputConfigOrBuilder * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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.v3beta1.GcsDestination gcs_destination = 1; @@ -116,11 +120,15 @@ public interface OutputConfigOrBuilder * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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.v3beta1.GcsDestination gcs_destination = 1; @@ -182,11 +190,15 @@ public interface OutputConfigOrBuilder * strings if the input_file is tsv. 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 + * changes. Callers should also expect the contents in the input_file are * processed and ready to be consumed (that is, no partial output file is * written). + * Since index.csv will be updated during the process, please make + * sure there is no custom retention policy applied on the output bucket + * that may prevent 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.v3beta1.GcsDestination gcs_destination = 1; diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentRequest.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentRequest.java new file mode 100644 index 00000000..b486cd56 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentRequest.java @@ -0,0 +1,2712 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +/** + * + * + *
+ * A document translation request.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3beta1.TranslateDocumentRequest} + */ +public final class TranslateDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3beta1.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.v3beta1.DocumentInputConfig.Builder subBuilder = null; + if (documentInputConfig_ != null) { + subBuilder = documentInputConfig_.toBuilder(); + } + documentInputConfig_ = + input.readMessage( + com.google.cloud.translate.v3beta1.DocumentInputConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(documentInputConfig_); + documentInputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.cloud.translate.v3beta1.DocumentOutputConfig.Builder subBuilder = null; + if (documentOutputConfig_ != null) { + subBuilder = documentOutputConfig_.toBuilder(); + } + documentOutputConfig_ = + input.readMessage( + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig.Builder subBuilder = + null; + if (glossaryConfig_ != null) { + subBuilder = glossaryConfig_.toBuilder(); + } + glossaryConfig_ = + input.readMessage( + com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.TranslateDocumentRequest.class, + com.google.cloud.translate.v3beta1.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.v3beta1.DocumentInputConfig documentInputConfig_; + /** + * + * + *
+   * Required. Input configurations.
+   * 
+ * + * + * .google.cloud.translation.v3beta1.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.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentInputConfig. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentInputConfig getDocumentInputConfig() { + return documentInputConfig_ == null + ? com.google.cloud.translate.v3beta1.DocumentInputConfig.getDefaultInstance() + : documentInputConfig_; + } + /** + * + * + *
+   * Required. Input configurations.
+   * 
+ * + * + * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentInputConfigOrBuilder + getDocumentInputConfigOrBuilder() { + return getDocumentInputConfig(); + } + + public static final int DOCUMENT_OUTPUT_CONFIG_FIELD_NUMBER = 5; + private com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentOutputConfig. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentOutputConfig getDocumentOutputConfig() { + return documentOutputConfig_ == null + ? com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.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`,
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
+   * 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`,
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
+   * 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.v3beta1.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.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The glossaryConfig. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossaryConfig() { + return glossaryConfig_ == null + ? com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_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.v3beta1.TranslateDocumentRequest)) { + return super.equals(obj); + } + com.google.cloud.translate.v3beta1.TranslateDocumentRequest other = + (com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.TranslateDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3beta1.TranslateDocumentRequest) + com.google.cloud.translate.v3beta1.TranslateDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.TranslateDocumentRequest.class, + com.google.cloud.translate.v3beta1.TranslateDocumentRequest.Builder.class); + } + + // Construct using com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.TranslateDocumentRequest getDefaultInstanceForType() { + return com.google.cloud.translate.v3beta1.TranslateDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.TranslateDocumentRequest build() { + com.google.cloud.translate.v3beta1.TranslateDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.TranslateDocumentRequest buildPartial() { + com.google.cloud.translate.v3beta1.TranslateDocumentRequest result = + new com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest) { + return mergeFrom((com.google.cloud.translate.v3beta1.TranslateDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3beta1.TranslateDocumentRequest other) { + if (other == com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3beta1.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.v3beta1.DocumentInputConfig documentInputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.DocumentInputConfig, + com.google.cloud.translate.v3beta1.DocumentInputConfig.Builder, + com.google.cloud.translate.v3beta1.DocumentInputConfigOrBuilder> + documentInputConfigBuilder_; + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3beta1.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.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentInputConfig. + */ + public com.google.cloud.translate.v3beta1.DocumentInputConfig getDocumentInputConfig() { + if (documentInputConfigBuilder_ == null) { + return documentInputConfig_ == null + ? com.google.cloud.translate.v3beta1.DocumentInputConfig.getDefaultInstance() + : documentInputConfig_; + } else { + return documentInputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocumentInputConfig( + com.google.cloud.translate.v3beta1.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.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocumentInputConfig( + com.google.cloud.translate.v3beta1.DocumentInputConfig.Builder builderForValue) { + if (documentInputConfigBuilder_ == null) { + documentInputConfig_ = builderForValue.build(); + onChanged(); + } else { + documentInputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDocumentInputConfig( + com.google.cloud.translate.v3beta1.DocumentInputConfig value) { + if (documentInputConfigBuilder_ == null) { + if (documentInputConfig_ != null) { + documentInputConfig_ = + com.google.cloud.translate.v3beta1.DocumentInputConfig.newBuilder( + documentInputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + documentInputConfig_ = value; + } + onChanged(); + } else { + documentInputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3beta1.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.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3beta1.DocumentInputConfig.Builder + getDocumentInputConfigBuilder() { + + onChanged(); + return getDocumentInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.translate.v3beta1.DocumentInputConfigOrBuilder + getDocumentInputConfigOrBuilder() { + if (documentInputConfigBuilder_ != null) { + return documentInputConfigBuilder_.getMessageOrBuilder(); + } else { + return documentInputConfig_ == null + ? com.google.cloud.translate.v3beta1.DocumentInputConfig.getDefaultInstance() + : documentInputConfig_; + } + } + /** + * + * + *
+     * Required. Input configurations.
+     * 
+ * + * + * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.DocumentInputConfig, + com.google.cloud.translate.v3beta1.DocumentInputConfig.Builder, + com.google.cloud.translate.v3beta1.DocumentInputConfigOrBuilder> + getDocumentInputConfigFieldBuilder() { + if (documentInputConfigBuilder_ == null) { + documentInputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.DocumentInputConfig, + com.google.cloud.translate.v3beta1.DocumentInputConfig.Builder, + com.google.cloud.translate.v3beta1.DocumentInputConfigOrBuilder>( + getDocumentInputConfig(), getParentForChildren(), isClean()); + documentInputConfig_ = null; + } + return documentInputConfigBuilder_; + } + + private com.google.cloud.translate.v3beta1.DocumentOutputConfig documentOutputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.DocumentOutputConfig, + com.google.cloud.translate.v3beta1.DocumentOutputConfig.Builder, + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentOutputConfig. + */ + public com.google.cloud.translate.v3beta1.DocumentOutputConfig getDocumentOutputConfig() { + if (documentOutputConfigBuilder_ == null) { + return documentOutputConfig_ == null + ? com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentOutputConfig( + com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDocumentOutputConfig( + com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDocumentOutputConfig( + com.google.cloud.translate.v3beta1.DocumentOutputConfig value) { + if (documentOutputConfigBuilder_ == null) { + if (documentOutputConfig_ != null) { + documentOutputConfig_ = + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.translate.v3beta1.DocumentOutputConfigOrBuilder + getDocumentOutputConfigOrBuilder() { + if (documentOutputConfigBuilder_ != null) { + return documentOutputConfigBuilder_.getMessageOrBuilder(); + } else { + return documentOutputConfig_ == null + ? com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.DocumentOutputConfig, + com.google.cloud.translate.v3beta1.DocumentOutputConfig.Builder, + com.google.cloud.translate.v3beta1.DocumentOutputConfigOrBuilder> + getDocumentOutputConfigFieldBuilder() { + if (documentOutputConfigBuilder_ == null) { + documentOutputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.DocumentOutputConfig, + com.google.cloud.translate.v3beta1.DocumentOutputConfig.Builder, + com.google.cloud.translate.v3beta1.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`,
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
+     * 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`,
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
+     * 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`,
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
+     * 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`,
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
+     * 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`,
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
+     * 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.v3beta1.TranslateTextGlossaryConfig glossaryConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig, + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder, + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The glossaryConfig. + */ + public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossaryConfig() { + if (glossaryConfigBuilder_ == null) { + return glossaryConfig_ == null + ? com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGlossaryConfig( + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGlossaryConfig( + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeGlossaryConfig( + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig value) { + if (glossaryConfigBuilder_ == null) { + if (glossaryConfig_ != null) { + glossaryConfig_ = + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder + getGlossaryConfigOrBuilder() { + if (glossaryConfigBuilder_ != null) { + return glossaryConfigBuilder_.getMessageOrBuilder(); + } else { + return glossaryConfig_ == null + ? com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig, + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder, + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder> + getGlossaryConfigFieldBuilder() { + if (glossaryConfigBuilder_ == null) { + glossaryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig, + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder, + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.TranslateDocumentRequest) + private static final com.google.cloud.translate.v3beta1.TranslateDocumentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3beta1.TranslateDocumentRequest(); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentRequestOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentRequestOrBuilder.java new file mode 100644 index 00000000..b1dad9c8 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentRequestOrBuilder.java @@ -0,0 +1,394 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +public interface TranslateDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3beta1.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.v3beta1.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.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The documentInputConfig. + */ + com.google.cloud.translate.v3beta1.DocumentInputConfig getDocumentInputConfig(); + /** + * + * + *
+   * Required. Input configurations.
+   * 
+ * + * + * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The documentOutputConfig. + */ + com.google.cloud.translate.v3beta1.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.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.translate.v3beta1.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`,
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
+   * 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`,
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
+   * 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.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The glossaryConfig. + */ + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.translate.v3beta1.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-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentResponse.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentResponse.java new file mode 100644 index 00000000..135971d6 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentResponse.java @@ -0,0 +1,1595 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +/** + * + * + *
+ * A translated document response message.
+ * 
+ * + * Protobuf type {@code google.cloud.translation.v3beta1.TranslateDocumentResponse} + */ +public final class TranslateDocumentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.translation.v3beta1.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.v3beta1.DocumentTranslation.Builder subBuilder = null; + if (documentTranslation_ != null) { + subBuilder = documentTranslation_.toBuilder(); + } + documentTranslation_ = + input.readMessage( + com.google.cloud.translate.v3beta1.DocumentTranslation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(documentTranslation_); + documentTranslation_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.translate.v3beta1.DocumentTranslation.Builder subBuilder = null; + if (glossaryDocumentTranslation_ != null) { + subBuilder = glossaryDocumentTranslation_.toBuilder(); + } + glossaryDocumentTranslation_ = + input.readMessage( + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig.Builder subBuilder = + null; + if (glossaryConfig_ != null) { + subBuilder = glossaryConfig_.toBuilder(); + } + glossaryConfig_ = + input.readMessage( + com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_TranslateDocumentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_TranslateDocumentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.TranslateDocumentResponse.class, + com.google.cloud.translate.v3beta1.TranslateDocumentResponse.Builder.class); + } + + public static final int DOCUMENT_TRANSLATION_FIELD_NUMBER = 1; + private com.google.cloud.translate.v3beta1.DocumentTranslation documentTranslation_; + /** + * + * + *
+   * Translated document.
+   * 
+ * + * .google.cloud.translation.v3beta1.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.v3beta1.DocumentTranslation document_translation = 1; + * + * @return The documentTranslation. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentTranslation getDocumentTranslation() { + return documentTranslation_ == null + ? com.google.cloud.translate.v3beta1.DocumentTranslation.getDefaultInstance() + : documentTranslation_; + } + /** + * + * + *
+   * Translated document.
+   * 
+ * + * .google.cloud.translation.v3beta1.DocumentTranslation document_translation = 1; + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentTranslationOrBuilder + getDocumentTranslationOrBuilder() { + return getDocumentTranslation(); + } + + public static final int GLOSSARY_DOCUMENT_TRANSLATION_FIELD_NUMBER = 2; + private com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.DocumentTranslation glossary_document_translation = 2; + * + * + * @return The glossaryDocumentTranslation. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.DocumentTranslation getGlossaryDocumentTranslation() { + return glossaryDocumentTranslation_ == null + ? com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation glossary_document_translation = 2; + * + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossaryConfig_; + /** + * + * + *
+   * The `glossary_config` used for this translation.
+   * 
+ * + * .google.cloud.translation.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 4; + * + * @return The glossaryConfig. + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossaryConfig() { + return glossaryConfig_ == null + ? com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.getDefaultInstance() + : glossaryConfig_; + } + /** + * + * + *
+   * The `glossary_config` used for this translation.
+   * 
+ * + * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 4; + */ + @java.lang.Override + public com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentResponse)) { + return super.equals(obj); + } + com.google.cloud.translate.v3beta1.TranslateDocumentResponse other = + (com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.TranslateDocumentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3beta1.TranslateDocumentResponse) + com.google.cloud.translate.v3beta1.TranslateDocumentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_TranslateDocumentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.translate.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_TranslateDocumentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.translate.v3beta1.TranslateDocumentResponse.class, + com.google.cloud.translate.v3beta1.TranslateDocumentResponse.Builder.class); + } + + // Construct using com.google.cloud.translate.v3beta1.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.v3beta1.TranslationServiceProto + .internal_static_google_cloud_translation_v3beta1_TranslateDocumentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.TranslateDocumentResponse + getDefaultInstanceForType() { + return com.google.cloud.translate.v3beta1.TranslateDocumentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.TranslateDocumentResponse build() { + com.google.cloud.translate.v3beta1.TranslateDocumentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.translate.v3beta1.TranslateDocumentResponse buildPartial() { + com.google.cloud.translate.v3beta1.TranslateDocumentResponse result = + new com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentResponse) { + return mergeFrom((com.google.cloud.translate.v3beta1.TranslateDocumentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.translate.v3beta1.TranslateDocumentResponse other) { + if (other + == com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.translate.v3beta1.TranslateDocumentResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.translate.v3beta1.DocumentTranslation documentTranslation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.DocumentTranslation, + com.google.cloud.translate.v3beta1.DocumentTranslation.Builder, + com.google.cloud.translate.v3beta1.DocumentTranslationOrBuilder> + documentTranslationBuilder_; + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3beta1.DocumentTranslation document_translation = 1; + * + * @return Whether the documentTranslation field is set. + */ + public boolean hasDocumentTranslation() { + return documentTranslationBuilder_ != null || documentTranslation_ != null; + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3beta1.DocumentTranslation document_translation = 1; + * + * @return The documentTranslation. + */ + public com.google.cloud.translate.v3beta1.DocumentTranslation getDocumentTranslation() { + if (documentTranslationBuilder_ == null) { + return documentTranslation_ == null + ? com.google.cloud.translate.v3beta1.DocumentTranslation.getDefaultInstance() + : documentTranslation_; + } else { + return documentTranslationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3beta1.DocumentTranslation document_translation = 1; + */ + public Builder setDocumentTranslation( + com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation document_translation = 1; + */ + public Builder setDocumentTranslation( + com.google.cloud.translate.v3beta1.DocumentTranslation.Builder builderForValue) { + if (documentTranslationBuilder_ == null) { + documentTranslation_ = builderForValue.build(); + onChanged(); + } else { + documentTranslationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3beta1.DocumentTranslation document_translation = 1; + */ + public Builder mergeDocumentTranslation( + com.google.cloud.translate.v3beta1.DocumentTranslation value) { + if (documentTranslationBuilder_ == null) { + if (documentTranslation_ != null) { + documentTranslation_ = + com.google.cloud.translate.v3beta1.DocumentTranslation.newBuilder( + documentTranslation_) + .mergeFrom(value) + .buildPartial(); + } else { + documentTranslation_ = value; + } + onChanged(); + } else { + documentTranslationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3beta1.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.v3beta1.DocumentTranslation document_translation = 1; + */ + public com.google.cloud.translate.v3beta1.DocumentTranslation.Builder + getDocumentTranslationBuilder() { + + onChanged(); + return getDocumentTranslationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3beta1.DocumentTranslation document_translation = 1; + */ + public com.google.cloud.translate.v3beta1.DocumentTranslationOrBuilder + getDocumentTranslationOrBuilder() { + if (documentTranslationBuilder_ != null) { + return documentTranslationBuilder_.getMessageOrBuilder(); + } else { + return documentTranslation_ == null + ? com.google.cloud.translate.v3beta1.DocumentTranslation.getDefaultInstance() + : documentTranslation_; + } + } + /** + * + * + *
+     * Translated document.
+     * 
+ * + * .google.cloud.translation.v3beta1.DocumentTranslation document_translation = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.DocumentTranslation, + com.google.cloud.translate.v3beta1.DocumentTranslation.Builder, + com.google.cloud.translate.v3beta1.DocumentTranslationOrBuilder> + getDocumentTranslationFieldBuilder() { + if (documentTranslationBuilder_ == null) { + documentTranslationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.DocumentTranslation, + com.google.cloud.translate.v3beta1.DocumentTranslation.Builder, + com.google.cloud.translate.v3beta1.DocumentTranslationOrBuilder>( + getDocumentTranslation(), getParentForChildren(), isClean()); + documentTranslation_ = null; + } + return documentTranslationBuilder_; + } + + private com.google.cloud.translate.v3beta1.DocumentTranslation glossaryDocumentTranslation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.DocumentTranslation, + com.google.cloud.translate.v3beta1.DocumentTranslation.Builder, + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.DocumentTranslation glossary_document_translation = 2; + * + * + * @return The glossaryDocumentTranslation. + */ + public com.google.cloud.translate.v3beta1.DocumentTranslation getGlossaryDocumentTranslation() { + if (glossaryDocumentTranslationBuilder_ == null) { + return glossaryDocumentTranslation_ == null + ? com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation glossary_document_translation = 2; + * + */ + public Builder setGlossaryDocumentTranslation( + com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation glossary_document_translation = 2; + * + */ + public Builder setGlossaryDocumentTranslation( + com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation glossary_document_translation = 2; + * + */ + public Builder mergeGlossaryDocumentTranslation( + com.google.cloud.translate.v3beta1.DocumentTranslation value) { + if (glossaryDocumentTranslationBuilder_ == null) { + if (glossaryDocumentTranslation_ != null) { + glossaryDocumentTranslation_ = + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.DocumentTranslation glossary_document_translation = 2; + * + */ + public com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation glossary_document_translation = 2; + * + */ + public com.google.cloud.translate.v3beta1.DocumentTranslationOrBuilder + getGlossaryDocumentTranslationOrBuilder() { + if (glossaryDocumentTranslationBuilder_ != null) { + return glossaryDocumentTranslationBuilder_.getMessageOrBuilder(); + } else { + return glossaryDocumentTranslation_ == null + ? com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation glossary_document_translation = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.DocumentTranslation, + com.google.cloud.translate.v3beta1.DocumentTranslation.Builder, + com.google.cloud.translate.v3beta1.DocumentTranslationOrBuilder> + getGlossaryDocumentTranslationFieldBuilder() { + if (glossaryDocumentTranslationBuilder_ == null) { + glossaryDocumentTranslationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.DocumentTranslation, + com.google.cloud.translate.v3beta1.DocumentTranslation.Builder, + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossaryConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig, + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder, + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder> + glossaryConfigBuilder_; + /** + * + * + *
+     * The `glossary_config` used for this translation.
+     * 
+ * + * .google.cloud.translation.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 4; + * + * + * @return The glossaryConfig. + */ + public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossaryConfig() { + if (glossaryConfigBuilder_ == null) { + return glossaryConfig_ == null + ? com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.getDefaultInstance() + : glossaryConfig_; + } else { + return glossaryConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The `glossary_config` used for this translation.
+     * 
+ * + * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 4; + * + */ + public Builder setGlossaryConfig( + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 4; + * + */ + public Builder setGlossaryConfig( + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 4; + * + */ + public Builder mergeGlossaryConfig( + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig value) { + if (glossaryConfigBuilder_ == null) { + if (glossaryConfig_ != null) { + glossaryConfig_ = + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 4; + * + */ + public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder + getGlossaryConfigBuilder() { + + onChanged(); + return getGlossaryConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The `glossary_config` used for this translation.
+     * 
+ * + * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 4; + * + */ + public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder + getGlossaryConfigOrBuilder() { + if (glossaryConfigBuilder_ != null) { + return glossaryConfigBuilder_.getMessageOrBuilder(); + } else { + return glossaryConfig_ == null + ? com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.getDefaultInstance() + : glossaryConfig_; + } + } + /** + * + * + *
+     * The `glossary_config` used for this translation.
+     * 
+ * + * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig, + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder, + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder> + getGlossaryConfigFieldBuilder() { + if (glossaryConfigBuilder_ == null) { + glossaryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig, + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder, + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.TranslateDocumentResponse) + private static final com.google.cloud.translate.v3beta1.TranslateDocumentResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.translate.v3beta1.TranslateDocumentResponse(); + } + + public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentResponseOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentResponseOrBuilder.java new file mode 100644 index 00000000..d16d44e2 --- /dev/null +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentResponseOrBuilder.java @@ -0,0 +1,178 @@ +/* + * 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/v3beta1/translation_service.proto + +package com.google.cloud.translate.v3beta1; + +public interface TranslateDocumentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.translation.v3beta1.TranslateDocumentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Translated document.
+   * 
+ * + * .google.cloud.translation.v3beta1.DocumentTranslation document_translation = 1; + * + * @return Whether the documentTranslation field is set. + */ + boolean hasDocumentTranslation(); + /** + * + * + *
+   * Translated document.
+   * 
+ * + * .google.cloud.translation.v3beta1.DocumentTranslation document_translation = 1; + * + * @return The documentTranslation. + */ + com.google.cloud.translate.v3beta1.DocumentTranslation getDocumentTranslation(); + /** + * + * + *
+   * Translated document.
+   * 
+ * + * .google.cloud.translation.v3beta1.DocumentTranslation document_translation = 1; + */ + com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.DocumentTranslation glossary_document_translation = 2; + * + * + * @return The glossaryDocumentTranslation. + */ + com.google.cloud.translate.v3beta1.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.v3beta1.DocumentTranslation glossary_document_translation = 2; + * + */ + com.google.cloud.translate.v3beta1.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.v3beta1.TranslateTextGlossaryConfig glossary_config = 4; + * + * @return Whether the glossaryConfig field is set. + */ + boolean hasGlossaryConfig(); + /** + * + * + *
+   * The `glossary_config` used for this translation.
+   * 
+ * + * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 4; + * + * @return The glossaryConfig. + */ + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossaryConfig(); + /** + * + * + *
+   * The `glossary_config` used for this translation.
+   * 
+ * + * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 4; + */ + com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder + getGlossaryConfigOrBuilder(); +} diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextRequest.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextRequest.java index 94427f60..8b021caa 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextRequest.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextRequest.java @@ -207,7 +207,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.
    * 
* @@ -223,7 +224,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.
    * 
* @@ -239,7 +241,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.
    * 
* @@ -256,7 +259,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.
    * 
* @@ -436,10 +440,10 @@ public com.google.protobuf.ByteString getTargetLanguageCodeBytes() { *
    * Required. Project or location to make a call. Must refer to a caller's
    * project.
-   * Format: `projects/{project-id}` or
-   * `projects/{project-id}/locations/{location-id}`.
-   * For global calls, use `projects/{project-id}/locations/global` or
-   * `projects/{project-id}`.
+   * Format: `projects/{project-number-or-id}` or
+   * `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 same
@@ -470,10 +474,10 @@ public java.lang.String getParent() {
    * 
    * Required. Project or location to make a call. Must refer to a caller's
    * project.
-   * Format: `projects/{project-id}` or
-   * `projects/{project-id}/locations/{location-id}`.
-   * For global calls, use `projects/{project-id}/locations/global` or
-   * `projects/{project-id}`.
+   * Format: `projects/{project-number-or-id}` or
+   * `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 same
@@ -508,13 +512,13 @@ public com.google.protobuf.ByteString getParentBytes() {
    * Optional. The `model` type requested for this translation.
    * The format depends on model type:
    * - AutoML Translation models:
-   *   `projects/{project-id}/locations/{location-id}/models/{model-id}`
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
    * - General (built-in) models:
-   *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-   *   `projects/{project-id}/locations/{location-id}/models/general/base`
+   *   `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-id}/locations/global/models/general/nmt`.
+   * `projects/{project-number-or-id}/locations/global/models/general/nmt`.
    * If missing, the system decides which google base model to use.
    * 
* @@ -541,13 +545,13 @@ public java.lang.String getModel() { * Optional. The `model` type requested for this translation. * The format depends on model type: * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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-id}/locations/global/models/general/nmt`. + * `projects/{project-number-or-id}/locations/global/models/general/nmt`. * If missing, the system decides which google base model to use. *
* @@ -1249,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.
      * 
* @@ -1265,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.
      * 
* @@ -1281,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.
      * 
* @@ -1298,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.
      * 
* @@ -1315,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.
      * 
* @@ -1339,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.
      * 
* @@ -1362,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.
      * 
* @@ -1382,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.
      * 
* @@ -1401,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.
      * 
* @@ -1776,10 +1789,10 @@ public Builder setTargetLanguageCodeBytes(com.google.protobuf.ByteString value) *
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}` or
-     * `projects/{project-id}/locations/{location-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
+     * Format: `projects/{project-number-or-id}` or
+     * `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 same
@@ -1809,10 +1822,10 @@ public java.lang.String getParent() {
      * 
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}` or
-     * `projects/{project-id}/locations/{location-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
+     * Format: `projects/{project-number-or-id}` or
+     * `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 same
@@ -1842,10 +1855,10 @@ public com.google.protobuf.ByteString getParentBytes() {
      * 
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}` or
-     * `projects/{project-id}/locations/{location-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
+     * Format: `projects/{project-number-or-id}` or
+     * `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 same
@@ -1874,10 +1887,10 @@ public Builder setParent(java.lang.String value) {
      * 
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}` or
-     * `projects/{project-id}/locations/{location-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
+     * Format: `projects/{project-number-or-id}` or
+     * `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 same
@@ -1902,10 +1915,10 @@ public Builder clearParent() {
      * 
      * Required. Project or location to make a call. Must refer to a caller's
      * project.
-     * Format: `projects/{project-id}` or
-     * `projects/{project-id}/locations/{location-id}`.
-     * For global calls, use `projects/{project-id}/locations/global` or
-     * `projects/{project-id}`.
+     * Format: `projects/{project-number-or-id}` or
+     * `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 same
@@ -1938,13 +1951,13 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
      * Optional. The `model` type requested for this translation.
      * The format depends on model type:
      * - AutoML Translation models:
-     *   `projects/{project-id}/locations/{location-id}/models/{model-id}`
+     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
      * - General (built-in) models:
-     *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-     *   `projects/{project-id}/locations/{location-id}/models/general/base`
+     *   `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-id}/locations/global/models/general/nmt`.
+     * `projects/{project-number-or-id}/locations/global/models/general/nmt`.
      * If missing, the system decides which google base model to use.
      * 
* @@ -1970,13 +1983,13 @@ public java.lang.String getModel() { * Optional. The `model` type requested for this translation. * The format depends on model type: * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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-id}/locations/global/models/general/nmt`. + * `projects/{project-number-or-id}/locations/global/models/general/nmt`. * If missing, the system decides which google base model to use. *
* @@ -2002,13 +2015,13 @@ public com.google.protobuf.ByteString getModelBytes() { * Optional. The `model` type requested for this translation. * The format depends on model type: * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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-id}/locations/global/models/general/nmt`. + * `projects/{project-number-or-id}/locations/global/models/general/nmt`. * If missing, the system decides which google base model to use. *
* @@ -2033,13 +2046,13 @@ public Builder setModel(java.lang.String value) { * Optional. The `model` type requested for this translation. * The format depends on model type: * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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-id}/locations/global/models/general/nmt`. + * `projects/{project-number-or-id}/locations/global/models/general/nmt`. * If missing, the system decides which google base model to use. *
* @@ -2060,13 +2073,13 @@ public Builder clearModel() { * Optional. The `model` type requested for this translation. * The format depends on model type: * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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-id}/locations/global/models/general/nmt`. + * `projects/{project-number-or-id}/locations/global/models/general/nmt`. * If missing, the system decides which google base model to use. *
* diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextRequestOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextRequestOrBuilder.java index 6ebeda6a..9468a66d 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextRequestOrBuilder.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/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.
    * 
* @@ -175,10 +179,10 @@ public interface TranslateTextRequestOrBuilder *
    * Required. Project or location to make a call. Must refer to a caller's
    * project.
-   * Format: `projects/{project-id}` or
-   * `projects/{project-id}/locations/{location-id}`.
-   * For global calls, use `projects/{project-id}/locations/global` or
-   * `projects/{project-id}`.
+   * Format: `projects/{project-number-or-id}` or
+   * `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 same
@@ -198,10 +202,10 @@ public interface TranslateTextRequestOrBuilder
    * 
    * Required. Project or location to make a call. Must refer to a caller's
    * project.
-   * Format: `projects/{project-id}` or
-   * `projects/{project-id}/locations/{location-id}`.
-   * For global calls, use `projects/{project-id}/locations/global` or
-   * `projects/{project-id}`.
+   * Format: `projects/{project-number-or-id}` or
+   * `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 same
@@ -223,13 +227,13 @@ public interface TranslateTextRequestOrBuilder
    * Optional. The `model` type requested for this translation.
    * The format depends on model type:
    * - AutoML Translation models:
-   *   `projects/{project-id}/locations/{location-id}/models/{model-id}`
+   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
    * - General (built-in) models:
-   *   `projects/{project-id}/locations/{location-id}/models/general/nmt`,
-   *   `projects/{project-id}/locations/{location-id}/models/general/base`
+   *   `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-id}/locations/global/models/general/nmt`.
+   * `projects/{project-number-or-id}/locations/global/models/general/nmt`.
    * If missing, the system decides which google base model to use.
    * 
* @@ -245,13 +249,13 @@ public interface TranslateTextRequestOrBuilder * Optional. The `model` type requested for this translation. * The format depends on model type: * - AutoML Translation models: - * `projects/{project-id}/locations/{location-id}/models/{model-id}` + * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` * - General (built-in) models: - * `projects/{project-id}/locations/{location-id}/models/general/nmt`, - * `projects/{project-id}/locations/{location-id}/models/general/base` + * `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-id}/locations/global/models/general/nmt`. + * `projects/{project-number-or-id}/locations/global/models/general/nmt`. * If missing, the system decides which google base model to use. *
* diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextResponse.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextResponse.java index e89bdb3f..b29a7191 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextResponse.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextResponse.java @@ -216,8 +216,8 @@ public com.google.cloud.translate.v3beta1.TranslationOrBuilder getTranslationsOr *
    * Text translation responses if a glossary is provided in the request.
    * This can be the same as
-   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-   * This field has the same length as
+   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+   * if no terms apply. This field has the same length as
    * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
    * 
* @@ -234,8 +234,8 @@ public com.google.cloud.translate.v3beta1.TranslationOrBuilder getTranslationsOr *
    * Text translation responses if a glossary is provided in the request.
    * This can be the same as
-   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-   * This field has the same length as
+   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+   * if no terms apply. This field has the same length as
    * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
    * 
* @@ -252,8 +252,8 @@ public com.google.cloud.translate.v3beta1.TranslationOrBuilder getTranslationsOr *
    * Text translation responses if a glossary is provided in the request.
    * This can be the same as
-   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-   * This field has the same length as
+   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+   * if no terms apply. This field has the same length as
    * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
    * 
* @@ -269,8 +269,8 @@ public int getGlossaryTranslationsCount() { *
    * Text translation responses if a glossary is provided in the request.
    * This can be the same as
-   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-   * This field has the same length as
+   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+   * if no terms apply. This field has the same length as
    * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
    * 
* @@ -286,8 +286,8 @@ public com.google.cloud.translate.v3beta1.Translation getGlossaryTranslations(in *
    * Text translation responses if a glossary is provided in the request.
    * This can be the same as
-   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-   * This field has the same length as
+   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+   * if no terms apply. This field has the same length as
    * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
    * 
* @@ -1123,8 +1123,8 @@ private void ensureGlossaryTranslationsIsMutable() { *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1145,8 +1145,8 @@ private void ensureGlossaryTranslationsIsMutable() { *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1166,8 +1166,8 @@ public int getGlossaryTranslationsCount() { *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1187,8 +1187,8 @@ public com.google.cloud.translate.v3beta1.Translation getGlossaryTranslations(in *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1215,8 +1215,8 @@ public Builder setGlossaryTranslations( *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1240,8 +1240,8 @@ public Builder setGlossaryTranslations( *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1267,8 +1267,8 @@ public Builder addGlossaryTranslations(com.google.cloud.translate.v3beta1.Transl *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1295,8 +1295,8 @@ public Builder addGlossaryTranslations( *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1320,8 +1320,8 @@ public Builder addGlossaryTranslations( *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1345,8 +1345,8 @@ public Builder addGlossaryTranslations( *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1370,8 +1370,8 @@ public Builder addAllGlossaryTranslations( *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1394,8 +1394,8 @@ public Builder clearGlossaryTranslations() { *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1418,8 +1418,8 @@ public Builder removeGlossaryTranslations(int index) { *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1436,8 +1436,8 @@ public com.google.cloud.translate.v3beta1.Translation.Builder getGlossaryTransla *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1458,8 +1458,8 @@ public com.google.cloud.translate.v3beta1.TranslationOrBuilder getGlossaryTransl *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1480,8 +1480,8 @@ public com.google.cloud.translate.v3beta1.TranslationOrBuilder getGlossaryTransl *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1498,8 +1498,8 @@ public com.google.cloud.translate.v3beta1.Translation.Builder addGlossaryTransla *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* @@ -1517,8 +1517,8 @@ public com.google.cloud.translate.v3beta1.Translation.Builder addGlossaryTransla *
      * Text translation responses if a glossary is provided in the request.
      * This can be the same as
-     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-     * This field has the same length as
+     * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+     * if no terms apply. This field has the same length as
      * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
      * 
* diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextResponseOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextResponseOrBuilder.java index ef4079c3..bab76d8f 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextResponseOrBuilder.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextResponseOrBuilder.java @@ -91,8 +91,8 @@ public interface TranslateTextResponseOrBuilder *
    * Text translation responses if a glossary is provided in the request.
    * This can be the same as
-   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-   * This field has the same length as
+   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+   * if no terms apply. This field has the same length as
    * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
    * 
* @@ -105,8 +105,8 @@ public interface TranslateTextResponseOrBuilder *
    * Text translation responses if a glossary is provided in the request.
    * This can be the same as
-   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-   * This field has the same length as
+   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+   * if no terms apply. This field has the same length as
    * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
    * 
* @@ -119,8 +119,8 @@ public interface TranslateTextResponseOrBuilder *
    * Text translation responses if a glossary is provided in the request.
    * This can be the same as
-   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-   * This field has the same length as
+   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+   * if no terms apply. This field has the same length as
    * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
    * 
* @@ -133,8 +133,8 @@ public interface TranslateTextResponseOrBuilder *
    * Text translation responses if a glossary is provided in the request.
    * This can be the same as
-   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-   * This field has the same length as
+   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+   * if no terms apply. This field has the same length as
    * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
    * 
* @@ -148,8 +148,8 @@ public interface TranslateTextResponseOrBuilder *
    * Text translation responses if a glossary is provided in the request.
    * This can be the same as
-   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply.
-   * This field has the same length as
+   * [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations]
+   * if no terms apply. This field has the same length as
    * [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents].
    * 
* diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/Translation.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/Translation.java index a096b586..9183b864 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/Translation.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/Translation.java @@ -201,7 +201,12 @@ public com.google.protobuf.ByteString getTranslatedTextBytes() { * *
    * Only present when `model` is present in the request.
-   * This is same as `model` provided in the request.
+   * `model` here is normalized to have project number.
+   * For example:
+   * If the `model` requested in TranslationTextRequest 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 = 2; @@ -225,7 +230,12 @@ public java.lang.String getModel() { * *
    * Only present when `model` is present in the request.
-   * This is same as `model` provided in the request.
+   * `model` here is normalized to have project number.
+   * For example:
+   * If the `model` requested in TranslationTextRequest 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 = 2; @@ -837,7 +847,12 @@ public Builder setTranslatedTextBytes(com.google.protobuf.ByteString value) { * *
      * Only present when `model` is present in the request.
-     * This is same as `model` provided in the request.
+     * `model` here is normalized to have project number.
+     * For example:
+     * If the `model` requested in TranslationTextRequest 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 = 2; @@ -860,7 +875,12 @@ public java.lang.String getModel() { * *
      * Only present when `model` is present in the request.
-     * This is same as `model` provided in the request.
+     * `model` here is normalized to have project number.
+     * For example:
+     * If the `model` requested in TranslationTextRequest 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 = 2; @@ -883,7 +903,12 @@ public com.google.protobuf.ByteString getModelBytes() { * *
      * Only present when `model` is present in the request.
-     * This is same as `model` provided in the request.
+     * `model` here is normalized to have project number.
+     * For example:
+     * If the `model` requested in TranslationTextRequest 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 = 2; @@ -905,7 +930,12 @@ public Builder setModel(java.lang.String value) { * *
      * Only present when `model` is present in the request.
-     * This is same as `model` provided in the request.
+     * `model` here is normalized to have project number.
+     * For example:
+     * If the `model` requested in TranslationTextRequest 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 = 2; @@ -923,7 +953,12 @@ public Builder clearModel() { * *
      * Only present when `model` is present in the request.
-     * This is same as `model` provided in the request.
+     * `model` here is normalized to have project number.
+     * For example:
+     * If the `model` requested in TranslationTextRequest 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 = 2; diff --git a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslationOrBuilder.java b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslationOrBuilder.java index 68077b43..b0cb015f 100644 --- a/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslationOrBuilder.java +++ b/proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslationOrBuilder.java @@ -53,7 +53,12 @@ public interface TranslationOrBuilder * *
    * Only present when `model` is present in the request.
-   * This is same as `model` provided in the request.
+   * `model` here is normalized to have project number.
+   * For example:
+   * If the `model` requested in TranslationTextRequest 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 = 2; @@ -66,7 +71,12 @@ public interface TranslationOrBuilder * *
    * Only present when `model` is present in the request.
-   * This is same as `model` provided in the request.
+   * `model` here is normalized to have project number.
+   * For example:
+   * If the `model` requested in TranslationTextRequest 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 = 2; 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 54c6704a..28882674 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 @@ -91,6 +91,30 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_translation_v3beta1_OutputConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_translation_v3beta1_OutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3beta1_DocumentInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3beta1_DocumentInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3beta1_DocumentOutputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3beta1_DocumentOutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3beta1_DocumentTranslation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3beta1_DocumentTranslation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3beta1_TranslateDocumentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3beta1_TranslateDocumentResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_translation_v3beta1_BatchTranslateTextRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -163,6 +187,34 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_translation_v3beta1_DeleteGlossaryResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_translation_v3beta1_DeleteGlossaryResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_ModelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_ModelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + 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_BatchDocumentInputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3beta1_BatchDocumentInputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3beta1_BatchDocumentOutputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3beta1_BatchDocumentOutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentMetadata_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -200,178 +252,265 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "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\"\237\002\n" + + ".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\022S\n\006labels\030\006 \003(\013" + + "\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.LabelsEntry\032-\n\013LabelsE" - + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\010\n\006" - + "source\"=\n\020DetectedLanguage\022\025\n\rlanguage_c" - + "ode\030\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002\"_\n\026DetectL" - + "anguageResponse\022E\n\tlanguages\030\001 \003(\01322.goo" - + "gle.cloud.translation.v3beta1.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\"\\\n\022Su" - + "pportedLanguages\022F\n\tlanguages\030\001 \003(\01323.go" - + "ogle.cloud.translation.v3beta1.Supported" - + "Language\"p\n\021SupportedLanguage\022\025\n\rlanguag" - + "e_code\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022\026\n\016su" - + "pport_source\030\003 \001(\010\022\026\n\016support_target\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.transl" - + "ation.v3beta1.GcsSourceH\000B\010\n\006source\"0\n\016G" - + "csDestination\022\036\n\021output_uri_prefix\030\001 \001(\t" - + "B\003\340A\002\"j\n\014OutputConfig\022K\n\017gcs_destination" - + "\030\001 \001(\01320.google.cloud.translation.v3beta" - + "1.GcsDestinationH\000B\r\n\013destination\"\246\006\n\031Ba" - + "tchTranslateTextRequest\0229\n\006parent\030\001 \001(\tB" - + ")\340A\002\372A#\n!locations.googleapis.com/Locati" - + "on\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\006mod" - + "els\030\004 \003(\0132G.google.cloud.translation.v3b" - + "eta1.BatchTranslateTextRequest.ModelsEnt" - + "ryB\003\340A\001\022I\n\rinput_configs\030\005 \003(\0132-.google." - + "cloud.translation.v3beta1.InputConfigB\003\340" - + "A\002\022J\n\routput_config\030\006 \001(\0132..google.cloud" - + ".translation.v3beta1.OutputConfigB\003\340A\002\022d" - + "\n\nglossaries\030\007 \003(\0132K.google.cloud.transl" + + "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" + + "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." - + "GlossariesEntryB\003\340A\001\022\\\n\006labels\030\t \003(\0132G.g" - + "oogle.cloud.translation.v3beta1.BatchTra" - + "nslateTextRequest.LabelsEntryB\003\340A\001\032-\n\013Mo" - + "delsEntry\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\005val" - + "ue\030\002 \001(\0132=.google.cloud.translation.v3be" - + "ta1.TranslateTextGlossaryConfig:\0028\001\032-\n\013L" - + "abelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\002" - + "8\001\"\323\002\n\026BatchTranslateMetadata\022M\n\005state\030\001" - + " \001(\0162>.google.cloud.translation.v3beta1." - + "BatchTranslateMetadata.State\022\035\n\025translat" - + "ed_characters\030\002 \001(\003\022\031\n\021failed_characters" - + "\030\003 \001(\003\022\030\n\020total_characters\030\004 \001(\003\022/\n\013subm" - + "it_time\030\005 \001(\0132\032.google.protobuf.Timestam" + + "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\"\313\001\n\026BatchTransl" - + "ateResponse\022\030\n\020total_characters\030\001 \001(\003\022\035\n" - + "\025translated_characters\030\002 \001(\003\022\031\n\021failed_c" - + "haracters\030\003 \001(\003\022/\n\013submit_time\030\004 \001(\0132\032.g" - + "oogle.protobuf.Timestamp\022,\n\010end_time\030\005 \001" - + "(\0132\032.google.protobuf.Timestamp\"b\n\023Glossa" - + "ryInputConfig\022A\n\ngcs_source\030\001 \001(\0132+.goog" - + "le.cloud.translation.v3beta1.GcsSourceH\000" - + "B\010\n\006source\"\216\005\n\010Glossary\022\021\n\004name\030\001 \001(\tB\003\340" - + "A\002\022T\n\rlanguage_pair\030\003 \001(\0132;.google.cloud" - + ".translation.v3beta1.Glossary.LanguageCo" - + "dePairH\000\022Y\n\022language_codes_set\030\004 \001(\0132;.g" - + "oogle.cloud.translation.v3beta1.Glossary" - + ".LanguageCodesSetH\000\022K\n\014input_config\030\005 \001(" - + "\01325.google.cloud.translation.v3beta1.Glo" - + "ssaryInputConfig\022\030\n\013entry_count\030\006 \001(\005B\003\340" - + "A\003\0224\n\013submit_time\030\007 \001(\0132\032.google.protobu" - + "f.TimestampB\003\340A\003\0221\n\010end_time\030\010 \001(\0132\032.goo" - + "gle.protobuf.TimestampB\003\340A\003\032N\n\020LanguageC" - + "odePair\022\034\n\024source_language_code\030\001 \001(\t\022\034\n" - + "\024target_language_code\030\002 \001(\t\032*\n\020LanguageC" - + "odesSet\022\026\n\016language_codes\030\001 \003(\t:e\352Ab\n!tr" - + "anslate.googleapis.com/Glossary\022=project" - + "s/{project}/locations/{location}/glossar" - + "ies/{glossary}B\013\n\tlanguages\"\225\001\n\025CreateGl" - + "ossaryRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!l" - + "ocations.googleapis.com/Location\022A\n\010glos" - + "sary\030\002 \001(\0132*.google.cloud.translation.v3" - + "beta1.GlossaryB\003\340A\002\"M\n\022GetGlossaryReques" - + "t\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!translate.googl" - + "eapis.com/Glossary\"P\n\025DeleteGlossaryRequ" - + "est\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!translate.goo" - + "gleapis.com/Glossary\"\230\001\n\025ListGlossariesR" - + "equest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!location" - + "s.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\006fi" - + "lter\030\004 \001(\tB\003\340A\001\"q\n\026ListGlossariesRespons" - + "e\022>\n\nglossaries\030\001 \003(\0132*.google.cloud.tra" - + "nslation.v3beta1.Glossary\022\027\n\017next_page_t" - + "oken\030\002 \001(\t\"\215\002\n\026CreateGlossaryMetadata\022\014\n" - + "\004name\030\001 \001(\t\022M\n\005state\030\002 \001(\0162>.google.clou" - + "d.translation.v3beta1.CreateGlossaryMeta" - + "data.State\022/\n\013submit_time\030\003 \001(\0132\032.google" - + ".protobuf.Timestamp\"e\n\005State\022\025\n\021STATE_UN" - + "SPECIFIED\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\"\215\002\n\026DeleteGlossaryMetadata\022\014\n\004name\030\001 " - + "\001(\t\022M\n\005state\030\002 \001(\0162>.google.cloud.transl" - + "ation.v3beta1.DeleteGlossaryMetadata.Sta" - + "te\022/\n\013submit_time\030\003 \001(\0132\032.google.protobu" - + "f.Timestamp\"e\n\005State\022\025\n\021STATE_UNSPECIFIE" - + "D\020\000\022\013\n\007RUNNING\020\001\022\r\n\tSUCCEEDED\020\002\022\n\n\006FAILE" - + "D\020\003\022\016\n\nCANCELLING\020\004\022\r\n\tCANCELLED\020\005\"\205\001\n\026D" - + "eleteGlossaryResponse\022\014\n\004name\030\001 \001(\t\022/\n\013s" - + "ubmit_time\030\002 \001(\0132\032.google.protobuf.Times" - + "tamp\022,\n\010end_time\030\003 \001(\0132\032.google.protobuf" - + ".Timestamp2\232\020\n\022TranslationService\022\364\001\n\rTr" - + "anslateText\0226.google.cloud.translation.v" - + "3beta1.TranslateTextRequest\0327.google.clo" - + "ud.translation.v3beta1.TranslateTextResp" - + "onse\"r\202\323\344\223\002l\"6/v3beta1/{parent=projects/" - + "*/locations/*}:translateText:\001*Z/\"*/v3be" - + "ta1/{parent=projects/*}:translateText:\001*" - + "\022\223\002\n\016DetectLanguage\0227.google.cloud.trans" - + "lation.v3beta1.DetectLanguageRequest\0328.g" - + "oogle.cloud.translation.v3beta1.DetectLa" - + "nguageResponse\"\215\001\202\323\344\223\002n\"7/v3beta1/{paren" - + "t=projects/*/locations/*}:detectLanguage" - + ":\001*Z0\"+/v3beta1/{parent=projects/*}:dete" - + "ctLanguage:\001*\332A\026parent,model,mime_type\022\253" - + "\002\n\025GetSupportedLanguages\022>.google.cloud." - + "translation.v3beta1.GetSupportedLanguage" - + "sRequest\0324.google.cloud.translation.v3be" - + "ta1.SupportedLanguages\"\233\001\202\323\344\223\002p\022;/v3beta" - + "1/{parent=projects/*/locations/*}/suppor" - + "tedLanguagesZ1\022//v3beta1/{parent=project" - + "s/*}/supportedLanguages\332A\"parent,display" - + "_language_code,model\022\353\001\n\022BatchTranslateT" - + "ext\022;.google.cloud.translation.v3beta1.B" - + "atchTranslateTextRequest\032\035.google.longru" - + "nning.Operation\"y\202\323\344\223\002@\";/v3beta1/{paren" - + "t=projects/*/locations/*}:batchTranslate" - + "Text:\001*\312A0\n\026BatchTranslateResponse\022\026Batc" - + "hTranslateMetadata\022\346\001\n\016CreateGlossary\0227." - + "google.cloud.translation.v3beta1.CreateG" - + "lossaryRequest\032\035.google.longrunning.Oper" - + "ation\"|\202\323\344\223\002?\"3/v3beta1/{parent=projects" - + "/*/locations/*}/glossaries:\010glossary\332A\017p" - + "arent,glossary\312A\"\n\010Glossary\022\026CreateGloss" - + "aryMetadata\022\331\001\n\016ListGlossaries\0227.google." - + "cloud.translation.v3beta1.ListGlossaries" - + "Request\0328.google.cloud.translation.v3bet" - + "a1.ListGlossariesResponse\"T\202\323\344\223\0025\0223/v3be" - + "ta1/{parent=projects/*/locations/*}/glos" - + "saries\332A\006parent\332A\rparent,filter\022\263\001\n\013GetG" - + "lossary\0224.google.cloud.translation.v3bet" - + "a1.GetGlossaryRequest\032*.google.cloud.tra" - + "nslation.v3beta1.Glossary\"B\202\323\344\223\0025\0223/v3be" - + "ta1/{name=projects/*/locations/*/glossar" - + "ies/*}\332A\004name\022\337\001\n\016DeleteGlossary\0227.googl" - + "e.cloud.translation.v3beta1.DeleteGlossa" - + "ryRequest\032\035.google.longrunning.Operation" - + "\"u\202\323\344\223\0025*3/v3beta1/{name=projects/*/loca" - + "tions/*/glossaries/*}\332A\004name\312A0\n\026DeleteG" - + "lossaryResponse\022\026DeleteGlossaryMetadata\032" - + "~\312A\030translate.googleapis.com\322A`https://w" - + "ww.googleapis.com/auth/cloud-platform,ht" - + "tps://www.googleapis.com/auth/cloud-tran" - + "slationB\361\001\n\"com.google.cloud.translate.v" - + "3beta1B\027TranslationServiceProtoP\001ZGgoogl" - + "e.golang.org/genproto/googleapis/cloud/t" - + "ranslate/v3beta1;translate\370\001\001\252\002\036Google.C" - + "loud.Translate.V3Beta1\312\002\036Google\\Cloud\\Tr" - + "anslate\\V3beta1\352\002!Google::Cloud::Transla" - + "te::V3beta1b\006proto3" + + "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\"\231\005\n\035Bat" + + "chTranslateDocumentRequest\022\023\n\006parent\030\001 \001" + + "(\tB\003\340A\002\022!\n\024source_language_code\030\002 \001(\tB\003\340" + + "A\002\022\"\n\025target_language_codes\030\003 \003(\tB\003\340A\002\022V" + + "\n\rinput_configs\030\004 \003(\0132:.google.cloud.tra" + + "nslation.v3beta1.BatchDocumentInputConfi" + + "gB\003\340A\002\022W\n\routput_config\030\005 \001(\0132;.google.c" + + "loud.translation.v3beta1.BatchDocumentOu" + + "tputConfigB\003\340A\002\022`\n\006models\030\006 \003(\0132K.google" + + ".cloud.translation.v3beta1.BatchTranslat" + + "eDocumentRequest.ModelsEntryB\003\340A\001\022h\n\nglo" + + "ssaries\030\007 \003(\0132O.google.cloud.translation" + + ".v3beta1.BatchTranslateDocumentRequest.G" + + "lossariesEntryB\003\340A\001\032-\n\013ModelsEntry\022\013\n\003ke" + + "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032p\n\017Glossaries" + + "Entry\022\013\n\003key\030\001 \001(\t\022L\n\005value\030\002 \001(\0132=.goog" + + "le.cloud.translation.v3beta1.TranslateTe" + + "xtGlossaryConfig:\0028\001\"g\n\030BatchDocumentInp" + + "utConfig\022A\n\ngcs_source\030\001 \001(\0132+.google.cl" + + "oud.translation.v3beta1.GcsSourceH\000B\010\n\006s" + + "ource\"w\n\031BatchDocumentOutputConfig\022K\n\017gc" + + "s_destination\030\001 \001(\01320.google.cloud.trans" + + "lation.v3beta1.GcsDestinationH\000B\r\n\013desti" + + "nation\"\331\002\n\036BatchTranslateDocumentRespons" + + "e\022\023\n\013total_pages\030\001 \001(\003\022\030\n\020translated_pag" + + "es\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_characters\030\006 \001(\003\022\031\n" + + "\021failed_characters\030\007 \001(\003\022!\n\031total_billab" + + "le_characters\030\010 \001(\003\022/\n\013submit_time\030\t \001(\013" + + "2\032.google.protobuf.Timestamp\022,\n\010end_time" + + "\030\n \001(\0132\032.google.protobuf.Timestamp\"\351\003\n\036B" + + "atchTranslateDocumentMetadata\022U\n\005state\030\001" + + " \001(\0162F.google.cloud.translation.v3beta1." + + "BatchTranslateDocumentMetadata.State\022\023\n\013" + + "total_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_billa" + + "ble_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\021fail" + + "ed_characters\030\010 \001(\003\022!\n\031total_billable_ch" + + "aracters\030\t \001(\003\022/\n\013submit_time\030\n \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\0052\362\023\n\022TranslationService\022\364\001\n\rTransl" + + "ateText\0226.google.cloud.translation.v3bet" + + "a1.TranslateTextRequest\0327.google.cloud.t" + + "ranslation.v3beta1.TranslateTextResponse" + + "\"r\202\323\344\223\002l\"6/v3beta1/{parent=projects/*/lo" + + "cations/*}:translateText:\001*Z/\"*/v3beta1/" + + "{parent=projects/*}:translateText:\001*\022\223\002\n" + + "\016DetectLanguage\0227.google.cloud.translati" + + "on.v3beta1.DetectLanguageRequest\0328.googl" + + "e.cloud.translation.v3beta1.DetectLangua" + + "geResponse\"\215\001\202\323\344\223\002n\"7/v3beta1/{parent=pr" + + "ojects/*/locations/*}:detectLanguage:\001*Z" + + "0\"+/v3beta1/{parent=projects/*}:detectLa" + + "nguage:\001*\332A\026parent,model,mime_type\022\253\002\n\025G" + + "etSupportedLanguages\022>.google.cloud.tran" + + "slation.v3beta1.GetSupportedLanguagesReq" + + "uest\0324.google.cloud.translation.v3beta1." + + "SupportedLanguages\"\233\001\202\323\344\223\002p\022;/v3beta1/{p" + + "arent=projects/*/locations/*}/supportedL" + + "anguagesZ1\022//v3beta1/{parent=projects/*}" + + "/supportedLanguages\332A\"parent,display_lan" + + "guage_code,model\022\323\001\n\021TranslateDocument\022:" + + ".google.cloud.translation.v3beta1.Transl" + + "ateDocumentRequest\032;.google.cloud.transl" + + "ation.v3beta1.TranslateDocumentResponse\"" + + "E\202\323\344\223\002?\":/v3beta1/{parent=projects/*/loc" + + "ations/*}:translateDocument:\001*\022\353\001\n\022Batch" + + "TranslateText\022;.google.cloud.translation" + + ".v3beta1.BatchTranslateTextRequest\032\035.goo" + + "gle.longrunning.Operation\"y\202\323\344\223\002@\";/v3be" + + "ta1/{parent=projects/*/locations/*}:batc" + + "hTranslateText:\001*\312A0\n\026BatchTranslateResp" + + "onse\022\026BatchTranslateMetadata\022\210\002\n\026BatchTr" + + "anslateDocument\022?.google.cloud.translati" + + "on.v3beta1.BatchTranslateDocumentRequest" + + "\032\035.google.longrunning.Operation\"\215\001\202\323\344\223\002D" + + "\"?/v3beta1/{parent=projects/*/locations/" + + "*}:batchTranslateDocument:\001*\312A@\n\036BatchTr" + + "anslateDocumentResponse\022\036BatchTranslateD" + + "ocumentMetadata\022\346\001\n\016CreateGlossary\0227.goo" + + "gle.cloud.translation.v3beta1.CreateGlos" + + "saryRequest\032\035.google.longrunning.Operati" + + "on\"|\202\323\344\223\002?\"3/v3beta1/{parent=projects/*/" + + "locations/*}/glossaries:\010glossary\332A\017pare" + + "nt,glossary\312A\"\n\010Glossary\022\026CreateGlossary" + + "Metadata\022\320\001\n\016ListGlossaries\0227.google.clo" + + "ud.translation.v3beta1.ListGlossariesReq" + + "uest\0328.google.cloud.translation.v3beta1." + + "ListGlossariesResponse\"K\202\323\344\223\0025\0223/v3beta1" + + "/{parent=projects/*/locations/*}/glossar" + + "ies\332A\rparent,filter\022\263\001\n\013GetGlossary\0224.go" + + "ogle.cloud.translation.v3beta1.GetGlossa" + + "ryRequest\032*.google.cloud.translation.v3b" + + "eta1.Glossary\"B\202\323\344\223\0025\0223/v3beta1/{name=pr" + + "ojects/*/locations/*/glossaries/*}\332A\004nam" + + "e\022\337\001\n\016DeleteGlossary\0227.google.cloud.tran" + + "slation.v3beta1.DeleteGlossaryRequest\032\035." + + "google.longrunning.Operation\"u\202\323\344\223\0025*3/v" + + "3beta1/{name=projects/*/locations/*/glos" + + "saries/*}\332A\004name\312A0\n\026DeleteGlossaryRespo" + + "nse\022\026DeleteGlossaryMetadata\032~\312A\030translat" + + "e.googleapis.com\322A`https://www.googleapi" + + "s.com/auth/cloud-platform,https://www.go" + + "ogleapis.com/auth/cloud-translationB\361\001\n\"" + + "com.google.cloud.translate.v3beta1B\027Tran" + + "slationServiceProtoP\001ZGgoogle.golang.org" + + "/genproto/googleapis/cloud/translate/v3b" + + "eta1;translate\370\001\001\252\002\036Google.Cloud.Transla" + + "te.V3Beta1\312\002\036Google\\Cloud\\Translate\\V3be" + + "ta1\352\002!Google::Cloud::Translate::V3beta1b" + + "\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -523,8 +662,65 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "GcsDestination", "Destination", }); - internal_static_google_cloud_translation_v3beta1_BatchTranslateTextRequest_descriptor = + internal_static_google_cloud_translation_v3beta1_DocumentInputConfig_descriptor = getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_translation_v3beta1_DocumentInputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_DocumentInputConfig_descriptor, + new java.lang.String[] { + "Content", "GcsSource", "MimeType", "Source", + }); + internal_static_google_cloud_translation_v3beta1_DocumentOutputConfig_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_translation_v3beta1_DocumentOutputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_DocumentOutputConfig_descriptor, + new java.lang.String[] { + "GcsDestination", "MimeType", "Destination", + }); + internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_descriptor, + new java.lang.String[] { + "Parent", + "SourceLanguageCode", + "TargetLanguageCode", + "DocumentInputConfig", + "DocumentOutputConfig", + "Model", + "GlossaryConfig", + "Labels", + }); + internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_LabelsEntry_descriptor = + internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_translation_v3beta1_DocumentTranslation_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_translation_v3beta1_DocumentTranslation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_DocumentTranslation_descriptor, + new java.lang.String[] { + "ByteStreamOutputs", "MimeType", "DetectedLanguageCode", + }); + internal_static_google_cloud_translation_v3beta1_TranslateDocumentResponse_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_translation_v3beta1_TranslateDocumentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_TranslateDocumentResponse_descriptor, + new java.lang.String[] { + "DocumentTranslation", "GlossaryDocumentTranslation", "Model", "GlossaryConfig", + }); + internal_static_google_cloud_translation_v3beta1_BatchTranslateTextRequest_descriptor = + getDescriptor().getMessageTypes().get(19); internal_static_google_cloud_translation_v3beta1_BatchTranslateTextRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3beta1_BatchTranslateTextRequest_descriptor, @@ -569,7 +765,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_translation_v3beta1_BatchTranslateMetadata_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(20); internal_static_google_cloud_translation_v3beta1_BatchTranslateMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3beta1_BatchTranslateMetadata_descriptor, @@ -577,7 +773,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "State", "TranslatedCharacters", "FailedCharacters", "TotalCharacters", "SubmitTime", }); internal_static_google_cloud_translation_v3beta1_BatchTranslateResponse_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(21); internal_static_google_cloud_translation_v3beta1_BatchTranslateResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3beta1_BatchTranslateResponse_descriptor, @@ -589,7 +785,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EndTime", }); internal_static_google_cloud_translation_v3beta1_GlossaryInputConfig_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(22); internal_static_google_cloud_translation_v3beta1_GlossaryInputConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3beta1_GlossaryInputConfig_descriptor, @@ -597,7 +793,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "GcsSource", "Source", }); internal_static_google_cloud_translation_v3beta1_Glossary_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(23); internal_static_google_cloud_translation_v3beta1_Glossary_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3beta1_Glossary_descriptor, @@ -632,7 +828,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "LanguageCodes", }); internal_static_google_cloud_translation_v3beta1_CreateGlossaryRequest_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(24); internal_static_google_cloud_translation_v3beta1_CreateGlossaryRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3beta1_CreateGlossaryRequest_descriptor, @@ -640,7 +836,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Glossary", }); internal_static_google_cloud_translation_v3beta1_GetGlossaryRequest_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(25); internal_static_google_cloud_translation_v3beta1_GetGlossaryRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3beta1_GetGlossaryRequest_descriptor, @@ -648,7 +844,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_translation_v3beta1_DeleteGlossaryRequest_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(26); internal_static_google_cloud_translation_v3beta1_DeleteGlossaryRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3beta1_DeleteGlossaryRequest_descriptor, @@ -656,7 +852,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_translation_v3beta1_ListGlossariesRequest_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(27); internal_static_google_cloud_translation_v3beta1_ListGlossariesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3beta1_ListGlossariesRequest_descriptor, @@ -664,7 +860,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", "Filter", }); internal_static_google_cloud_translation_v3beta1_ListGlossariesResponse_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(28); internal_static_google_cloud_translation_v3beta1_ListGlossariesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3beta1_ListGlossariesResponse_descriptor, @@ -672,7 +868,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Glossaries", "NextPageToken", }); internal_static_google_cloud_translation_v3beta1_CreateGlossaryMetadata_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(29); internal_static_google_cloud_translation_v3beta1_CreateGlossaryMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3beta1_CreateGlossaryMetadata_descriptor, @@ -680,7 +876,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "State", "SubmitTime", }); internal_static_google_cloud_translation_v3beta1_DeleteGlossaryMetadata_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(30); internal_static_google_cloud_translation_v3beta1_DeleteGlossaryMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3beta1_DeleteGlossaryMetadata_descriptor, @@ -688,13 +884,97 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "State", "SubmitTime", }); internal_static_google_cloud_translation_v3beta1_DeleteGlossaryResponse_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(31); internal_static_google_cloud_translation_v3beta1_DeleteGlossaryResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_translation_v3beta1_DeleteGlossaryResponse_descriptor, new java.lang.String[] { "Name", "SubmitTime", "EndTime", }); + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_descriptor, + new java.lang.String[] { + "Parent", + "SourceLanguageCode", + "TargetLanguageCodes", + "InputConfigs", + "OutputConfig", + "Models", + "Glossaries", + }); + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_ModelsEntry_descriptor = + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_ModelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_ModelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_GlossariesEntry_descriptor = + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_GlossariesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentRequest_GlossariesEntry_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 = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_BatchDocumentInputConfig_descriptor, + new java.lang.String[] { + "GcsSource", "Source", + }); + internal_static_google_cloud_translation_v3beta1_BatchDocumentOutputConfig_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_google_cloud_translation_v3beta1_BatchDocumentOutputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_BatchDocumentOutputConfig_descriptor, + new java.lang.String[] { + "GcsDestination", "Destination", + }); + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentResponse_descriptor = + getDescriptor().getMessageTypes().get(35); + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentResponse_descriptor, + new java.lang.String[] { + "TotalPages", + "TranslatedPages", + "FailedPages", + "TotalBillablePages", + "TotalCharacters", + "TranslatedCharacters", + "FailedCharacters", + "TotalBillableCharacters", + "SubmitTime", + "EndTime", + }); + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentMetadata_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_google_cloud_translation_v3beta1_BatchTranslateDocumentMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_translation_v3beta1_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); 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 ef49f000..6c10de0f 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 @@ -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"; @@ -68,7 +67,8 @@ service TranslationService { } // Returns a list of supported languages for translation. - rpc GetSupportedLanguages(GetSupportedLanguagesRequest) returns (SupportedLanguages) { + rpc GetSupportedLanguages(GetSupportedLanguagesRequest) + returns (SupportedLanguages) { option (google.api.http) = { get: "/v3beta1/{parent=projects/*/locations/*}/supportedLanguages" additional_bindings { @@ -78,6 +78,15 @@ service TranslationService { option (google.api.method_signature) = "parent,display_language_code,model"; } + // Translates documents in synchronous mode. + rpc TranslateDocument(TranslateDocumentRequest) + returns (TranslateDocumentResponse) { + option (google.api.http) = { + post: "/v3beta1/{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 @@ -85,7 +94,8 @@ service TranslationService { // // This call returns immediately and you can // use google.longrunning.Operation.name to poll the status of the call. - rpc BatchTranslateText(BatchTranslateTextRequest) returns (google.longrunning.Operation) { + rpc BatchTranslateText(BatchTranslateTextRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v3beta1/{parent=projects/*/locations/*}:batchTranslateText" body: "*" @@ -96,9 +106,29 @@ service TranslationService { }; } + // Translates a large volume of documents 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: "/v3beta1/{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) returns (google.longrunning.Operation) { + rpc CreateGlossary(CreateGlossaryRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v3beta1/{parent=projects/*/locations/*}/glossaries" body: "glossary" @@ -116,7 +146,6 @@ service TranslationService { option (google.api.http) = { get: "/v3beta1/{parent=projects/*/locations/*}/glossaries" }; - option (google.api.method_signature) = "parent"; option (google.api.method_signature) = "parent,filter"; } @@ -132,7 +161,8 @@ service TranslationService { // Deletes a glossary, or cancels glossary construction // if the glossary isn't created yet. // Returns NOT_FOUND, if the glossary doesn't exist. - rpc DeleteGlossary(DeleteGlossaryRequest) returns (google.longrunning.Operation) { + rpc DeleteGlossary(DeleteGlossaryRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v3beta1/{name=projects/*/locations/*/glossaries/*}" }; @@ -159,7 +189,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]; @@ -181,11 +212,11 @@ message TranslateTextRequest { // Required. Project or location to make a call. Must refer to a caller's // project. // - // Format: `projects/{project-id}` or - // `projects/{project-id}/locations/{location-id}`. + // Format: `projects/{project-number-or-id}` or + // `projects/{project-number-or-id}/locations/{location-id}`. // - // For global calls, use `projects/{project-id}/locations/global` or - // `projects/{project-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. @@ -204,16 +235,16 @@ message TranslateTextRequest { // The format depends on model type: // // - AutoML Translation models: - // `projects/{project-id}/locations/{location-id}/models/{model-id}` + // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` // // - General (built-in) models: - // `projects/{project-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-id}/locations/{location-id}/models/general/base` + // `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-id}/locations/global/models/general/nmt`. + // `projects/{project-number-or-id}/locations/global/models/general/nmt`. // // If missing, the system decides which google base model to use. string model = 6 [(google.api.field_behavior) = OPTIONAL]; @@ -221,7 +252,8 @@ message TranslateTextRequest { // 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]; + TranslateTextGlossaryConfig glossary_config = 7 + [(google.api.field_behavior) = OPTIONAL]; // Optional. The labels with user-defined metadata for the request. // @@ -242,8 +274,8 @@ message TranslateTextResponse { // Text translation responses if a glossary is provided in the request. // This can be the same as - // [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply. - // This field has the same length as + // [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] + // if no terms apply. This field has the same length as // [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents]. repeated Translation glossary_translations = 3; } @@ -254,7 +286,13 @@ message Translation { string translated_text = 1; // Only present when `model` is present in the request. - // This is same as `model` provided in the request. + // `model` here is normalized to have project number. + // + // For example: + // If the `model` requested in TranslationTextRequest 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 = 2; // The BCP-47 language code of source text in the initial request, detected @@ -272,13 +310,13 @@ message DetectLanguageRequest { // Required. Project or location to make a call. Must refer to a caller's // project. // - // Format: `projects/{project-id}/locations/{location-id}` or - // `projects/{project-id}`. + // Format: `projects/{project-number-or-id}/locations/{location-id}` or + // `projects/{project-number-or-id}`. // - // For global calls, use `projects/{project-id}/locations/global` or - // `projects/{project-id}`. + // For global calls, use `projects/{project-number-or-id}/locations/global` or + // `projects/{project-number-or-id}`. // - // Only models within the same region (has same location-id) can be used. + // Only models within the same region, which have the same location-id, can be used. // Otherwise an INVALID_ARGUMENT (400) error is returned. string parent = 5 [ (google.api.field_behavior) = REQUIRED, @@ -290,10 +328,10 @@ message DetectLanguageRequest { // Optional. The language detection model to be used. // // Format: - // `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` + // `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` // // Only one language detection model is currently supported: - // `projects/{project-id}/locations/{location-id}/models/language-detection/default`. + // `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. // // If not specified, the default model is used. string model = 4 [(google.api.field_behavior) = OPTIONAL]; @@ -316,7 +354,7 @@ message DetectLanguageRequest { // Label values are optional. Label keys must start with a letter. // // See https://cloud.google.com/translate/docs/labels for more information. - map labels = 6; + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; } // The response message for language detection. @@ -341,11 +379,11 @@ message GetSupportedLanguagesRequest { // Required. Project or location to make a call. Must refer to a caller's // project. // - // Format: `projects/{project-id}` or - // `projects/{project-id}/locations/{location-id}`. + // Format: `projects/{project-number-or-id}` or + // `projects/{project-number-or-id}/locations/{location-id}`. // - // For global calls, use `projects/{project-id}/locations/global` or - // `projects/{project-id}`. + // For global calls, use `projects/{project-number-or-id}/locations/global` or + // `projects/{project-number-or-id}`. // // Non-global location is required for AutoML models. // @@ -368,11 +406,11 @@ message GetSupportedLanguagesRequest { // The format depends on model type: // // - AutoML Translation models: - // `projects/{project-id}/locations/{location-id}/models/{model-id}` + // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` // // - General (built-in) models: - // `projects/{project-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-id}/locations/{location-id}/models/general/base` + // `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. @@ -485,12 +523,17 @@ message OutputConfig { // 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 + // changes. Callers should also expect the contents in the input_file are // processed and ready to be consumed (that is, no partial output file is // written). // + // Since index.csv will be updated during the process, please make + // sure there is no custom retention policy applied on the output bucket + // that may prevent 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: @@ -507,10 +550,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 @@ -522,16 +565,230 @@ 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`, + // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + // + // + // 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. // - // Format: `projects/{project-id}/locations/{location-id}`. + // Format: `projects/{project-number-or-id}/locations/{location-id}`. // // The `global` location is not supported for batch translation. // @@ -549,20 +806,21 @@ message BatchTranslateTextRequest { string source_language_code = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Specify up to 10 language codes here. - repeated string target_language_codes = 3 [(google.api.field_behavior) = REQUIRED]; + repeated string target_language_codes = 3 + [(google.api.field_behavior) = REQUIRED]; // Optional. The models to use for translation. Map's key is target language - // code. Map's value is model name. Value can be a built-in general model, + // 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-id}/locations/{location-id}/models/{model-id}` + // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` // // - General (built-in) models: - // `projects/{project-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-id}/locations/{location-id}/models/general/base` + // `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 @@ -570,10 +828,11 @@ 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 [(google.api.field_behavior) = REQUIRED]; + repeated InputConfig input_configs = 5 + [(google.api.field_behavior) = REQUIRED]; // Required. Output configuration. // If 2 input configs match to the same file (that is, same input path), @@ -582,7 +841,8 @@ message BatchTranslateTextRequest { // Optional. Glossaries to be applied for translation. // It's keyed by target language code. - map glossaries = 7 [(google.api.field_behavior) = OPTIONAL]; + map glossaries = 7 + [(google.api.field_behavior) = OPTIONAL]; // Optional. The labels with user-defined metadata for the request. // @@ -641,8 +901,10 @@ message BatchTranslateMetadata { google.protobuf.Timestamp submit_time = 5; } -// Stored in the [google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by -// BatchTranslateText if at least one sentence is translated successfully. +// Stored in the +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field returned by BatchTranslateText if at least one sentence is translated +// successfully. message BatchTranslateResponse { // Total number of characters (Unicode codepoints). int64 total_characters = 1; @@ -657,7 +919,8 @@ message BatchTranslateResponse { google.protobuf.Timestamp submit_time = 4; // The time when the operation is finished and - // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true. + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is + // set to true. google.protobuf.Timestamp end_time = 5; } @@ -718,7 +981,7 @@ message Glossary { } // Required. The resource name of the glossary. Glossary names have the form - // `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`. + // `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. string name = 1 [(google.api.field_behavior) = REQUIRED]; // Languages supported by the glossary. @@ -738,10 +1001,12 @@ message Glossary { int32 entry_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. When CreateGlossary was called. - google.protobuf.Timestamp submit_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp submit_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. When the glossary creation was finished. - google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp end_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request message for CreateGlossary. @@ -801,7 +1066,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]; } @@ -817,8 +1095,9 @@ message ListGlossariesResponse { string next_page_token = 2; } -// Stored in the [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by -// CreateGlossary. +// Stored in the +// [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] +// field returned by CreateGlossary. message CreateGlossaryMetadata { // Enumerates the possible states that the creation request can be in. enum State { @@ -852,8 +1131,9 @@ message CreateGlossaryMetadata { google.protobuf.Timestamp submit_time = 3; } -// Stored in the [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by -// DeleteGlossary. +// Stored in the +// [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] +// field returned by DeleteGlossary. message DeleteGlossaryMetadata { // Enumerates the possible states that the creation request can be in. enum State { @@ -887,8 +1167,9 @@ message DeleteGlossaryMetadata { google.protobuf.Timestamp submit_time = 3; } -// Stored in the [google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by -// DeleteGlossary. +// Stored in the +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field returned by DeleteGlossary. message DeleteGlossaryResponse { // The name of the deleted glossary. string name = 1; @@ -897,6 +1178,256 @@ message DeleteGlossaryResponse { google.protobuf.Timestamp submit_time = 2; // The time when the glossary deletion is finished and - // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true. + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is + // 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]; + + // 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`, + // `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. + 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]; +} + +// 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 supported for `.docx`, `.pptx` and `.xlsx` is 100MB. + // The max file size supported for `.pdf` is 1GB and the max page limit is + // 1000 pages. + // The max file size supported 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 a + // clear page definition (such as XLSX) are not counted. + int64 total_pages = 1; + + // Number of successfully translated pages in all documents. Documents without + // a 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 + // a 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/synth.metadata b/synth.metadata index 41734383..8fbb2846 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,16 +11,16 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1305ca41d554eb0725237561e34129373bb8cbc1", - "internalRef": "362856902" + "sha": "d6b4fb337caf6eccb606728ef727ac76364a4f14", + "internalRef": "364358156" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1305ca41d554eb0725237561e34129373bb8cbc1", - "internalRef": "362856902" + "sha": "d6b4fb337caf6eccb606728ef727ac76364a4f14", + "internalRef": "364358156" } }, { @@ -202,6 +202,16 @@ "proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationOrBuilder.java", "proto-google-cloud-translate-v3/src/main/java/com/google/cloud/translate/v3/TranslationServiceProto.java", "proto-google-cloud-translate-v3/src/main/proto/google/cloud/translate/v3/translation_service.proto", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentInputConfig.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentInputConfigOrBuilder.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentOutputConfig.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchDocumentOutputConfigOrBuilder.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentMetadata.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentMetadataOrBuilder.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequest.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentRequestOrBuilder.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentResponse.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateDocumentResponseOrBuilder.java", "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateMetadata.java", "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateMetadataOrBuilder.java", "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/BatchTranslateResponse.java", @@ -224,6 +234,12 @@ "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DetectLanguageResponseOrBuilder.java", "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DetectedLanguage.java", "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DetectedLanguageOrBuilder.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentInputConfig.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentInputConfigOrBuilder.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentOutputConfig.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentOutputConfigOrBuilder.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentTranslation.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/DocumentTranslationOrBuilder.java", "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GcsDestination.java", "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GcsDestinationOrBuilder.java", "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/GcsSource.java", @@ -250,6 +266,10 @@ "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/SupportedLanguageOrBuilder.java", "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/SupportedLanguages.java", "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/SupportedLanguagesOrBuilder.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentRequest.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentRequestOrBuilder.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentResponse.java", + "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateDocumentResponseOrBuilder.java", "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextGlossaryConfig.java", "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextGlossaryConfigOrBuilder.java", "proto-google-cloud-translate-v3beta1/src/main/java/com/google/cloud/translate/v3beta1/TranslateTextRequest.java",