diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java index ba3d4306..b88d772e 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java @@ -39,6 +39,15 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+ *     DocumentUnderstandingServiceClient.create()) {
+ *   List requests = new ArrayList<>();
+ *   BatchProcessDocumentsResponse response =
+ *       documentUnderstandingServiceClient.batchProcessDocumentsAsync(requests).get();
+ * }
+ * }
+ * *

Note: close() needs to be called on the DocumentUnderstandingServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). @@ -161,6 +170,17 @@ public final OperationsClient getOperationsClient() { /** * LRO endpoint to batch process many documents. * + *

Sample code: + * + *

{@code
+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+   *     DocumentUnderstandingServiceClient.create()) {
+   *   List requests = new ArrayList<>();
+   *   BatchProcessDocumentsResponse response =
+   *       documentUnderstandingServiceClient.batchProcessDocumentsAsync(requests).get();
+   * }
+   * }
+ * * @param requests Required. Individual requests for each document. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -175,6 +195,21 @@ public final OperationsClient getOperationsClient() { /** * LRO endpoint to batch process many documents. * + *

Sample code: + * + *

{@code
+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+   *     DocumentUnderstandingServiceClient.create()) {
+   *   BatchProcessDocumentsRequest request =
+   *       BatchProcessDocumentsRequest.newBuilder()
+   *           .addAllRequests(new ArrayList())
+   *           .setParent("parent-995424086")
+   *           .build();
+   *   BatchProcessDocumentsResponse response =
+   *       documentUnderstandingServiceClient.batchProcessDocumentsAsync(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 */ @@ -188,6 +223,23 @@ public final OperationsClient getOperationsClient() { * LRO endpoint to batch process many documents. * *

Sample code: + * + *

{@code
+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+   *     DocumentUnderstandingServiceClient.create()) {
+   *   BatchProcessDocumentsRequest request =
+   *       BatchProcessDocumentsRequest.newBuilder()
+   *           .addAllRequests(new ArrayList())
+   *           .setParent("parent-995424086")
+   *           .build();
+   *   OperationFuture future =
+   *       documentUnderstandingServiceClient
+   *           .batchProcessDocumentsOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   BatchProcessDocumentsResponse response = future.get();
+   * }
+   * }
*/ public final OperationCallable< BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> @@ -200,6 +252,21 @@ public final OperationsClient getOperationsClient() { * LRO endpoint to batch process many documents. * *

Sample code: + * + *

{@code
+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+   *     DocumentUnderstandingServiceClient.create()) {
+   *   BatchProcessDocumentsRequest request =
+   *       BatchProcessDocumentsRequest.newBuilder()
+   *           .addAllRequests(new ArrayList())
+   *           .setParent("parent-995424086")
+   *           .build();
+   *   ApiFuture future =
+   *       documentUnderstandingServiceClient.batchProcessDocumentsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable batchProcessDocumentsCallable() { diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java index 0913ae45..2e345e3d 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java @@ -24,6 +24,15 @@ * vision, and translation. * *

Sample for DocumentUnderstandingServiceClient: + * + *

{@code
+ * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+ *     DocumentUnderstandingServiceClient.create()) {
+ *   List requests = new ArrayList<>();
+ *   BatchProcessDocumentsResponse response =
+ *       documentUnderstandingServiceClient.batchProcessDocumentsAsync(requests).get();
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.documentai.v1beta1; diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java index 3273eb66..ce355449 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java @@ -39,6 +39,25 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+ *     DocumentUnderstandingServiceClient.create()) {
+ *   ProcessDocumentRequest request =
+ *       ProcessDocumentRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setInputConfig(InputConfig.newBuilder().build())
+ *           .setOutputConfig(OutputConfig.newBuilder().build())
+ *           .setDocumentType("documentType-1473196299")
+ *           .setTableExtractionParams(TableExtractionParams.newBuilder().build())
+ *           .setFormExtractionParams(FormExtractionParams.newBuilder().build())
+ *           .setEntityExtractionParams(EntityExtractionParams.newBuilder().build())
+ *           .setOcrParams(OcrParams.newBuilder().build())
+ *           .setAutomlParams(AutoMlParams.newBuilder().build())
+ *           .build();
+ *   Document response = documentUnderstandingServiceClient.processDocument(request);
+ * }
+ * }
+ * *

Note: close() needs to be called on the DocumentUnderstandingServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). @@ -162,6 +181,17 @@ public final OperationsClient getOperationsClient() { * LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in * the [Document] format. * + *

Sample code: + * + *

{@code
+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+   *     DocumentUnderstandingServiceClient.create()) {
+   *   List requests = new ArrayList<>();
+   *   BatchProcessDocumentsResponse response =
+   *       documentUnderstandingServiceClient.batchProcessDocumentsAsync(requests).get();
+   * }
+   * }
+ * * @param requests Required. Individual requests for each document. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -177,6 +207,21 @@ public final OperationsClient getOperationsClient() { * LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in * the [Document] format. * + *

Sample code: + * + *

{@code
+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+   *     DocumentUnderstandingServiceClient.create()) {
+   *   BatchProcessDocumentsRequest request =
+   *       BatchProcessDocumentsRequest.newBuilder()
+   *           .addAllRequests(new ArrayList())
+   *           .setParent("parent-995424086")
+   *           .build();
+   *   BatchProcessDocumentsResponse response =
+   *       documentUnderstandingServiceClient.batchProcessDocumentsAsync(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 */ @@ -191,6 +236,23 @@ public final OperationsClient getOperationsClient() { * the [Document] format. * *

Sample code: + * + *

{@code
+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+   *     DocumentUnderstandingServiceClient.create()) {
+   *   BatchProcessDocumentsRequest request =
+   *       BatchProcessDocumentsRequest.newBuilder()
+   *           .addAllRequests(new ArrayList())
+   *           .setParent("parent-995424086")
+   *           .build();
+   *   OperationFuture future =
+   *       documentUnderstandingServiceClient
+   *           .batchProcessDocumentsOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   BatchProcessDocumentsResponse response = future.get();
+   * }
+   * }
*/ public final OperationCallable< BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> @@ -204,6 +266,21 @@ public final OperationsClient getOperationsClient() { * the [Document] format. * *

Sample code: + * + *

{@code
+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+   *     DocumentUnderstandingServiceClient.create()) {
+   *   BatchProcessDocumentsRequest request =
+   *       BatchProcessDocumentsRequest.newBuilder()
+   *           .addAllRequests(new ArrayList())
+   *           .setParent("parent-995424086")
+   *           .build();
+   *   ApiFuture future =
+   *       documentUnderstandingServiceClient.batchProcessDocumentsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable batchProcessDocumentsCallable() { @@ -214,6 +291,27 @@ public final OperationsClient getOperationsClient() { /** * Processes a single document. * + *

Sample code: + * + *

{@code
+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+   *     DocumentUnderstandingServiceClient.create()) {
+   *   ProcessDocumentRequest request =
+   *       ProcessDocumentRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setInputConfig(InputConfig.newBuilder().build())
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .setDocumentType("documentType-1473196299")
+   *           .setTableExtractionParams(TableExtractionParams.newBuilder().build())
+   *           .setFormExtractionParams(FormExtractionParams.newBuilder().build())
+   *           .setEntityExtractionParams(EntityExtractionParams.newBuilder().build())
+   *           .setOcrParams(OcrParams.newBuilder().build())
+   *           .setAutomlParams(AutoMlParams.newBuilder().build())
+   *           .build();
+   *   Document response = documentUnderstandingServiceClient.processDocument(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 */ @@ -226,6 +324,28 @@ public final Document processDocument(ProcessDocumentRequest request) { * Processes a single document. * *

Sample code: + * + *

{@code
+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+   *     DocumentUnderstandingServiceClient.create()) {
+   *   ProcessDocumentRequest request =
+   *       ProcessDocumentRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setInputConfig(InputConfig.newBuilder().build())
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .setDocumentType("documentType-1473196299")
+   *           .setTableExtractionParams(TableExtractionParams.newBuilder().build())
+   *           .setFormExtractionParams(FormExtractionParams.newBuilder().build())
+   *           .setEntityExtractionParams(EntityExtractionParams.newBuilder().build())
+   *           .setOcrParams(OcrParams.newBuilder().build())
+   *           .setAutomlParams(AutoMlParams.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       documentUnderstandingServiceClient.processDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   Document response = future.get();
+   * }
+   * }
*/ public final UnaryCallable processDocumentCallable() { return stub.processDocumentCallable(); diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java index 4284f8dc..316376ea 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java @@ -24,6 +24,25 @@ * vision, and translation. * *

Sample for DocumentUnderstandingServiceClient: + * + *

{@code
+ * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+ *     DocumentUnderstandingServiceClient.create()) {
+ *   ProcessDocumentRequest request =
+ *       ProcessDocumentRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setInputConfig(InputConfig.newBuilder().build())
+ *           .setOutputConfig(OutputConfig.newBuilder().build())
+ *           .setDocumentType("documentType-1473196299")
+ *           .setTableExtractionParams(TableExtractionParams.newBuilder().build())
+ *           .setFormExtractionParams(FormExtractionParams.newBuilder().build())
+ *           .setEntityExtractionParams(EntityExtractionParams.newBuilder().build())
+ *           .setOcrParams(OcrParams.newBuilder().build())
+ *           .setAutomlParams(AutoMlParams.newBuilder().build())
+ *           .build();
+ *   Document response = documentUnderstandingServiceClient.processDocument(request);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.documentai.v1beta2; diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java index b1be2943..98e43921 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/DocumentProcessorServiceClient.java @@ -39,6 +39,14 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+ *     DocumentProcessorServiceClient.create()) {
+ *   ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
+ *   ProcessResponse response = documentProcessorServiceClient.processDocument(name);
+ * }
+ * }
+ * *

Note: close() needs to be called on the DocumentProcessorServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). @@ -159,6 +167,16 @@ public final OperationsClient getOperationsClient() { /** * Processes a single document. * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
+   *   ProcessResponse response = documentProcessorServiceClient.processDocument(name);
+   * }
+   * }
+ * * @param name Required. The processor resource name. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -172,6 +190,16 @@ public final ProcessResponse processDocument(ProcessorName name) { /** * Processes a single document. * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
+   *   ProcessResponse response = documentProcessorServiceClient.processDocument(name);
+   * }
+   * }
+ * * @param name Required. The processor resource name. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -184,6 +212,21 @@ public final ProcessResponse processDocument(String name) { /** * Processes a single document. * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessRequest request =
+   *       ProcessRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setDocument(Document.newBuilder().build())
+   *           .setSkipHumanReview(true)
+   *           .build();
+   *   ProcessResponse response = documentProcessorServiceClient.processDocument(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 */ @@ -196,6 +239,22 @@ public final ProcessResponse processDocument(ProcessRequest request) { * Processes a single document. * *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessRequest request =
+   *       ProcessRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setDocument(Document.newBuilder().build())
+   *           .setSkipHumanReview(true)
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.processDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   ProcessResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable processDocumentCallable() { return stub.processDocumentCallable(); @@ -206,6 +265,17 @@ public final UnaryCallable processDocumentCalla * LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in * the [Document] format. * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
+   *   BatchProcessResponse response =
+   *       documentProcessorServiceClient.batchProcessDocumentsAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The processor resource name. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -221,6 +291,17 @@ public final UnaryCallable processDocumentCalla * LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in * the [Document] format. * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
+   *   BatchProcessResponse response =
+   *       documentProcessorServiceClient.batchProcessDocumentsAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The processor resource name. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -235,6 +316,22 @@ public final UnaryCallable processDocumentCalla * LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in * the [Document] format. * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   BatchProcessRequest request =
+   *       BatchProcessRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .addAllInputConfigs(new ArrayList())
+   *           .setOutputConfig(BatchProcessRequest.BatchOutputConfig.newBuilder().build())
+   *           .build();
+   *   BatchProcessResponse response =
+   *       documentProcessorServiceClient.batchProcessDocumentsAsync(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 */ @@ -249,6 +346,24 @@ public final UnaryCallable processDocumentCalla * the [Document] format. * *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   BatchProcessRequest request =
+   *       BatchProcessRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .addAllInputConfigs(new ArrayList())
+   *           .setOutputConfig(BatchProcessRequest.BatchOutputConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient
+   *           .batchProcessDocumentsOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   BatchProcessResponse response = future.get();
+   * }
+   * }
*/ public final OperationCallable batchProcessDocumentsOperationCallable() { @@ -261,6 +376,22 @@ public final UnaryCallable processDocumentCalla * the [Document] format. * *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   BatchProcessRequest request =
+   *       BatchProcessRequest.newBuilder()
+   *           .setName(ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .addAllInputConfigs(new ArrayList())
+   *           .setOutputConfig(BatchProcessRequest.BatchOutputConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.batchProcessDocumentsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable batchProcessDocumentsCallable() { return stub.batchProcessDocumentsCallable(); @@ -271,6 +402,18 @@ public final UnaryCallable batchProcessDocuments * Send a document for Human Review. The input document should be processed by the specified * processor. * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   HumanReviewConfigName humanReviewConfig =
+   *       HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
+   *   ReviewDocumentResponse response =
+   *       documentProcessorServiceClient.reviewDocumentAsync(humanReviewConfig).get();
+   * }
+   * }
+ * * @param humanReviewConfig Required. The resource name of the HumanReviewConfig that the document * will be reviewed with. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -289,6 +432,18 @@ public final UnaryCallable batchProcessDocuments * Send a document for Human Review. The input document should be processed by the specified * processor. * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   String humanReviewConfig =
+   *       HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
+   *   ReviewDocumentResponse response =
+   *       documentProcessorServiceClient.reviewDocumentAsync(humanReviewConfig).get();
+   * }
+   * }
+ * * @param humanReviewConfig Required. The resource name of the HumanReviewConfig that the document * will be reviewed with. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -305,6 +460,22 @@ public final UnaryCallable batchProcessDocuments * Send a document for Human Review. The input document should be processed by the specified * processor. * + *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ReviewDocumentRequest request =
+   *       ReviewDocumentRequest.newBuilder()
+   *           .setHumanReviewConfig(
+   *               HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setDocument(Document.newBuilder().build())
+   *           .build();
+   *   ReviewDocumentResponse response =
+   *       documentProcessorServiceClient.reviewDocumentAsync(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 */ @@ -319,6 +490,22 @@ public final UnaryCallable batchProcessDocuments * processor. * *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ReviewDocumentRequest request =
+   *       ReviewDocumentRequest.newBuilder()
+   *           .setHumanReviewConfig(
+   *               HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setDocument(Document.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       documentProcessorServiceClient.reviewDocumentOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ReviewDocumentResponse response = future.get();
+   * }
+   * }
*/ public final OperationCallable< ReviewDocumentRequest, ReviewDocumentResponse, ReviewDocumentOperationMetadata> @@ -332,6 +519,22 @@ public final UnaryCallable batchProcessDocuments * processor. * *

Sample code: + * + *

{@code
+   * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+   *     DocumentProcessorServiceClient.create()) {
+   *   ReviewDocumentRequest request =
+   *       ReviewDocumentRequest.newBuilder()
+   *           .setHumanReviewConfig(
+   *               HumanReviewConfigName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
+   *           .setDocument(Document.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       documentProcessorServiceClient.reviewDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable reviewDocumentCallable() { return stub.reviewDocumentCallable(); diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/package-info.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/package-info.java index 99ba0a34..452fe7aa 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/package-info.java +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta3/package-info.java @@ -25,6 +25,14 @@ * semi-structured documents. * *

Sample for DocumentProcessorServiceClient: + * + *

{@code
+ * try (DocumentProcessorServiceClient documentProcessorServiceClient =
+ *     DocumentProcessorServiceClient.create()) {
+ *   ProcessorName name = ProcessorName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
+ *   ProcessResponse response = documentProcessorServiceClient.processDocument(name);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.documentai.v1beta3; diff --git a/synth.metadata b/synth.metadata index 3e78d9ed..999c838f 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,31 +4,31 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-document-ai.git", - "sha": "b322316b4592841d64a9012b0f53d4e8ef72025b" + "sha": "f3411064d84526c06fc97e06a1982c9a2582af31" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {