@@ -692,6 +692,130 @@ public final UnaryCallable<BatchTranslateTextRequest, Operation> batchTranslateT
692692 return stub .batchTranslateTextCallable ();
693693 }
694694
695+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
696+ /**
697+ * Translates a large volume of documents in asynchronous batch mode. This function provides
698+ * real-time output as the inputs are being processed. If caller cancels a request, the partial
699+ * results (for an input file, it's all or nothing) may still be available on the specified output
700+ * location.
701+ *
702+ * <p>This call returns immediately and you can use google.longrunning.Operation.name to poll the
703+ * status of the call.
704+ *
705+ * <p>Sample code:
706+ *
707+ * <pre>{@code
708+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
709+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
710+ * String sourceLanguageCode = "sourceLanguageCode1645917472";
711+ * List<String> targetLanguageCodes = new ArrayList<>();
712+ * List<BatchDocumentInputConfig> inputConfigs = new ArrayList<>();
713+ * BatchDocumentOutputConfig outputConfig = BatchDocumentOutputConfig.newBuilder().build();
714+ * BatchTranslateDocumentResponse response =
715+ * translationServiceClient
716+ * .batchTranslateDocumentAsync(
717+ * parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig)
718+ * .get();
719+ * }
720+ * }</pre>
721+ *
722+ * @param parent Required. Location to make a regional call.
723+ * <p>Format: `projects/{project-number-or-id}/locations/{location-id}`.
724+ * <p>The `global` location is not supported for batch translation.
725+ * <p>Only AutoML Translation models or glossaries within the same region (have the same
726+ * location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.
727+ * @param sourceLanguageCode Required. The BCP-47 language code of the input document if known,
728+ * for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support
729+ * (https://cloud.google.com/translate/docs/languages).
730+ * @param targetLanguageCodes Required. The BCP-47 language code to use for translation of the
731+ * input document. Specify up to 10 language codes here.
732+ * @param inputConfigs Required. Input configurations. The total number of files matched should be
733+ * <= 100. The total content size to translate should be <= 100M Unicode codepoints. The
734+ * files must use UTF-8 encoding.
735+ * @param outputConfig Required. Output configuration. If 2 input configs match to the same file
736+ * (that is, same input path), we don't generate output for duplicate inputs.
737+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
738+ */
739+ public final OperationFuture <BatchTranslateDocumentResponse , BatchTranslateDocumentMetadata >
740+ batchTranslateDocumentAsync (
741+ LocationName parent ,
742+ String sourceLanguageCode ,
743+ List <String > targetLanguageCodes ,
744+ List <BatchDocumentInputConfig > inputConfigs ,
745+ BatchDocumentOutputConfig outputConfig ) {
746+ BatchTranslateDocumentRequest request =
747+ BatchTranslateDocumentRequest .newBuilder ()
748+ .setParent (parent == null ? null : parent .toString ())
749+ .setSourceLanguageCode (sourceLanguageCode )
750+ .addAllTargetLanguageCodes (targetLanguageCodes )
751+ .addAllInputConfigs (inputConfigs )
752+ .setOutputConfig (outputConfig )
753+ .build ();
754+ return batchTranslateDocumentAsync (request );
755+ }
756+
757+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
758+ /**
759+ * Translates a large volume of documents in asynchronous batch mode. This function provides
760+ * real-time output as the inputs are being processed. If caller cancels a request, the partial
761+ * results (for an input file, it's all or nothing) may still be available on the specified output
762+ * location.
763+ *
764+ * <p>This call returns immediately and you can use google.longrunning.Operation.name to poll the
765+ * status of the call.
766+ *
767+ * <p>Sample code:
768+ *
769+ * <pre>{@code
770+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
771+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
772+ * String sourceLanguageCode = "sourceLanguageCode1645917472";
773+ * List<String> targetLanguageCodes = new ArrayList<>();
774+ * List<BatchDocumentInputConfig> inputConfigs = new ArrayList<>();
775+ * BatchDocumentOutputConfig outputConfig = BatchDocumentOutputConfig.newBuilder().build();
776+ * BatchTranslateDocumentResponse response =
777+ * translationServiceClient
778+ * .batchTranslateDocumentAsync(
779+ * parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig)
780+ * .get();
781+ * }
782+ * }</pre>
783+ *
784+ * @param parent Required. Location to make a regional call.
785+ * <p>Format: `projects/{project-number-or-id}/locations/{location-id}`.
786+ * <p>The `global` location is not supported for batch translation.
787+ * <p>Only AutoML Translation models or glossaries within the same region (have the same
788+ * location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.
789+ * @param sourceLanguageCode Required. The BCP-47 language code of the input document if known,
790+ * for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support
791+ * (https://cloud.google.com/translate/docs/languages).
792+ * @param targetLanguageCodes Required. The BCP-47 language code to use for translation of the
793+ * input document. Specify up to 10 language codes here.
794+ * @param inputConfigs Required. Input configurations. The total number of files matched should be
795+ * <= 100. The total content size to translate should be <= 100M Unicode codepoints. The
796+ * files must use UTF-8 encoding.
797+ * @param outputConfig Required. Output configuration. If 2 input configs match to the same file
798+ * (that is, same input path), we don't generate output for duplicate inputs.
799+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
800+ */
801+ public final OperationFuture <BatchTranslateDocumentResponse , BatchTranslateDocumentMetadata >
802+ batchTranslateDocumentAsync (
803+ String parent ,
804+ String sourceLanguageCode ,
805+ List <String > targetLanguageCodes ,
806+ List <BatchDocumentInputConfig > inputConfigs ,
807+ BatchDocumentOutputConfig outputConfig ) {
808+ BatchTranslateDocumentRequest request =
809+ BatchTranslateDocumentRequest .newBuilder ()
810+ .setParent (parent )
811+ .setSourceLanguageCode (sourceLanguageCode )
812+ .addAllTargetLanguageCodes (targetLanguageCodes )
813+ .addAllInputConfigs (inputConfigs )
814+ .setOutputConfig (outputConfig )
815+ .build ();
816+ return batchTranslateDocumentAsync (request );
817+ }
818+
695819 // AUTO-GENERATED DOCUMENTATION AND METHOD.
696820 /**
697821 * Translates a large volume of documents in asynchronous batch mode. This function provides
0 commit comments