@@ -194,7 +194,8 @@ public final OperationsClient getOperationsClient() {
194194 * @param targetLanguageCode Required. The BCP-47 language code to use for translation of the
195195 * input text, set to one of the language codes listed in Language Support.
196196 * @param contents Required. The content of the input in string format. We recommend the total
197- * content be less than 30k codepoints. Use BatchTranslateText for larger text.
197+ * content be less than 30k codepoints. The max length of this field is 1024. Use
198+ * BatchTranslateText for larger text.
198199 * @throws com.google.api.gax.rpc.ApiException if the remote call fails
199200 */
200201 public final TranslateTextResponse translateText (
@@ -235,7 +236,8 @@ public final TranslateTextResponse translateText(
235236 * @param targetLanguageCode Required. The BCP-47 language code to use for translation of the
236237 * input text, set to one of the language codes listed in Language Support.
237238 * @param contents Required. The content of the input in string format. We recommend the total
238- * content be less than 30k codepoints. Use BatchTranslateText for larger text.
239+ * content be less than 30k codepoints. The max length of this field is 1024. Use
240+ * BatchTranslateText for larger text.
239241 * @throws com.google.api.gax.rpc.ApiException if the remote call fails
240242 */
241243 public final TranslateTextResponse translateText (
@@ -283,10 +285,9 @@ public final TranslateTextResponse translateText(
283285 * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
284286 * <p>- General (built-in) models:
285287 * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
286- * `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
287288 * <p>For global (non-regionalized) requests, use `location-id` `global`. For example,
288289 * `projects/{project-number-or-id}/locations/global/models/general/nmt`.
289- * <p>If missing , the system decides which google base model to use .
290+ * <p>If not provided , the default Google model (NMT) will be used .
290291 * @param mimeType Optional. The format of the source text, for example, "text/html",
291292 * "text/plain". If left blank, the MIME type defaults to "text/html".
292293 * @param sourceLanguageCode Optional. The BCP-47 language code of the input text if known, for
@@ -296,7 +297,8 @@ public final TranslateTextResponse translateText(
296297 * @param targetLanguageCode Required. The BCP-47 language code to use for translation of the
297298 * input text, set to one of the language codes listed in Language Support.
298299 * @param contents Required. The content of the input in string format. We recommend the total
299- * content be less than 30k codepoints. Use BatchTranslateText for larger text.
300+ * content be less than 30k codepoints. The max length of this field is 1024. Use
301+ * BatchTranslateText for larger text.
300302 * @throws com.google.api.gax.rpc.ApiException if the remote call fails
301303 */
302304 public final TranslateTextResponse translateText (
@@ -352,10 +354,9 @@ public final TranslateTextResponse translateText(
352354 * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
353355 * <p>- General (built-in) models:
354356 * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
355- * `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
356357 * <p>For global (non-regionalized) requests, use `location-id` `global`. For example,
357358 * `projects/{project-number-or-id}/locations/global/models/general/nmt`.
358- * <p>If missing , the system decides which google base model to use .
359+ * <p>If not provided , the default Google model (NMT) will be used .
359360 * @param mimeType Optional. The format of the source text, for example, "text/html",
360361 * "text/plain". If left blank, the MIME type defaults to "text/html".
361362 * @param sourceLanguageCode Optional. The BCP-47 language code of the input text if known, for
@@ -365,7 +366,8 @@ public final TranslateTextResponse translateText(
365366 * @param targetLanguageCode Required. The BCP-47 language code to use for translation of the
366367 * input text, set to one of the language codes listed in Language Support.
367368 * @param contents Required. The content of the input in string format. We recommend the total
368- * content be less than 30k codepoints. Use BatchTranslateText for larger text.
369+ * content be less than 30k codepoints. The max length of this field is 1024. Use
370+ * BatchTranslateText for larger text.
369371 * @throws com.google.api.gax.rpc.ApiException if the remote call fails
370372 */
371373 public final TranslateTextResponse translateText (
@@ -624,9 +626,8 @@ public final DetectLanguageResponse detectLanguage(DetectLanguageRequest request
624626 * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
625627 * <p>- General (built-in) models:
626628 * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
627- * `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
628629 * <p>Returns languages supported by the specified model. If missing, we get supported
629- * languages of Google general base (PBMT) model.
630+ * languages of Google general NMT model.
630631 * @param displayLanguageCode Optional. The language to use to return localized, human readable
631632 * names of supported languages. If missing, then display names are not returned in a
632633 * response.
@@ -673,9 +674,8 @@ public final SupportedLanguages getSupportedLanguages(
673674 * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
674675 * <p>- General (built-in) models:
675676 * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
676- * `projects/{project-number-or-id}/locations/{location-id}/models/general/base`
677677 * <p>Returns languages supported by the specified model. If missing, we get supported
678- * languages of Google general base (PBMT) model.
678+ * languages of Google general NMT model.
679679 * @param displayLanguageCode Optional. The language to use to return localized, human readable
680680 * names of supported languages. If missing, then display names are not returned in a
681681 * response.
@@ -743,6 +743,67 @@ public final SupportedLanguages getSupportedLanguages(GetSupportedLanguagesReque
743743 return stub .getSupportedLanguagesCallable ();
744744 }
745745
746+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
747+ /**
748+ * Translates documents in synchronous mode.
749+ *
750+ * <p>Sample code:
751+ *
752+ * <pre>{@code
753+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
754+ * TranslateDocumentRequest request =
755+ * TranslateDocumentRequest.newBuilder()
756+ * .setParent("parent-995424086")
757+ * .setSourceLanguageCode("sourceLanguageCode1645917472")
758+ * .setTargetLanguageCode("targetLanguageCode-106414698")
759+ * .setDocumentInputConfig(DocumentInputConfig.newBuilder().build())
760+ * .setDocumentOutputConfig(DocumentOutputConfig.newBuilder().build())
761+ * .setModel("model104069929")
762+ * .setGlossaryConfig(TranslateTextGlossaryConfig.newBuilder().build())
763+ * .putAllLabels(new HashMap<String, String>())
764+ * .build();
765+ * TranslateDocumentResponse response = translationServiceClient.translateDocument(request);
766+ * }
767+ * }</pre>
768+ *
769+ * @param request The request object containing all of the parameters for the API call.
770+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
771+ */
772+ public final TranslateDocumentResponse translateDocument (TranslateDocumentRequest request ) {
773+ return translateDocumentCallable ().call (request );
774+ }
775+
776+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
777+ /**
778+ * Translates documents in synchronous mode.
779+ *
780+ * <p>Sample code:
781+ *
782+ * <pre>{@code
783+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
784+ * TranslateDocumentRequest request =
785+ * TranslateDocumentRequest.newBuilder()
786+ * .setParent("parent-995424086")
787+ * .setSourceLanguageCode("sourceLanguageCode1645917472")
788+ * .setTargetLanguageCode("targetLanguageCode-106414698")
789+ * .setDocumentInputConfig(DocumentInputConfig.newBuilder().build())
790+ * .setDocumentOutputConfig(DocumentOutputConfig.newBuilder().build())
791+ * .setModel("model104069929")
792+ * .setGlossaryConfig(TranslateTextGlossaryConfig.newBuilder().build())
793+ * .putAllLabels(new HashMap<String, String>())
794+ * .build();
795+ * ApiFuture<TranslateDocumentResponse> future =
796+ * translationServiceClient.translateDocumentCallable().futureCall(request);
797+ * // Do something.
798+ * TranslateDocumentResponse response = future.get();
799+ * }
800+ * }</pre>
801+ */
802+ public final UnaryCallable <TranslateDocumentRequest , TranslateDocumentResponse >
803+ translateDocumentCallable () {
804+ return stub .translateDocumentCallable ();
805+ }
806+
746807 // AUTO-GENERATED DOCUMENTATION AND METHOD.
747808 /**
748809 * Translates a large volume of text in asynchronous batch mode. This function provides real-time
@@ -852,6 +913,121 @@ public final UnaryCallable<BatchTranslateTextRequest, Operation> batchTranslateT
852913 return stub .batchTranslateTextCallable ();
853914 }
854915
916+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
917+ /**
918+ * Translates a large volume of document in asynchronous batch mode. This function provides
919+ * real-time output as the inputs are being processed. If caller cancels a request, the partial
920+ * results (for an input file, it's all or nothing) may still be available on the specified output
921+ * location.
922+ *
923+ * <p>This call returns immediately and you can use google.longrunning.Operation.name to poll the
924+ * status of the call.
925+ *
926+ * <p>Sample code:
927+ *
928+ * <pre>{@code
929+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
930+ * BatchTranslateDocumentRequest request =
931+ * BatchTranslateDocumentRequest.newBuilder()
932+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
933+ * .setSourceLanguageCode("sourceLanguageCode1645917472")
934+ * .addAllTargetLanguageCodes(new ArrayList<String>())
935+ * .addAllInputConfigs(new ArrayList<BatchDocumentInputConfig>())
936+ * .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build())
937+ * .putAllModels(new HashMap<String, String>())
938+ * .putAllGlossaries(new HashMap<String, TranslateTextGlossaryConfig>())
939+ * .putAllFormatConversions(new HashMap<String, String>())
940+ * .build();
941+ * BatchTranslateDocumentResponse response =
942+ * translationServiceClient.batchTranslateDocumentAsync(request).get();
943+ * }
944+ * }</pre>
945+ *
946+ * @param request The request object containing all of the parameters for the API call.
947+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
948+ */
949+ public final OperationFuture <BatchTranslateDocumentResponse , BatchTranslateDocumentMetadata >
950+ batchTranslateDocumentAsync (BatchTranslateDocumentRequest request ) {
951+ return batchTranslateDocumentOperationCallable ().futureCall (request );
952+ }
953+
954+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
955+ /**
956+ * Translates a large volume of document in asynchronous batch mode. This function provides
957+ * real-time output as the inputs are being processed. If caller cancels a request, the partial
958+ * results (for an input file, it's all or nothing) may still be available on the specified output
959+ * location.
960+ *
961+ * <p>This call returns immediately and you can use google.longrunning.Operation.name to poll the
962+ * status of the call.
963+ *
964+ * <p>Sample code:
965+ *
966+ * <pre>{@code
967+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
968+ * BatchTranslateDocumentRequest request =
969+ * BatchTranslateDocumentRequest.newBuilder()
970+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
971+ * .setSourceLanguageCode("sourceLanguageCode1645917472")
972+ * .addAllTargetLanguageCodes(new ArrayList<String>())
973+ * .addAllInputConfigs(new ArrayList<BatchDocumentInputConfig>())
974+ * .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build())
975+ * .putAllModels(new HashMap<String, String>())
976+ * .putAllGlossaries(new HashMap<String, TranslateTextGlossaryConfig>())
977+ * .putAllFormatConversions(new HashMap<String, String>())
978+ * .build();
979+ * OperationFuture<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> future =
980+ * translationServiceClient.batchTranslateDocumentOperationCallable().futureCall(request);
981+ * // Do something.
982+ * BatchTranslateDocumentResponse response = future.get();
983+ * }
984+ * }</pre>
985+ */
986+ public final OperationCallable <
987+ BatchTranslateDocumentRequest ,
988+ BatchTranslateDocumentResponse ,
989+ BatchTranslateDocumentMetadata >
990+ batchTranslateDocumentOperationCallable () {
991+ return stub .batchTranslateDocumentOperationCallable ();
992+ }
993+
994+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
995+ /**
996+ * Translates a large volume of document in asynchronous batch mode. This function provides
997+ * real-time output as the inputs are being processed. If caller cancels a request, the partial
998+ * results (for an input file, it's all or nothing) may still be available on the specified output
999+ * location.
1000+ *
1001+ * <p>This call returns immediately and you can use google.longrunning.Operation.name to poll the
1002+ * status of the call.
1003+ *
1004+ * <p>Sample code:
1005+ *
1006+ * <pre>{@code
1007+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
1008+ * BatchTranslateDocumentRequest request =
1009+ * BatchTranslateDocumentRequest.newBuilder()
1010+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1011+ * .setSourceLanguageCode("sourceLanguageCode1645917472")
1012+ * .addAllTargetLanguageCodes(new ArrayList<String>())
1013+ * .addAllInputConfigs(new ArrayList<BatchDocumentInputConfig>())
1014+ * .setOutputConfig(BatchDocumentOutputConfig.newBuilder().build())
1015+ * .putAllModels(new HashMap<String, String>())
1016+ * .putAllGlossaries(new HashMap<String, TranslateTextGlossaryConfig>())
1017+ * .putAllFormatConversions(new HashMap<String, String>())
1018+ * .build();
1019+ * ApiFuture<Operation> future =
1020+ * translationServiceClient.batchTranslateDocumentCallable().futureCall(request);
1021+ * // Do something.
1022+ * Operation response = future.get();
1023+ * }
1024+ * }</pre>
1025+ */
1026+ public final UnaryCallable <BatchTranslateDocumentRequest , Operation >
1027+ batchTranslateDocumentCallable () {
1028+ return stub .batchTranslateDocumentCallable ();
1029+ }
1030+
8551031 // AUTO-GENERATED DOCUMENTATION AND METHOD.
8561032 /**
8571033 * Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project
0 commit comments